xref: /third_party/node/test/fixtures/wpt/FileAPI/FileReader/workers.html
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/fixtures/wpt/FileAPI/FileReader/
11cb0ef41Sopenharmony_ci<!DOCTYPE html>
21cb0ef41Sopenharmony_ci<meta charset=utf-8>
31cb0ef41Sopenharmony_ci<script src="/resources/testharness.js"></script>
41cb0ef41Sopenharmony_ci<script src="/resources/testharnessreport.js"></script>
51cb0ef41Sopenharmony_ci<script>
61cb0ef41Sopenharmony_ci
71cb0ef41Sopenharmony_ciasync_test(t => {
81cb0ef41Sopenharmony_ci  function workerCode() {
91cb0ef41Sopenharmony_ci    close();
101cb0ef41Sopenharmony_ci    var blob = new Blob([123]);
111cb0ef41Sopenharmony_ci    var fr = new FileReader();
121cb0ef41Sopenharmony_ci    fr.readAsText(blob);
131cb0ef41Sopenharmony_ci    fr.abort()
141cb0ef41Sopenharmony_ci    fr.readAsArrayBuffer(blob);
151cb0ef41Sopenharmony_ci    postMessage(true);
161cb0ef41Sopenharmony_ci  }
171cb0ef41Sopenharmony_ci
181cb0ef41Sopenharmony_ci  var workerBlob = new Blob([workerCode.toString() + ";workerCode();"], {type:"application/javascript"});
191cb0ef41Sopenharmony_ci
201cb0ef41Sopenharmony_ci  var w = new Worker(URL.createObjectURL(workerBlob));
211cb0ef41Sopenharmony_ci  w.onmessage = function(e) {
221cb0ef41Sopenharmony_ci    assert_true(e.data, "FileReader created during worker shutdown.");
231cb0ef41Sopenharmony_ci    t.done();
241cb0ef41Sopenharmony_ci  }
251cb0ef41Sopenharmony_ci}, 'FileReader created after a worker self.close()');
261cb0ef41Sopenharmony_ci
271cb0ef41Sopenharmony_ci</script>
28

Indexes created Thu Nov 07 10:32:03 CST 2024