Permalink
Browse files

Auto merge of #22859 - servo-wpt-sync:wpt_update_08-02-2019, r=jdm

Sync WPT with upstream (08-02-2019)

Automated downstream sync of changes from upstream as of 08-02-2019.
[no-wpt-sync]

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22859)
<!-- Reviewable:end -->
  • Loading branch information...
bors-servo committed Feb 9, 2019
2 parents 71ba247 + 05db47b commit 5de6d87c97050db35cfb0a575e14b4d9b6207ac5
Showing with 2,570 additions and 1,222 deletions.
  1. +406 −93 tests/wpt/metadata/MANIFEST.json
  2. +183 −180 tests/wpt/metadata/css/cssom/interfaces.html.ini
  3. +3 −0 tests/wpt/metadata/fetch/nosniff/parsing-nosniff.window.js.ini
  4. +4 −0 ...across-documents/javascript-url-abort/javascript-url-abort-return-value-string.tentative.html.ini
  5. +5 −0 ...oss-documents/javascript-url-abort/javascript-url-abort-return-value-undefined.tentative.html.ini
  6. +0 −4 tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_1.html.ini
  7. +1 −1 ...history/the-history-interface/{traverse_the_history_4.html.ini → traverse_the_history_2.html.ini}
  8. +0 −4 tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_5.html.ini
  9. +7 −0 tests/wpt/metadata/html/semantics/interactive-elements/the-details-element/toggleEvent.html.ini
  10. +5 −0 tests/wpt/metadata/resource-timing/resource-reload-TAO.sub.html.ini
  11. +1 −0 tests/wpt/metadata/workers/semantics/multiple-workers/005.html.ini
  12. +13 −0 tests/wpt/web-platform-tests/animation-worklet/common.js
  13. +11 −0 tests/wpt/web-platform-tests/animation-worklet/references/translated-box-ref.html
  14. +37 −0 tests/wpt/web-platform-tests/animation-worklet/worklet-animation-pause-immediately.https.html
  15. +40 −0 tests/wpt/web-platform-tests/animation-worklet/worklet-animation-pause-resume.https.html
  16. +60 −0 tests/wpt/web-platform-tests/animation-worklet/worklet-animation-pause.https.html
  17. +4 −17 tests/wpt/web-platform-tests/background-fetch/fetch.https.window.js
  18. +1 −1 tests/wpt/web-platform-tests/background-fetch/idlharness.https.any.js
  19. +13 −20 tests/wpt/web-platform-tests/clipboard-apis/async-navigator-clipboard-basics.https.html
  20. +27 −0 tests/wpt/web-platform-tests/clipboard-apis/async-write-blobtext-read-blobtext-manual.https.html
  21. +25 −0 tests/wpt/web-platform-tests/clipboard-apis/async-write-blobtext-read-text-manual.https.html
  22. +0 −25 tests/wpt/web-platform-tests/clipboard-apis/async-write-dttext-read-dttext-manual.https.html
  23. +0 −20 tests/wpt/web-platform-tests/clipboard-apis/async-write-dttext-read-text-manual.https.html
  24. +4 −2 tests/wpt/web-platform-tests/clipboard-apis/async-write-image-read-image-manual.https.html
  25. +25 −0 tests/wpt/web-platform-tests/clipboard-apis/async-write-text-read-blobtext-manual.https.html
  26. +0 −23 tests/wpt/web-platform-tests/clipboard-apis/async-write-text-read-dttext-manual.https.html
  27. +14 −9 tests/wpt/web-platform-tests/clipboard-apis/async-write-text-read-text-manual.https.html
  28. +1 −0 tests/wpt/web-platform-tests/css/css-overscroll-behavior/META.yml
  29. +24 −0 tests/wpt/web-platform-tests/css/css-overscroll-behavior/parsing/overscroll-behavior-computed.html
  30. +28 −0 tests/wpt/web-platform-tests/css/css-overscroll-behavior/parsing/overscroll-behavior-invalid.html
  31. +36 −0 tests/wpt/web-platform-tests/css/css-overscroll-behavior/parsing/overscroll-behavior-valid.html
  32. +46 −0 tests/wpt/web-platform-tests/feature-policy/reporting/serial-report-only.https.html
  33. +1 −0 tests/wpt/web-platform-tests/feature-policy/reporting/serial-report-only.https.html.headers
  34. +54 −0 tests/wpt/web-platform-tests/feature-policy/reporting/serial-reporting.https.html
  35. +1 −0 tests/wpt/web-platform-tests/feature-policy/reporting/serial-reporting.https.html.headers
  36. +10 −0 tests/wpt/web-platform-tests/feature-policy/resources/feature-policy-serial-worker.html
  37. +14 −0 tests/wpt/web-platform-tests/feature-policy/resources/feature-policy-serial-worker.js
  38. +9 −0 tests/wpt/web-platform-tests/feature-policy/resources/feature-policy-serial.html
  39. +0 −82 ...l/browsers/origin/relaxing-the-same-origin-restriction/document_domain_setter_null.tentative.html
  40. +0 −21 ...ests/html/browsers/origin/relaxing-the-same-origin-restriction/support/document_domain_frame.html
  41. +1 −0 ...wpt/web-platform-tests/html/infrastructure/urls/resolving-urls/query-encoding/attributes.sub.html
  42. +1 −0 ...s/wpt/web-platform-tests/html/infrastructure/urls/resolving-urls/query-encoding/location.sub.html
  43. +1 −0 ...wpt/web-platform-tests/html/infrastructure/urls/resolving-urls/query-encoding/navigation.sub.html
  44. +1 −0 ...orm-tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/scripts/Function.js
  45. +1 −0 ...latform-tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/scripts/eval.js
  46. +2 −1 ...ics/scripting-1/the-script-element/module/dynamic-import/scripts/inline-event-handlers-UA-code.js
  47. +2 −1 ...s/scripting-1/the-script-element/module/dynamic-import/scripts/reflected-inline-event-handlers.js
  48. +1 −0 ...m-tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/scripts/setTimeout.js
  49. +5 −5 ...antics/scripting-1/the-script-element/module/dynamic-import/string-compilation-nonce-classic.html
  50. +5 −5 ...mantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-nonce-module.html
  51. +23 −2 ...ntics/scripting-1/the-script-element/module/dynamic-import/string-compilation-other-document.html
  52. +13 −6 tests/wpt/web-platform-tests/interfaces/cssom.idl
  53. +21 −21 tests/wpt/web-platform-tests/mathml/presentation-markup/fractions/frac-1.html
  54. +21 −21 tests/wpt/web-platform-tests/mathml/presentation-markup/fractions/frac-parameters-1.html
  55. +15 −15 tests/wpt/web-platform-tests/mathml/presentation-markup/fractions/frac-parameters-2.html
  56. +9 −9 tests/wpt/web-platform-tests/mathml/presentation-markup/operators/mo-axis-height-1.html
  57. +28 −28 tests/wpt/web-platform-tests/mathml/presentation-markup/radicals/root-parameters-1.html
  58. +12 −12 tests/wpt/web-platform-tests/mathml/presentation-markup/scripts/subsup-1.html
  59. +22 −22 tests/wpt/web-platform-tests/mathml/presentation-markup/scripts/subsup-2.html
  60. +54 −54 tests/wpt/web-platform-tests/mathml/presentation-markup/scripts/subsup-3.html
  61. +38 −38 tests/wpt/web-platform-tests/mathml/presentation-markup/scripts/subsup-4.html
  62. +14 −14 tests/wpt/web-platform-tests/mathml/presentation-markup/scripts/subsup-5.html
  63. +67 −67 tests/wpt/web-platform-tests/mathml/presentation-markup/scripts/subsup-parameters-1.html
  64. +16 −16 tests/wpt/web-platform-tests/mathml/presentation-markup/scripts/subsup-parameters-2.html
  65. +36 −36 tests/wpt/web-platform-tests/mathml/presentation-markup/scripts/underover-1.html
  66. +17 −17 tests/wpt/web-platform-tests/mathml/presentation-markup/scripts/underover-parameters-1.html
  67. +17 −17 tests/wpt/web-platform-tests/mathml/presentation-markup/scripts/underover-parameters-2.html
  68. +89 −89 tests/wpt/web-platform-tests/mathml/presentation-markup/scripts/underover-parameters-3.html
  69. +89 −89 tests/wpt/web-platform-tests/mathml/presentation-markup/scripts/underover-parameters-4.html
  70. +4 −4 tests/wpt/web-platform-tests/mathml/presentation-markup/spaces/space-1.html
  71. +9 −9 tests/wpt/web-platform-tests/mathml/presentation-markup/spaces/space-2.html
  72. +3 −2 tests/wpt/web-platform-tests/mathml/presentation-markup/tables/table-axis-height.html
  73. +1 −1 tests/wpt/web-platform-tests/mathml/relations/css-styling/display-1.html
  74. +1 −0 tests/wpt/web-platform-tests/mathml/relations/css-styling/displaystyle-1.html
  75. +1 −1 tests/wpt/web-platform-tests/mathml/relations/css-styling/lengths-3.html
  76. +2 −1 tests/wpt/web-platform-tests/mathml/relations/html5-tree/class-2.html
  77. +1 −0 tests/wpt/web-platform-tests/mathml/relations/html5-tree/display-1.html
  78. +2 −2 tests/wpt/web-platform-tests/mathml/relations/html5-tree/href-click-1.html
  79. +2 −2 tests/wpt/web-platform-tests/mathml/relations/html5-tree/href-click-2.html
  80. +2 −1 tests/wpt/web-platform-tests/mathml/relations/html5-tree/unique-identifier-2.html
  81. +1 −1 tests/wpt/web-platform-tests/payment-handler/idlharness.https.any.js
  82. +105 −0 tests/wpt/web-platform-tests/payment-request/payment-request-canmakepayment-method-manual.https.html
  83. +2 −47 tests/wpt/web-platform-tests/payment-request/payment-request-canmakepayment-method.https.html
  84. +146 −0 ...web-platform-tests/payment-request/payment-request-hasenrolledinstrument-method-manual.https.html
  85. +68 −0 ...platform-tests/payment-request/payment-request-hasenrolledinstrument-method-protection.https.html
  86. +36 −0 tests/wpt/web-platform-tests/payment-request/payment-request-hasenrolledinstrument-method.https.html
  87. +25 −0 tests/wpt/web-platform-tests/resource-timing/resource-reload-TAO.sub.html
  88. +17 −0 tests/wpt/web-platform-tests/resource-timing/resources/cors-ahem.py
  89. +28 −0 tests/wpt/web-platform-tests/resource-timing/resources/iframe-reload-TAO.sub.html
  90. +14 −0 tests/wpt/web-platform-tests/serial/resources/serial-allowed-by-feature-policy-worker.js
  91. +17 −0 tests/wpt/web-platform-tests/serial/resources/serial-disabled-by-feature-policy-worker.js
  92. +44 −0 ...-platform-tests/serial/serial-allowed-by-feature-policy-attribute-redirect-on-load.https.sub.html
  93. +46 −0 tests/wpt/web-platform-tests/serial/serial-allowed-by-feature-policy-attribute.https.sub.html
  94. +44 −0 tests/wpt/web-platform-tests/serial/serial-allowed-by-feature-policy.https.sub.html
  95. +1 −0 tests/wpt/web-platform-tests/serial/serial-allowed-by-feature-policy.https.sub.html.headers
  96. +27 −0 tests/wpt/web-platform-tests/serial/serial-default-feature-policy.https.sub.html
  97. +48 −0 tests/wpt/web-platform-tests/serial/serial-disabled-by-feature-policy.https.sub.html
  98. +1 −0 tests/wpt/web-platform-tests/serial/serial-disabled-by-feature-policy.https.sub.html.headers
  99. +4 −7 tests/wpt/web-platform-tests/tools/wpt/browser.py
  100. +21 −14 ...latform-tests/webaudio/the-audio-api/the-audionode-interface/audionode-disconnect-audioparam.html
  101. +3 −2 ...m-tests/webaudio/the-audio-api/the-channelmergernode-interface/audiochannelmerger-disconnect.html
  102. +33 −0 tests/wpt/web-platform-tests/webrtc/RTCIceConnectionState-candidate-pair.https.html
  103. +49 −0 tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-helper.js
  104. +20 −0 ...rtc/{RTCPeerConnection-iceConnectionState.html → RTCPeerConnection-iceConnectionState.https.html}
  105. +4 −22 tests/wpt/web-platform-tests/webrtc/RTCPeerConnection-track-stats.https.html
  106. +0 −15 tests/wpt/web-platform-tests/webrtc/RTCRtpReceiver-getSynchronizationSources.https.html
  107. +2 −2 tests/wpt/web-platform-tests/webxr/xrSession_identity_referenceSpace.https.html
  108. +1 −1 tests/wpt/web-platform-tests/webxr/xrSession_requestAnimationFrame_data_valid.https.html
  109. +1 −1 tests/wpt/web-platform-tests/webxr/xrSession_requestAnimationFrame_getViewerPose.https.html

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -11,3 +11,6 @@
[X-Content-Type-Options%3A%20nosniff%0C]
expected: FAIL

