https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 96a24630129573978168b40892e9128f4e1861df authored by Mikhail Pozdnyakov on 27 March 2018, 18:32:09 UTC
Enable WPT tests for the Generic Sensor classes
Tip revision: 96a2463
async-write-dttext-read-text-manual.https.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>Async Clipboard write (dt/text) -> readText tests</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
async_test(function(t) {
  var test_data = "Clipboard write (dt/text) -> readText test data";
  var cb = navigator.clipboard;
  var dt = new DataTransfer();
  dt.items.add(test_data, "text/plain");

  cb.write(dt).then(t.step_func(() => {
    cb.readText().then(t.step_func((data) => {
      assert_equals(data, test_data);
      t.done();
    }), function() {
      t.unreached_func("clipboard.read() fail");
    });
  }), function() {
    t.unreached_func("clipboard.write() fail");
  });
}, "Verify write and read clipboard (DataTransfer/text)");
</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