Revert "Reland "Async Clipboard Tests: Use quotes as per style guide.""
This reverts commit b9a0afc34eecfd6dd088f78aacb7c02a280941bc.
Reason for revert: the re-land was done by mistake.
Original change's description:
> Reland "Async Clipboard Tests: Use quotes as per style guide."
>
> This reverts commit 4b6a562c7bde8700fe66eda5d3f65b3e48750ef2.
>
> patchset 1 contains the original CL, and patchset 2 contains the fix for the issue.
>
> Original change's description:
> > Revert "Async Clipboard Tests: Use quotes as per style guide."
> >
> > This reverts commit db06615901b73ccd41abb8e15954061c61bec3fd.
> >
> > Reason for revert: broke external/wpt/clipboard-apis/async-interfaces.https.html
> >
> >
> > Original change's description:
> > > Async Clipboard Tests: Use quotes as per style guide.
> > >
> > > Use ' (single-quotes) for js string quotes, and " (double-quotes) for HTML
> > > string quotes. This was inconsistent before this CL, so make it more
> > > consistent as per the Google JS/HTML style guides.
> > >
> > > Reference:
> > > - https://google.github.io/styleguide/jsguide.html#features-strings-use-single-quotes
> > > - https://google.github.io/styleguide/htmlcssguide.html#HTML_Quotation_Marks
> > >
> > > Change-Id: I794b278b2020a329f6e3ea0deeb6136ae04122c4
> > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1531710
> > > Reviewed-by: Victor Costan <pwnall@chromium.org>
> > > Commit-Queue: Darwin Huang <huangdarwin@chromium.org>
> > > Cr-Commit-Position: refs/heads/master@{#642594}
> >
> > TBR=pwnall@chromium.org,huangdarwin@chromium.org
> >
> > Change-Id: I85f903d44f39c1b448342183a85d2f9934cecf9d
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1533098
> > Reviewed-by: Carlos Knippschild <carlosk@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#642728}
>
> TBR=carlosk@chromium.org,pwnall@chromium.org,huangdarwin@chromium.org
>
> Change-Id: Ia50561a9c648e1aa0cd520631b84c3e69a800903
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1533207
> Commit-Queue: Darwin Huang <huangdarwin@chromium.org>
> Reviewed-by: Victor Costan <pwnall@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#642752}
TBR=carlosk@chromium.org,pwnall@chromium.org,huangdarwin@chromium.org
Change-Id: I6513c9e961e67ec895bd8db8e49e388dbf9528bb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 944326
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1533311
Reviewed-by: Carlos Knippschild <carlosk@chromium.org>
Commit-Queue: Carlos Knippschild <carlosk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#642765}
diff --git a/clipboard-apis/async-interfaces.https.html b/clipboard-apis/async-interfaces.https.html
index e0d0977..0617ac1 100644
--- a/clipboard-apis/async-interfaces.https.html
+++ b/clipboard-apis/async-interfaces.https.html
@@ -1,11 +1,11 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>Clipboard IDL test</title>
-<link rel='help' href='https://w3c.github.io/clipboard-apis/'>
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<script src="/resources/WebIDLParser.js"></script>
-<script src="/resources/idlharness.js"></script>
+<link rel="help" href="https://w3c.github.io/clipboard-apis/">
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script src=/resources/WebIDLParser.js></script>
+<script src=/resources/idlharness.js></script>
<script>
'use strict';
@@ -31,9 +31,9 @@
promise_test(() => {
return Promise.all(
[
- '/interfaces/clipboard-apis.idl',
- '/interfaces/dom.idl',
+ "/interfaces/clipboard-apis.idl",
+ "/interfaces/dom.idl",
].map(fetchText))
.then(([idl, dom]) => doTest(idl, dom));
-}, 'Test driver');
+}, "Test driver");
</script>
diff --git a/clipboard-apis/async-navigator-clipboard-basics.https.html b/clipboard-apis/async-navigator-clipboard-basics.https.html
index b71b43e..7d2cba8 100644
--- a/clipboard-apis/async-navigator-clipboard-basics.https.html
+++ b/clipboard-apis/async-navigator-clipboard-basics.https.html
@@ -9,42 +9,42 @@
assert_not_equals(navigator.clipboard, undefined);
assert_true(navigator.clipboard instanceof Clipboard);
assert_equals(navigator.clipboard, navigator.clipboard);
-}, 'navigator.clipboard exists');
+}, "navigator.clipboard exists");
promise_test(async () => {
- const blob = new Blob(['hello'], {type: 'text/plain'});
+ const blob = new Blob(["hello"], {type: 'text/plain'});
await navigator.clipboard.write({'text/plain': blob});
-}, 'navigator.clipboard.write({string : text/plain Blob}) succeeds');
+}, "navigator.clipboard.write({string : text/plain Blob}) succeeds");
promise_test(async t => {
await promise_rejects(t, new TypeError(),
navigator.clipboard.write());
-}, 'navigator.clipboard.write() fails (expect {string : Blob})');
+}, "navigator.clipboard.write() fails (expect {string : Blob})");
promise_test(async t => {
await promise_rejects(t, new TypeError(),
navigator.clipboard.write(null));
-}, 'navigator.clipboard.write(null) fails (expect {string : Blob})');
+}, "navigator.clipboard.write(null) fails (expect {string : Blob})");
promise_test(async t => {
await promise_rejects(t, new TypeError(),
- navigator.clipboard.write('Bad string'));
-}, 'navigator.clipboard.write(DOMString) fails (expect {string : Blob})');
+ navigator.clipboard.write("Bad string"));
+}, "navigator.clipboard.write(DOMString) fails (expect {string : Blob})");
promise_test(async t => {
- const blob = new Blob(['hello'], {type: 'text/plain'});
+ const blob = new Blob(["hello"], {type: 'text/plain'});
await promise_rejects(t, 'NotAllowedError',
navigator.clipboard.write(blob));
-}, 'navigator.clipboard.write(Blob) fails (expect {string : Blob})');
+}, "navigator.clipboard.write(Blob) fails (expect {string : Blob})");
promise_test(async () => {
- await navigator.clipboard.writeText('New clipboard text');
-}, 'navigator.clipboard.writeText(DOMString) succeeds');
+ await navigator.clipboard.writeText("New clipboard text");
+}, "navigator.clipboard.writeText(DOMString) succeeds");
promise_test(async t => {
await promise_rejects(t, new TypeError(),
navigator.clipboard.writeText());
-}, 'navigator.clipboard.writeText() fails (expect DOMString)');
+}, "navigator.clipboard.writeText() fails (expect DOMString)");
promise_test(async () => {
const fetched = await fetch(
@@ -52,16 +52,16 @@
const image = await fetched.blob();
await navigator.clipboard.write({'image/png' : image});
-}, 'navigator.clipboard.write({string : image/png Blob}) succeeds');
+}, "navigator.clipboard.write({string : image/png Blob}) succeeds");
promise_test(async () => {
const result = await navigator.clipboard.read();
assert_true(result instanceof Object);
-}, 'navigator.clipboard.read() succeeds');
+}, "navigator.clipboard.read() succeeds");
promise_test(async () => {
const result = await navigator.clipboard.readText();
- assert_equals(typeof result, 'string');
-}, 'navigator.clipboard.readText() succeeds');
+ assert_equals(typeof result, "string");
+}, "navigator.clipboard.readText() succeeds");
</script>
diff --git a/clipboard-apis/async-write-blobs-read-blobs-manual.https.html b/clipboard-apis/async-write-blobs-read-blobs-manual.https.html
index 57cf542..3666c93 100644
--- a/clipboard-apis/async-write-blobs-read-blobs-manual.https.html
+++ b/clipboard-apis/async-write-blobs-read-blobs-manual.https.html
@@ -13,20 +13,20 @@
}
promise_test(async t => {
- const blobText = new Blob(['test text'], {type: 'text/plain'});
+ const blobText = new Blob(["test text"], {type: 'text/plain'});
const blobImage = await loadBlob('resources/greenbox.png');
- assert_equals(blobText.type, 'text/plain');
- assert_equals(blobImage.type, 'image/png');
+ assert_equals(blobText.type, "text/plain");
+ assert_equals(blobImage.type, "image/png");
await navigator.clipboard.write(
- {'text/plain' : blobText, 'image/png' : blobImage});
+ {"text/plain" : blobText, "image/png" : blobImage});
const output = await navigator.clipboard.read();
assert_equals(Object.keys(output).length, 2);
- assert_equals(output['text/plain'].type, 'text/plain');
- assert_equals(output['image/png'].type, 'image/png');
-}, 'Verify write and read clipboard (multiple blobs)');
+ assert_equals(output["text/plain"].type, "text/plain");
+ assert_equals(output["image/png"].type, "image/png");
+}, "Verify write and read clipboard (multiple blobs)");
</script>
<p>
Note: This is a manual test because it writes/reads to the shared system
diff --git a/clipboard-apis/async-write-blobtext-read-blobtext-manual.https.html b/clipboard-apis/async-write-blobtext-read-blobtext-manual.https.html
index fded721..44c5742 100644
--- a/clipboard-apis/async-write-blobtext-read-blobtext-manual.https.html
+++ b/clipboard-apis/async-write-blobtext-read-blobtext-manual.https.html
@@ -13,16 +13,16 @@
await navigator.clipboard.write({'text/plain': blobInput});
const blobsOutput = await navigator.clipboard.read();
assert_equals(Object.keys(blobsOutput).length, 1);
- const blobOutput = blobsOutput['text/plain'];
- assert_equals(blobOutput.type, 'text/plain');
+ const blobOutput = blobsOutput["text/plain"];
+ assert_equals(blobOutput.type, "text/plain");
const textOutput = await (new Response(blobOutput)).text();
assert_equals(textOutput, textInput);
- }, 'Verify write and read clipboard given text: ' + textInput);
+ }, "Verify write and read clipboard given text: " + textInput);
}
-readWriteTest('Clipboard write ([text/plain Blob]) -> read ([text/plain Blob]) test');
-readWriteTest('non-Latin1 text encoding test データ');
+readWriteTest("Clipboard write ([text/plain Blob]) -> read ([text/plain Blob]) test");
+readWriteTest("non-Latin1 text encoding test データ");
</script>
<p>
Note: This is a manual test because it writes/reads to the shared system
diff --git a/clipboard-apis/async-write-blobtext-read-text-manual.https.html b/clipboard-apis/async-write-blobtext-read-text-manual.https.html
index 98ff7c2..c991f1f 100644
--- a/clipboard-apis/async-write-blobtext-read-text-manual.https.html
+++ b/clipboard-apis/async-write-blobtext-read-text-manual.https.html
@@ -12,11 +12,11 @@
const textOutput = await navigator.clipboard.readText();
assert_equals(textOutput, textInput);
- }, 'Verify write and read clipboard given text: ' + textInput);
+ }, "Verify write and read clipboard given text: " + textInput);
}
-readWriteTest('Clipboard write ([text/plain Blob]) -> read text test');
-readWriteTest('non-Latin1 text encoding test データ');
+readWriteTest("Clipboard write ([text/plain Blob]) -> read text test");
+readWriteTest("non-Latin1 text encoding test データ");
</script>
<p>
Note: This is a manual test because it writes/reads to the shared system
diff --git a/clipboard-apis/async-write-image-read-image-manual.https.html b/clipboard-apis/async-write-image-read-image-manual.https.html
index 6c326cf..2a32348 100644
--- a/clipboard-apis/async-write-image-read-image-manual.https.html
+++ b/clipboard-apis/async-write-image-read-image-manual.https.html
@@ -9,11 +9,11 @@
<p>
<p>The bottom image should display the same image as the top image.</p>
<p>Original Image:</p>
- <image id="image-to-copy" width="20" height="20"
+ <image id='image-to-copy' width='20' height='20'
src="resources/greenbox.png"></image>
<p>Image after copy/paste:</p>
- <image id="image-on-clipboard"></image>
- <canvas id="canvas" width="20" height="20"></canvas>
+ <image id='image-on-clipboard'></image>
+ <canvas id='canvas' width='20' height='20'></canvas>
</p>
<script>
@@ -39,12 +39,12 @@
promise_test(async t => {
const blobInput = await loadBlob('resources/greenbox.png');
- assert_equals(blobInput.type, 'image/png');
- await navigator.clipboard.write({'image/png' : blobInput});
+ assert_equals(blobInput.type, "image/png");
+ await navigator.clipboard.write({"image/png" : blobInput});
const blobsOutput = await navigator.clipboard.read();
assert_equals(Object.keys(blobsOutput).length, 1);
- const blobOutput = blobsOutput['image/png'];
- assert_equals(blobOutput.type, 'image/png');
+ const blobOutput = blobsOutput["image/png"];
+ assert_equals(blobOutput.type, "image/png");
document.getElementById('image-on-clipboard').src =
window.URL.createObjectURL(blobOutput);
@@ -53,7 +53,7 @@
const comparableOutput = await getBitmapString(blobOutput);
assert_equals(comparableOutput, comparableInput);
-}, 'Verify write and read clipboard ([image/png Blob])');
+}, "Verify write and read clipboard ([image/png Blob])");
</script>
<p>
Note: This is a manual test because it writes/reads to the shared system
diff --git a/clipboard-apis/async-write-text-read-blobtext-manual.https.html b/clipboard-apis/async-write-text-read-blobtext-manual.https.html
index ab85a6f..24e6b6e 100644
--- a/clipboard-apis/async-write-text-read-blobtext-manual.https.html
+++ b/clipboard-apis/async-write-text-read-blobtext-manual.https.html
@@ -9,16 +9,16 @@
await navigator.clipboard.writeText(textInput);
const blobsOutput = await navigator.clipboard.read();
assert_equals(Object.keys(blobsOutput).length, 1);
- const blobOutput = blobsOutput['text/plain'];
- assert_equals(blobOutput.type, 'text/plain');
+ const blobOutput = blobsOutput["text/plain"];
+ assert_equals(blobOutput.type, "text/plain");
const textOutput = await (new Response(blobOutput)).text();
assert_equals(textOutput, textInput);
- }, 'Verify write and read clipboard given text: ' + textInput);
+ }, "Verify write and read clipboard given text: " + textInput);
}
-readWriteTest('Clipboard write text -> read ([text/plain Blob]) test');
-readWriteTest('non-Latin1 text encoding test データ');
+readWriteTest("Clipboard write text -> read ([text/plain Blob]) test");
+readWriteTest("non-Latin1 text encoding test データ");
</script>
<p>
Note: This is a manual test because it writes/reads to the shared system
diff --git a/clipboard-apis/async-write-text-read-text-manual.https.html b/clipboard-apis/async-write-text-read-text-manual.https.html
index 25c7edb..496bdd7 100644
--- a/clipboard-apis/async-write-text-read-text-manual.https.html
+++ b/clipboard-apis/async-write-text-read-text-manual.https.html
@@ -10,11 +10,11 @@
const textOutput = await navigator.clipboard.readText();
assert_equals(textOutput, textInput);
- }, 'Verify write and read clipboard given text: ' + textInput);
+ }, "Verify write and read clipboard given text: " + textInput);
}
-readWriteTest('Clipboard write text -> read text test');
-readWriteTest('non-Latin1 text encoding test データ');
+readWriteTest("Clipboard write text -> read text test");
+readWriteTest("non-Latin1 text encoding test データ");
</script>
<p>
Note: This is a manual test because it writes/reads to the shared system
diff --git a/clipboard-apis/copy-event-manual.html b/clipboard-apis/copy-event-manual.html
index 6f687af..e4cf337 100644
--- a/clipboard-apis/copy-event-manual.html
+++ b/clipboard-apis/copy-event-manual.html
@@ -11,9 +11,9 @@
document.oncopy = t.step_func_done(event => {
// Nothing can be asserted about the event target until
// https://github.com/w3c/clipboard-apis/issues/70 is resolved.
- // assert_equals(event.target, document.body, 'event.target');
- assert_true(event.isTrusted, 'event.isTrusted');
- assert_true(event.composed, 'event.composed');
+ // assert_equals(event.target, document.body, "event.target");
+ assert_true(event.isTrusted, "event.isTrusted");
+ assert_true(event.composed, "event.composed");
});
});
</script>
diff --git a/clipboard-apis/cut-event-manual.html b/clipboard-apis/cut-event-manual.html
index c559317..abef6f9 100644
--- a/clipboard-apis/cut-event-manual.html
+++ b/clipboard-apis/cut-event-manual.html
@@ -11,9 +11,9 @@
document.oncut = t.step_func_done(event => {
// Nothing can be asserted about the event target until
// https://github.com/w3c/clipboard-apis/issues/70 is resolved.
- // assert_equals(event.target, document.body, 'event.target');
- assert_true(event.isTrusted, 'event.isTrusted');
- assert_true(event.composed, 'event.composed');
+ // assert_equals(event.target, document.body, "event.target");
+ assert_true(event.isTrusted, "event.isTrusted");
+ assert_true(event.composed, "event.composed");
});
});
</script>
diff --git a/clipboard-apis/paste-event-manual.html b/clipboard-apis/paste-event-manual.html
index 19e6b95..4131a41 100644
--- a/clipboard-apis/paste-event-manual.html
+++ b/clipboard-apis/paste-event-manual.html
@@ -9,13 +9,13 @@
<script>
setup({explicit_timeout: true});
async_test(t => {
- getSelection().selectAllChildren(document.querySelector('p'));
+ getSelection().selectAllChildren(document.querySelector("p"));
document.onpaste = t.step_func_done(event => {
// Nothing can be asserted about the event target until
// https://github.com/w3c/clipboard-apis/issues/70 is resolved.
- // assert_equals(event.target, document.body, 'event.target');
- assert_true(event.isTrusted, 'event.isTrusted');
- assert_true(event.composed, 'event.composed');
+ // assert_equals(event.target, document.body, "event.target");
+ assert_true(event.isTrusted, "event.isTrusted");
+ assert_true(event.composed, "event.composed");
});
});
</script>