[Content-Type-Options%3A%20nosniff]
expected: FAIL

@@ -0,0 +1,4 @@
[javascript-url-abort-return-value-string.tentative.html]
[Aborting fetch for javascript:string navigation]
expected: FAIL

@@ -0,0 +1,5 @@
[javascript-url-abort-return-value-undefined.tentative.html]
expected: TIMEOUT
[Not aborting fetch for javascript:undefined navigation]
expected: TIMEOUT

This file was deleted.

Oops, something went wrong.
@@ -1,4 +1,4 @@
[traverse_the_history_4.html]
[traverse_the_history_2.html]
[Multiple history traversals, last would be aborted]
expected: FAIL

This file was deleted.

Oops, something went wrong.
@@ -0,0 +1,7 @@
[toggleEvent.html]
[Calling open twice on 'details' fires only one toggle event]
expected: FAIL

[Setting open=true to opened 'details' element should not fire a toggle event at the 'details' element]
expected: FAIL

@@ -0,0 +1,5 @@
[resource-reload-TAO.sub.html]
expected: TIMEOUT
[Test that TAO headers are reused on reloads.]
expected: TIMEOUT

@@ -1,4 +1,5 @@
[005.html]
expected: ERROR
[dedicated worker in shared worker in dedicated worker]
expected: FAIL

