https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 8b0ebd326305e8b7268528aabc273556d79f7b27 authored by Luke Bjerring on 14 May 2018, 20:08:59 UTC
Add test for inheritance clash
Tip revision: 8b0ebd3
async-write-text-read-dttext-manual.https.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>Async Clipboard writeText -> read (dt/text) tests</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
async_test(function(t) {
  var test_data = "Clipboard writeText -> read(dt/text) test data";
  var cb = navigator.clipboard;
  cb.writeText(test_data).then(t.step_func(() => {
    cb.read().then(t.step_func((data) => {
      assert_equals(data.items.length, 1);
      data.items[0].getAsString(t.step_func((s) => {
        assert_equals(s, test_data);
        t.done();
      }));
    }), function() {
      t.unreached_func("clipboard.read() 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.
back to top