https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 64da316928b38f3dbd2231dbfb0f7f776170a106 authored by Brad Werth on 11 April 2018, 09:35:18 UTC
Part 9: Fix wpt reftest shape-image-025.html to make every frame of the animated GIF use a green box in the lower-left quadrant.
Tip revision: 64da316
FileReaderSync.worker.js
importScripts("/resources/testharness.js");

var blob, readerSync;
setup(function() {
  readerSync = new FileReaderSync();
  blob = new Blob(["test"]);
});

test(function() {
  assert_true(readerSync instanceof FileReaderSync);
}, "Interface");

test(function() {
  var text = readerSync.readAsText(blob);
  assert_equals(text, "test");
}, "readAsText");

test(function() {
  var data = readerSync.readAsDataURL(blob);
  assert_equals(data.indexOf("data:"), 0);
}, "readAsDataURL");

test(function() {
  var data = readerSync.readAsArrayBuffer(blob);
  assert_true(data instanceof ArrayBuffer);
}, "readAsArrayBuffer");

done();
back to top