@@ -30,3 +30,16 @@ function waitForAsyncAnimationFrames(count) {
// AnimationWorklet.
return waitForAnimationFrames(count + 1);
}

async function waitForAnimationFrameWithCondition(condition) {
do {
await new Promise(window.requestAnimationFrame);
} while (!condition())
};

async function waitForDocumentTimelineAdvance() {
const timeAtStart = document.timeline.currentTime;
do {
await new Promise(window.requestAnimationFrame);
} while (timeAtStart === document.timeline.currentTime)
}
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<style>
#box {
width: 100px;
height: 100px;
transform: translateY(100px);
background-color: green;
}
</style>

<div id="box"></div>
@@ -0,0 +1,37 @@
<!DOCTYPE html>
<html class="reftest-wait">
<title>Verify that calling pause immediately after playing works as expected</title>
<link rel="help" href="https://drafts.css-houdini.org/css-animationworklet/">
<link rel="match" href="references/translated-box-ref.html">

<script src="/common/reftest-wait.js"></script>
<script src="/web-animations/testcommon.js"></script>
<script src="common.js"></script>
<style>
#box {
width: 100px;
height: 100px;
background-color: green;
}
</style>

<div id="box"></div>

<script>
registerPassthroughAnimator().then(async _ => {
const box = document.getElementById('box');
const effect = new KeyframeEffect(box,
{ transform: ['translateY(100px)', 'translateY(200px)'] },
{ duration: 100, iterations: 1 }
);
const animation = new WorkletAnimation('passthrough', effect);
animation.play();
// Immediately pausing animation should freeze the current time at 0.
animation.pause();
// Wait at least one frame to ensure a paused animation actually freezes.
await waitForAsyncAnimationFrames(1);
takeScreenshot();
});
</script>
</html>
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<html class="reftest-wait">
<title>Verify that calling pause immediately after playing works as expected</title>
<link rel="help" href="https://drafts.css-houdini.org/css-animationworklet/">
<link rel="match" href="references/translated-box-ref.html">

