mirror of
https://github.com/servo/servo.git
synced 2025-07-01 04:23:39 +01:00
24 lines
874 B
HTML
24 lines
874 B
HTML
<!DOCTYPE html>
|
|
<meta charset="utf-8">
|
|
<title>Async Clipboard writeText -> readText tests</title>
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script>
|
|
async_test(function(t) {
|
|
var test_data = "Clipboard writeText -> readText test data";
|
|
var cb = navigator.clipboard;
|
|
cb.writeText(test_data).then(t.step_func(() => {
|
|
cb.readText().then(t.step_func((data) => {
|
|
assert_equals(data, test_data);
|
|
t.done();
|
|
}), function() {
|
|
t.unreached_func("clipboard.readText() fail");
|
|
});
|
|
}), function() {
|
|
t.unreached_func("clipboard.writeText() fail");
|
|
});
|
|
}, "Verify write and read clipboard (DOMString)");
|
|
</script>
|
|
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.
|