<script src="/common/reftest-wait.js"></script>
<script src="common.js"></script>
<style>
#box {
width: 100px;
height: 100px;
background-color: green;
}
</style>

<div id="box"></div>

<script>
registerPassthroughAnimator().then(async _ => {
const duration = 18; // a bit longer than a frame
const box = document.getElementById('box');
const effect = new KeyframeEffect(box,
{ transform: ['translateY(0px)', 'translateY(100px)'] },
{ duration: duration, iterations: 1, fill: 'forwards'}
);
const animation = new WorkletAnimation('passthrough', effect);
// Immediately pausing animation should freeze the current time at 0.
animation.pause();
// Playing should cause animation to resume.
animation.play();
// Wait until we ensure animation has reached completion.
await waitForAnimationFrameWithCondition( _ => {
return animation.currentTime >= duration;
});
takeScreenshot();
});
</script>
</html>
@@ -0,0 +1,60 @@
<!DOCTYPE html>
<title>Verify that currentTime and playState are correct when animation is paused</title>
<link rel="help" href="https://drafts.css-houdini.org/css-animationworklet/">

<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/web-animations/testcommon.js"></script>
<script src="common.js"></script>

<div id="box"></div>

<script>
setup(setupAndRegisterTests, {explicit_done: true});
function createAnimation() {
const box = document.getElementById('box');
const effect = new KeyframeEffect(box,
{ transform: ['translateY(100px)', 'translateY(200px)'] },
{ duration: 100, iterations: 1 }
);
return new WorkletAnimation('passthrough', effect);
}
async function setupAndRegisterTests() {
await registerPassthroughAnimator();
promise_test(async t => {
const animation = createAnimation();
animation.play();
// Immediately pausing animation should freeze the current time at 0.
animation.pause();
assert_equals(animation.currentTime, 0);
assert_equals(animation.playState, "paused");
// Wait some time to ensure a paused animation actually freezes.
await waitForNextFrame();
assert_equals(animation.currentTime, 0);
assert_equals(animation.playState, "paused");
}, 'pausing an animation freezes its current time');
promise_test(async t => {
const animation = createAnimation();
animation.pause();
animation.play();
// Allow one async animation frame to pass so that animation is running.
await waitForAsyncAnimationFrames(1);
assert_equals(animation.playState, "running");
// Allow time to advance so that we have a non-zero current time.
await waitForDocumentTimelineAdvance();
const timelineTime = document.timeline.currentTime;
assert_greater_than(animation.currentTime, 0);
assert_times_equal(animation.currentTime, (timelineTime - animation.startTime));
}, 'playing a paused animation should resume it');
done();
}
</script>

@@ -347,22 +347,9 @@ backgroundFetchTest(async (test, backgroundFetch) => {
uniqueId(), ['resources/feature-name.txt', '/common/slow.py']);

const record = await registration.match('resources/feature-name.txt');

await new Promise(resolve => {
const expectedResultText = 'Background Fetch';

registration.onprogress = async event => {
if (event.target.downloaded < expectedResultText.length)
return;

const response = await record.responseReady;

assert_true(response.url.includes('resources/feature-name.txt'));
const completedResponseText = await response.text();
assert_equals(completedResponseText, expectedResultText);

resolve();
};
});
const response = await record.responseReady;
assert_true(response.url.includes('resources/feature-name.txt'));
const completedResponseText = await response.text();
assert_equals(completedResponseText, 'Background Fetch');

}, 'Access to active fetches is supported.');
@@ -8,7 +8,7 @@

idl_test(
['background-fetch'],
['service-workers', 'dedicated-workers', 'dom'],
['service-workers', 'html', 'dom'],
idl_array => {
const isServiceWorker = location.pathname.includes('.serviceworker.');
if (isServiceWorker) {
@@ -11,28 +11,27 @@
assert_equals(navigator.clipboard, navigator.clipboard);
}, "navigator.clipboard exists");
/* clipboard.write() */
/* clipboard.write(Blob/text) */
promise_test(async () => {
const dt = new DataTransfer();
dt.items.add("Howdy", "text/plain");
await navigator.clipboard.write(dt);
}, "navigator.clipboard.write(DataTransfer) succeeds");
const blob = new Blob(["hello"], {type: 'text/plain'});
await navigator.clipboard.write(blob);
}, "navigator.clipboard.write(Blob) succeeds");
promise_test(async t => {
await promise_rejects(t, new TypeError(),
navigator.clipboard.write());
}, "navigator.clipboard.write() fails (expect DataTransfer)");
}, "navigator.clipboard.write() fails (expect Blob)");
promise_test(async t => {
await promise_rejects(t, new TypeError(),
navigator.clipboard.write(null));
}, "navigator.clipboard.write(null) fails (expect DataTransfer)");
}, "navigator.clipboard.write(null) fails (expect Blob)");
promise_test(async t => {
await promise_rejects(t, new TypeError(),
navigator.clipboard.write("Bad string"));
}, "navigator.clipboard.write(DOMString) fails (expect DataTransfer)");
}, "navigator.clipboard.write(DOMString) fails (expect Blob)");
/* clipboard.writeText() */
@@ -46,27 +45,28 @@
navigator.clipboard.writeText());
}, "navigator.clipboard.writeText() fails (expect DOMString)");
/* clipboard.writeImageExperimental() */
/* clipboard.write(Blob/image) */
promise_test(async () => {
const fetched = await fetch(
'http://localhost:8001/clipboard-apis/resources/greenbox.png');
const image = await fetched.blob();
await navigator.clipboard.writeImageExperimental(image);
await navigator.clipboard.write(image);
}, "navigator.clipboard.writeImageExperimental(Blob) succeeds");
promise_test(async t => {
await promise_rejects(t, new TypeError(),
navigator.clipboard.writeImageExperimental());
navigator.clipboard.write());
}, "navigator.clipboard.writeImageExperimental() fails (expect Blob)");
/* clipboard.read() */
/* Blob/text or Blob/image clipboard.read() */
promise_test(async () => {
const result = await navigator.clipboard.read();
assert_true(result instanceof DataTransfer);
assert_true(result instanceof Blob);
assert_equals(typeof result, "object");
}, "navigator.clipboard.read() succeeds");
@@ -77,11 +77,4 @@
assert_equals(typeof result, "string");
}, "navigator.clipboard.readText() succeeds");
/* clipboard.readImageExperimental() */
promise_test(async () => {
const result = await navigator.clipboard.readImageExperimental();
assert_equals(typeof result, "object");
}, "navigator.clipboard.readImageExperimental() succeeds");
</script>
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Async Clipboard write (Blob/text) -> read (Blob/text) tests</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
async function readWriteTest(textInput) {
promise_test(async t => {
const blobInput = new Blob([textInput], {type: 'text/plain'});
await navigator.clipboard.write(blobInput);
const blobOutput = await navigator.clipboard.read();
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);
}
readWriteTest("Clipboard write (Blob/text) -> read (Blob/text) test");
readWriteTest("non-Latin1 text encoding test データ");
</script>
<p>
Note: This is a manual test because it writes/reads to the shared system
clipboard and thus cannot be run async with other tests that might interact
with the clipboard.
</p>
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Async Clipboard write (Blob/text) -> readText tests</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
async function readWriteTest(textInput) {
promise_test(async t => {
const blobInput = new Blob([textInput], {type: 'text/plain'});
await navigator.clipboard.write(blobInput);
const textOutput = await navigator.clipboard.readText();
assert_equals(textOutput, textInput);
}, "Verify write and read clipboard given text: " + textInput);
}
readWriteTest("Clipboard write (Blob/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
clipboard and thus cannot be run async with other tests that might interact
with the clipboard.
</p>
Oops, something went wrong.

0 comments on commit 5de6d87

Please sign in to comment.