From 5f8de423f190bbb79a62f804151bc24824fa32d8 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 2 Feb 2018 04:16:08 -0500 Subject: Add m-esr52 at 52.6.0 --- .../tests/FileAPI/BlobURL/support/file_test1.js | 1 + .../tests/FileAPI/BlobURL/support/file_test2.txt | 0 .../tests/FileAPI/BlobURL/support/file_test3.html | 25 ++ .../tests/FileAPI/BlobURL/test1-manual.html | 122 +++++ .../tests/FileAPI/BlobURL/test2-manual.html | 62 +++ .../tests/FileAPI/BlobURL/test3-manual.html | 71 +++ .../Progress_event_bubbles_cancelable.html | 33 ++ .../FileAPI/FileReader/support/file_test1.txt | 0 .../FileAPI/FileReader/test_errors-manual.html | 71 +++ .../tests/FileAPI/FileReaderSync.worker.js | 28 ++ testing/web-platform/tests/FileAPI/OWNERS | 6 + .../tests/FileAPI/blob/Blob-XHR-revoke.html | 28 ++ .../tests/FileAPI/blob/Blob-close.html | 39 ++ .../tests/FileAPI/blob/Blob-constructor.html | 495 +++++++++++++++++++++ .../tests/FileAPI/blob/Blob-in-worker.worker.js | 14 + .../tests/FileAPI/blob/Blob-slice-overflow.html | 42 ++ .../tests/FileAPI/blob/Blob-slice.html | 214 +++++++++ .../tests/FileAPI/file/File-constructor.html | 72 +++ .../file/Worker-read-file-constructor.worker.js | 15 + testing/web-platform/tests/FileAPI/fileReader.html | 67 +++ .../tests/FileAPI/filelist-section/filelist.html | 57 +++ .../filelist_multiple_selected_files-manual.html | 64 +++ .../filelist_selected_file-manual.html | 64 +++ .../FileAPI/filelist-section/support/upload.txt | 1 + .../FileAPI/filelist-section/support/upload.zip | Bin 0 -> 220 bytes testing/web-platform/tests/FileAPI/historical.html | 41 ++ .../tests/FileAPI/idlharness-manual.html | 167 +++++++ testing/web-platform/tests/FileAPI/idlharness.html | 60 +++ testing/web-platform/tests/FileAPI/idlharness.idl | 94 ++++ .../tests/FileAPI/idlharness.worker.js | 32 ++ .../tests/FileAPI/progress-manual.html | 49 ++ .../reading-data-section/Determining-Encoding.html | 91 ++++ .../FileReader-event-handler-attributes.html | 23 + .../FileReader-multiple-reads.html | 73 +++ .../reading-data-section/filereader_abort.html | 46 ++ .../reading-data-section/filereader_error.html | 35 ++ .../filereader_file-manual.html | 69 +++ .../filereader_file_img-manual.html | 47 ++ .../filereader_readAsArrayBuffer.html | 38 ++ .../filereader_readAsDataURL.html | 39 ++ .../filereader_readAsText.html | 51 +++ .../filereader_readystate.html | 34 ++ .../reading-data-section/filereader_result.html | 59 +++ .../reading-data-section/support/blue-100x100.png | Bin 0 -> 227 bytes testing/web-platform/tests/FileAPI/support/Blob.js | 49 ++ .../web-platform/tests/FileAPI/support/upload.txt | 1 + .../FileAPI/url/url_createobjecturl_blob.html | 26 ++ .../url/url_createobjecturl_file-manual.html | 51 +++ .../url/url_createobjecturl_file_img-manual.html | 28 ++ .../tests/FileAPI/url/url_xmlhttprequest.html | 29 ++ .../FileAPI/url/url_xmlhttprequest_img-ref.html | 12 + .../tests/FileAPI/url/url_xmlhttprequest_img.html | 28 ++ 52 files changed, 2863 insertions(+) create mode 100644 testing/web-platform/tests/FileAPI/BlobURL/support/file_test1.js create mode 100644 testing/web-platform/tests/FileAPI/BlobURL/support/file_test2.txt create mode 100644 testing/web-platform/tests/FileAPI/BlobURL/support/file_test3.html create mode 100644 testing/web-platform/tests/FileAPI/BlobURL/test1-manual.html create mode 100644 testing/web-platform/tests/FileAPI/BlobURL/test2-manual.html create mode 100644 testing/web-platform/tests/FileAPI/BlobURL/test3-manual.html create mode 100644 testing/web-platform/tests/FileAPI/FileReader/Progress_event_bubbles_cancelable.html create mode 100644 testing/web-platform/tests/FileAPI/FileReader/support/file_test1.txt create mode 100644 testing/web-platform/tests/FileAPI/FileReader/test_errors-manual.html create mode 100644 testing/web-platform/tests/FileAPI/FileReaderSync.worker.js create mode 100644 testing/web-platform/tests/FileAPI/OWNERS create mode 100644 testing/web-platform/tests/FileAPI/blob/Blob-XHR-revoke.html create mode 100644 testing/web-platform/tests/FileAPI/blob/Blob-close.html create mode 100644 testing/web-platform/tests/FileAPI/blob/Blob-constructor.html create mode 100644 testing/web-platform/tests/FileAPI/blob/Blob-in-worker.worker.js create mode 100644 testing/web-platform/tests/FileAPI/blob/Blob-slice-overflow.html create mode 100644 testing/web-platform/tests/FileAPI/blob/Blob-slice.html create mode 100644 testing/web-platform/tests/FileAPI/file/File-constructor.html create mode 100644 testing/web-platform/tests/FileAPI/file/Worker-read-file-constructor.worker.js create mode 100644 testing/web-platform/tests/FileAPI/fileReader.html create mode 100644 testing/web-platform/tests/FileAPI/filelist-section/filelist.html create mode 100644 testing/web-platform/tests/FileAPI/filelist-section/filelist_multiple_selected_files-manual.html create mode 100644 testing/web-platform/tests/FileAPI/filelist-section/filelist_selected_file-manual.html create mode 100644 testing/web-platform/tests/FileAPI/filelist-section/support/upload.txt create mode 100644 testing/web-platform/tests/FileAPI/filelist-section/support/upload.zip create mode 100644 testing/web-platform/tests/FileAPI/historical.html create mode 100644 testing/web-platform/tests/FileAPI/idlharness-manual.html create mode 100644 testing/web-platform/tests/FileAPI/idlharness.html create mode 100644 testing/web-platform/tests/FileAPI/idlharness.idl create mode 100644 testing/web-platform/tests/FileAPI/idlharness.worker.js create mode 100644 testing/web-platform/tests/FileAPI/progress-manual.html create mode 100644 testing/web-platform/tests/FileAPI/reading-data-section/Determining-Encoding.html create mode 100644 testing/web-platform/tests/FileAPI/reading-data-section/FileReader-event-handler-attributes.html create mode 100644 testing/web-platform/tests/FileAPI/reading-data-section/FileReader-multiple-reads.html create mode 100644 testing/web-platform/tests/FileAPI/reading-data-section/filereader_abort.html create mode 100644 testing/web-platform/tests/FileAPI/reading-data-section/filereader_error.html create mode 100644 testing/web-platform/tests/FileAPI/reading-data-section/filereader_file-manual.html create mode 100644 testing/web-platform/tests/FileAPI/reading-data-section/filereader_file_img-manual.html create mode 100644 testing/web-platform/tests/FileAPI/reading-data-section/filereader_readAsArrayBuffer.html create mode 100644 testing/web-platform/tests/FileAPI/reading-data-section/filereader_readAsDataURL.html create mode 100644 testing/web-platform/tests/FileAPI/reading-data-section/filereader_readAsText.html create mode 100644 testing/web-platform/tests/FileAPI/reading-data-section/filereader_readystate.html create mode 100644 testing/web-platform/tests/FileAPI/reading-data-section/filereader_result.html create mode 100644 testing/web-platform/tests/FileAPI/reading-data-section/support/blue-100x100.png create mode 100644 testing/web-platform/tests/FileAPI/support/Blob.js create mode 100644 testing/web-platform/tests/FileAPI/support/upload.txt create mode 100644 testing/web-platform/tests/FileAPI/url/url_createobjecturl_blob.html create mode 100644 testing/web-platform/tests/FileAPI/url/url_createobjecturl_file-manual.html create mode 100644 testing/web-platform/tests/FileAPI/url/url_createobjecturl_file_img-manual.html create mode 100644 testing/web-platform/tests/FileAPI/url/url_xmlhttprequest.html create mode 100644 testing/web-platform/tests/FileAPI/url/url_xmlhttprequest_img-ref.html create mode 100644 testing/web-platform/tests/FileAPI/url/url_xmlhttprequest_img.html (limited to 'testing/web-platform/tests/FileAPI') diff --git a/testing/web-platform/tests/FileAPI/BlobURL/support/file_test1.js b/testing/web-platform/tests/FileAPI/BlobURL/support/file_test1.js new file mode 100644 index 000000000..349835849 --- /dev/null +++ b/testing/web-platform/tests/FileAPI/BlobURL/support/file_test1.js @@ -0,0 +1 @@ +var test_result = 'test1_OK'; \ No newline at end of file diff --git a/testing/web-platform/tests/FileAPI/BlobURL/support/file_test2.txt b/testing/web-platform/tests/FileAPI/BlobURL/support/file_test2.txt new file mode 100644 index 000000000..e69de29bb diff --git a/testing/web-platform/tests/FileAPI/BlobURL/support/file_test3.html b/testing/web-platform/tests/FileAPI/BlobURL/support/file_test3.html new file mode 100644 index 000000000..fa234cb9f --- /dev/null +++ b/testing/web-platform/tests/FileAPI/BlobURL/support/file_test3.html @@ -0,0 +1,25 @@ + + + + + Test file + + + + + +
+ + +
+ + diff --git a/testing/web-platform/tests/FileAPI/BlobURL/test1-manual.html b/testing/web-platform/tests/FileAPI/BlobURL/test1-manual.html new file mode 100644 index 000000000..8da42cf64 --- /dev/null +++ b/testing/web-platform/tests/FileAPI/BlobURL/test1-manual.html @@ -0,0 +1,122 @@ + + + + + Blob and File reference URL Test(1) + + + + + + +
+ +
+ +
+

Test steps:

+
    +
  1. Download the file.
  2. +
  3. Select the file in the file inputbox to run the test.
  4. +
+
+ +
+ + + + diff --git a/testing/web-platform/tests/FileAPI/BlobURL/test2-manual.html b/testing/web-platform/tests/FileAPI/BlobURL/test2-manual.html new file mode 100644 index 000000000..07fb27ef8 --- /dev/null +++ b/testing/web-platform/tests/FileAPI/BlobURL/test2-manual.html @@ -0,0 +1,62 @@ + + + + + Blob and File reference URL Test(2) + + + + + + +
+
+
+ +
+

Test steps:

+
    +
  1. Download the file.
  2. +
  3. Select the file in the file inputbox.
  4. +
  5. Delete the file.
  6. +
  7. Click the 'start' button.
  8. +
+
+ +
+ + + + diff --git a/testing/web-platform/tests/FileAPI/BlobURL/test3-manual.html b/testing/web-platform/tests/FileAPI/BlobURL/test3-manual.html new file mode 100644 index 000000000..ce020a7b7 --- /dev/null +++ b/testing/web-platform/tests/FileAPI/BlobURL/test3-manual.html @@ -0,0 +1,71 @@ + + + + + Blob and File reference URL Test(3) + + + + + + +
+ +
+ +
+

Test steps:

+
    +
  1. Download the file.
  2. +
  3. Select the file in the file inputbox and the test will start.
  4. +
+
+ +
+ + + + diff --git a/testing/web-platform/tests/FileAPI/FileReader/Progress_event_bubbles_cancelable.html b/testing/web-platform/tests/FileAPI/FileReader/Progress_event_bubbles_cancelable.html new file mode 100644 index 000000000..6a03243f9 --- /dev/null +++ b/testing/web-platform/tests/FileAPI/FileReader/Progress_event_bubbles_cancelable.html @@ -0,0 +1,33 @@ + + +File API Test: Progress Event - bubbles, cancelable + + + + +
+ + diff --git a/testing/web-platform/tests/FileAPI/FileReader/support/file_test1.txt b/testing/web-platform/tests/FileAPI/FileReader/support/file_test1.txt new file mode 100644 index 000000000..e69de29bb diff --git a/testing/web-platform/tests/FileAPI/FileReader/test_errors-manual.html b/testing/web-platform/tests/FileAPI/FileReader/test_errors-manual.html new file mode 100644 index 000000000..e0a612001 --- /dev/null +++ b/testing/web-platform/tests/FileAPI/FileReader/test_errors-manual.html @@ -0,0 +1,71 @@ + + + + + FileReader Errors Test + + + + + + +
+
+
+ +
+

Test steps:

+
    +
  1. Download the file.
  2. +
  3. Select the file in the file inputbox.
  4. +
  5. Delete the file.
  6. +
  7. Click the 'start' button.
  8. +
+
+ +
+ + + + \ No newline at end of file diff --git a/testing/web-platform/tests/FileAPI/FileReaderSync.worker.js b/testing/web-platform/tests/FileAPI/FileReaderSync.worker.js new file mode 100644 index 000000000..77af6a7a6 --- /dev/null +++ b/testing/web-platform/tests/FileAPI/FileReaderSync.worker.js @@ -0,0 +1,28 @@ +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(); diff --git a/testing/web-platform/tests/FileAPI/OWNERS b/testing/web-platform/tests/FileAPI/OWNERS new file mode 100644 index 000000000..03bb93365 --- /dev/null +++ b/testing/web-platform/tests/FileAPI/OWNERS @@ -0,0 +1,6 @@ +@inexorabletash +@plehegar +@zqzhang +@zcorpan +@jdm +@Ms2ger diff --git a/testing/web-platform/tests/FileAPI/blob/Blob-XHR-revoke.html b/testing/web-platform/tests/FileAPI/blob/Blob-XHR-revoke.html new file mode 100644 index 000000000..fea313eee --- /dev/null +++ b/testing/web-platform/tests/FileAPI/blob/Blob-XHR-revoke.html @@ -0,0 +1,28 @@ + +Revoking blob URL used with XMLHttpRequest + + + + \ No newline at end of file diff --git a/testing/web-platform/tests/FileAPI/blob/Blob-close.html b/testing/web-platform/tests/FileAPI/blob/Blob-close.html new file mode 100644 index 000000000..45df1e211 --- /dev/null +++ b/testing/web-platform/tests/FileAPI/blob/Blob-close.html @@ -0,0 +1,39 @@ + + +Blob.close + + + + +
+ diff --git a/testing/web-platform/tests/FileAPI/blob/Blob-constructor.html b/testing/web-platform/tests/FileAPI/blob/Blob-constructor.html new file mode 100644 index 000000000..d8375c2a6 --- /dev/null +++ b/testing/web-platform/tests/FileAPI/blob/Blob-constructor.html @@ -0,0 +1,495 @@ + + +Blob constructor + + + + + + + +
+ diff --git a/testing/web-platform/tests/FileAPI/blob/Blob-in-worker.worker.js b/testing/web-platform/tests/FileAPI/blob/Blob-in-worker.worker.js new file mode 100644 index 000000000..a67060e7b --- /dev/null +++ b/testing/web-platform/tests/FileAPI/blob/Blob-in-worker.worker.js @@ -0,0 +1,14 @@ +importScripts("/resources/testharness.js"); + +async_test(function() { + var data = "TEST"; + var blob = new Blob([data], {type: "text/plain"}); + var reader = new FileReader(); + reader.onload = this.step_func_done(function() { + assert_equals(reader.result, data); + }); + reader.onerror = this.unreached_func("Unexpected error event"); + reader.readAsText(blob); +}, "Create Blob in Worker"); + +done(); diff --git a/testing/web-platform/tests/FileAPI/blob/Blob-slice-overflow.html b/testing/web-platform/tests/FileAPI/blob/Blob-slice-overflow.html new file mode 100644 index 000000000..56891af5f --- /dev/null +++ b/testing/web-platform/tests/FileAPI/blob/Blob-slice-overflow.html @@ -0,0 +1,42 @@ + + +Blob slice overflow + + + + +
+ + diff --git a/testing/web-platform/tests/FileAPI/blob/Blob-slice.html b/testing/web-platform/tests/FileAPI/blob/Blob-slice.html new file mode 100644 index 000000000..0ecea79c8 --- /dev/null +++ b/testing/web-platform/tests/FileAPI/blob/Blob-slice.html @@ -0,0 +1,214 @@ + + +Blob slice + + + + + +
+ diff --git a/testing/web-platform/tests/FileAPI/file/File-constructor.html b/testing/web-platform/tests/FileAPI/file/File-constructor.html new file mode 100644 index 000000000..97c08b654 --- /dev/null +++ b/testing/web-platform/tests/FileAPI/file/File-constructor.html @@ -0,0 +1,72 @@ + + +File constructor + + + +
+ diff --git a/testing/web-platform/tests/FileAPI/file/Worker-read-file-constructor.worker.js b/testing/web-platform/tests/FileAPI/file/Worker-read-file-constructor.worker.js new file mode 100644 index 000000000..4e003b3c9 --- /dev/null +++ b/testing/web-platform/tests/FileAPI/file/Worker-read-file-constructor.worker.js @@ -0,0 +1,15 @@ +importScripts("/resources/testharness.js"); + +async_test(function() { + var file = new File(["bits"], "dummy", { 'type': 'text/plain', lastModified: 42 }); + var reader = new FileReader(); + reader.onload = this.step_func_done(function() { + assert_equals(file.name, "dummy", "file name"); + assert_equals(reader.result, "bits", "file content"); + assert_equals(file.lastModified, 42, "file lastModified"); + }); + reader.onerror = this.unreached_func("Unexpected error event"); + reader.readAsText(file); +}, "FileReader in Worker"); + +done(); diff --git a/testing/web-platform/tests/FileAPI/fileReader.html b/testing/web-platform/tests/FileAPI/fileReader.html new file mode 100644 index 000000000..b767e22d4 --- /dev/null +++ b/testing/web-platform/tests/FileAPI/fileReader.html @@ -0,0 +1,67 @@ + + + + FileReader States + + + + + + +
+ + + diff --git a/testing/web-platform/tests/FileAPI/filelist-section/filelist.html b/testing/web-platform/tests/FileAPI/filelist-section/filelist.html new file mode 100644 index 000000000..b97dcde19 --- /dev/null +++ b/testing/web-platform/tests/FileAPI/filelist-section/filelist.html @@ -0,0 +1,57 @@ + + + + + FileAPI Test: filelist + + + + + + + + + +
+ +
+
+ + + + + diff --git a/testing/web-platform/tests/FileAPI/filelist-section/filelist_multiple_selected_files-manual.html b/testing/web-platform/tests/FileAPI/filelist-section/filelist_multiple_selected_files-manual.html new file mode 100644 index 000000000..2efaa059f --- /dev/null +++ b/testing/web-platform/tests/FileAPI/filelist-section/filelist_multiple_selected_files-manual.html @@ -0,0 +1,64 @@ + + + + + FileAPI Test: filelist_multiple_selected_files + + + + + + + + + +
+ +
+
+

Test steps:

+
    +
  1. Download upload.txt, upload.zip to local.
  2. +
  3. Select the local two files (upload.txt, upload.zip) to run the test.
  4. +
+
+ +
+ + + + diff --git a/testing/web-platform/tests/FileAPI/filelist-section/filelist_selected_file-manual.html b/testing/web-platform/tests/FileAPI/filelist-section/filelist_selected_file-manual.html new file mode 100644 index 000000000..966aadda6 --- /dev/null +++ b/testing/web-platform/tests/FileAPI/filelist-section/filelist_selected_file-manual.html @@ -0,0 +1,64 @@ + + + + + FileAPI Test: filelist_selected_file + + + + + + + + + +
+ +
+
+

Test steps:

+
    +
  1. Download upload.txt to local.
  2. +
  3. Select the local upload.txt file to run the test.
  4. +
+
+ +
+ + + + diff --git a/testing/web-platform/tests/FileAPI/filelist-section/support/upload.txt b/testing/web-platform/tests/FileAPI/filelist-section/support/upload.txt new file mode 100644 index 000000000..f45965b71 --- /dev/null +++ b/testing/web-platform/tests/FileAPI/filelist-section/support/upload.txt @@ -0,0 +1 @@ +Hello, this is test file for file upload. diff --git a/testing/web-platform/tests/FileAPI/filelist-section/support/upload.zip b/testing/web-platform/tests/FileAPI/filelist-section/support/upload.zip new file mode 100644 index 000000000..a933d6a94 Binary files /dev/null and b/testing/web-platform/tests/FileAPI/filelist-section/support/upload.zip differ diff --git a/testing/web-platform/tests/FileAPI/historical.html b/testing/web-platform/tests/FileAPI/historical.html new file mode 100644 index 000000000..a9ae674d4 --- /dev/null +++ b/testing/web-platform/tests/FileAPI/historical.html @@ -0,0 +1,41 @@ + + + + + Historical features + + + + +
+ + + diff --git a/testing/web-platform/tests/FileAPI/idlharness-manual.html b/testing/web-platform/tests/FileAPI/idlharness-manual.html new file mode 100644 index 000000000..8fb0dfb78 --- /dev/null +++ b/testing/web-platform/tests/FileAPI/idlharness-manual.html @@ -0,0 +1,167 @@ + + + + + File API manual IDL tests + + + + + + + + +

File API manual IDL tests

+ +
+

Test steps:

+
    +
  1. Download upload.txt to local.
  2. +
  3. Select the local upload.txt file to run the test.
  4. +
+
+ +
+ +
+ +
+ + + + + + + + diff --git a/testing/web-platform/tests/FileAPI/idlharness.html b/testing/web-platform/tests/FileAPI/idlharness.html new file mode 100644 index 000000000..0ef37000d --- /dev/null +++ b/testing/web-platform/tests/FileAPI/idlharness.html @@ -0,0 +1,60 @@ + + + + + File API automated IDL tests + + + + + + + + +

File API automated IDL tests

+ +
+ +
+ +
+ + + + + diff --git a/testing/web-platform/tests/FileAPI/idlharness.idl b/testing/web-platform/tests/FileAPI/idlharness.idl new file mode 100644 index 000000000..d8f31b43a --- /dev/null +++ b/testing/web-platform/tests/FileAPI/idlharness.idl @@ -0,0 +1,94 @@ +// https://w3c.github.io/FileAPI/#idl-index + +[Constructor(optional sequence blobParts, optional BlobPropertyBag options), +Exposed=(Window,Worker)] +interface Blob { + + readonly attribute unsigned long long size; + readonly attribute DOMString type; + readonly attribute boolean isClosed; + + //slice Blob into byte-ranged chunks + + Blob slice([Clamp] optional long long start, + [Clamp] optional long long end, + optional DOMString contentType); + void close(); + +}; + +dictionary BlobPropertyBag { + DOMString type = ""; +}; + +typedef (BufferSource or Blob or USVString) BlobPart; + +[Constructor(sequence fileBits, + [EnsureUTF16] DOMString fileName, + optional FilePropertyBag options), +Exposed=(Window,Worker)] +interface File : Blob { + readonly attribute DOMString name; + readonly attribute long long lastModified; +}; + +dictionary FilePropertyBag : BlobPropertyBag { + long long lastModified; +}; + +[Exposed=(Window,Worker)] +interface FileList { + getter File? item(unsigned long index); + readonly attribute unsigned long length; +}; + +[Constructor, Exposed=(Window,Worker)] +interface FileReader: EventTarget { + + // async read methods + void readAsArrayBuffer(Blob blob); + void readAsBinaryString(Blob blob); + void readAsText(Blob blob, optional DOMString label); + void readAsDataURL(Blob blob); + + void abort(); + + // states + const unsigned short EMPTY = 0; + const unsigned short LOADING = 1; + const unsigned short DONE = 2; + + + readonly attribute unsigned short readyState; + + // File or Blob data + readonly attribute (DOMString or ArrayBuffer)? result; + + readonly attribute DOMError? error; + + // event handler content attributes + attribute EventHandler onloadstart; + attribute EventHandler onprogress; + attribute EventHandler onload; + attribute EventHandler onabort; + attribute EventHandler onerror; + attribute EventHandler onloadend; + +}; + +[Constructor, Exposed=Worker] +interface FileReaderSync { + // Synchronously return strings + + ArrayBuffer readAsArrayBuffer(Blob blob); + DOMString readAsBinaryString(Blob blob); + DOMString readAsText(Blob blob, optional DOMString label); + DOMString readAsDataURL(Blob blob); +}; + +[Exposed=(Window,DedicatedWorker,SharedWorker)] +partial interface URL { + static DOMString createObjectURL(Blob blob); + static DOMString createFor(Blob blob); + static void revokeObjectURL(DOMString url); +}; diff --git a/testing/web-platform/tests/FileAPI/idlharness.worker.js b/testing/web-platform/tests/FileAPI/idlharness.worker.js new file mode 100644 index 000000000..3243e3404 --- /dev/null +++ b/testing/web-platform/tests/FileAPI/idlharness.worker.js @@ -0,0 +1,32 @@ +importScripts("/resources/testharness.js"); +importScripts("/resources/WebIDLParser.js", "/resources/idlharness.js"); + +var request = new XMLHttpRequest(); +request.open("GET", "idlharness.idl"); +request.send(); +request.onload = function() { + var idl_array = new IdlArray(); + var idls = request.responseText; + + idl_array.add_untested_idls("[Global] interface Window { };"); + + idl_array.add_untested_idls("interface ArrayBuffer {};"); + idl_array.add_untested_idls("interface ArrayBufferView {};"); + idl_array.add_untested_idls("interface URL {};"); + idl_array.add_untested_idls("interface EventTarget {};"); + idl_array.add_untested_idls("interface Event {};"); + idl_array.add_untested_idls("[TreatNonCallableAsNull] callback EventHandlerNonNull = any (Event event);"); + idl_array.add_untested_idls("typedef EventHandlerNonNull? EventHandler;"); + + idl_array.add_idls(idls); + + idl_array.add_objects({ + Blob: ['new Blob(["TEST"])'], + File: ['new File(["myFileBits"], "myFileName")'], + FileReader: ['new FileReader()'], + FileReaderSync: ['new FileReaderSync()'] + }); + + idl_array.test(); + done(); +}; diff --git a/testing/web-platform/tests/FileAPI/progress-manual.html b/testing/web-platform/tests/FileAPI/progress-manual.html new file mode 100644 index 000000000..b2e03b3eb --- /dev/null +++ b/testing/web-platform/tests/FileAPI/progress-manual.html @@ -0,0 +1,49 @@ + + +Process Events for FileReader + + + + +Please choose one file through this input below.
+ +
+ diff --git a/testing/web-platform/tests/FileAPI/reading-data-section/Determining-Encoding.html b/testing/web-platform/tests/FileAPI/reading-data-section/Determining-Encoding.html new file mode 100644 index 000000000..d65ae9db1 --- /dev/null +++ b/testing/web-platform/tests/FileAPI/reading-data-section/Determining-Encoding.html @@ -0,0 +1,91 @@ + + +FileAPI Test: Blob Determining Encoding + + + + + +
+ diff --git a/testing/web-platform/tests/FileAPI/reading-data-section/FileReader-event-handler-attributes.html b/testing/web-platform/tests/FileAPI/reading-data-section/FileReader-event-handler-attributes.html new file mode 100644 index 000000000..86657b571 --- /dev/null +++ b/testing/web-platform/tests/FileAPI/reading-data-section/FileReader-event-handler-attributes.html @@ -0,0 +1,23 @@ + + +FileReader event handler attributes + + +
+ diff --git a/testing/web-platform/tests/FileAPI/reading-data-section/FileReader-multiple-reads.html b/testing/web-platform/tests/FileAPI/reading-data-section/FileReader-multiple-reads.html new file mode 100644 index 000000000..86a29d187 --- /dev/null +++ b/testing/web-platform/tests/FileAPI/reading-data-section/FileReader-multiple-reads.html @@ -0,0 +1,73 @@ +๏ปฟ +FileReader: starting new reads while one is in progress + + + + +
+ diff --git a/testing/web-platform/tests/FileAPI/reading-data-section/filereader_abort.html b/testing/web-platform/tests/FileAPI/reading-data-section/filereader_abort.html new file mode 100644 index 000000000..a96389c21 --- /dev/null +++ b/testing/web-platform/tests/FileAPI/reading-data-section/filereader_abort.html @@ -0,0 +1,46 @@ + + + + + FileAPI Test: filereader_abort + + + + + + +
+ + + + diff --git a/testing/web-platform/tests/FileAPI/reading-data-section/filereader_error.html b/testing/web-platform/tests/FileAPI/reading-data-section/filereader_error.html new file mode 100644 index 000000000..cf4524825 --- /dev/null +++ b/testing/web-platform/tests/FileAPI/reading-data-section/filereader_error.html @@ -0,0 +1,35 @@ + + + + + FileAPI Test: filereader_error + + + + + + + +
+ + + + diff --git a/testing/web-platform/tests/FileAPI/reading-data-section/filereader_file-manual.html b/testing/web-platform/tests/FileAPI/reading-data-section/filereader_file-manual.html new file mode 100644 index 000000000..702ca9afd --- /dev/null +++ b/testing/web-platform/tests/FileAPI/reading-data-section/filereader_file-manual.html @@ -0,0 +1,69 @@ + + + + + FileAPI Test: filereader_file + + + + + + + +
+

Test step:

+
    +
  1. Download blue-100x100.png to local.
  2. +
  3. Select the local file (blue-100x100.png) to run the test.
  4. +
+
+ +
+ +
+ +
+ + + diff --git a/testing/web-platform/tests/FileAPI/reading-data-section/filereader_file_img-manual.html b/testing/web-platform/tests/FileAPI/reading-data-section/filereader_file_img-manual.html new file mode 100644 index 000000000..fca42c7fc --- /dev/null +++ b/testing/web-platform/tests/FileAPI/reading-data-section/filereader_file_img-manual.html @@ -0,0 +1,47 @@ + + + + + FileAPI Test: filereader_file_img + + + + + + + +
+

Test step:

+
    +
  1. Download blue-100x100.png to local.
  2. +
  3. Select the local file (blue-100x100.png) to run the test.
  4. +
+
+ +
+ +
+ +
+ + + diff --git a/testing/web-platform/tests/FileAPI/reading-data-section/filereader_readAsArrayBuffer.html b/testing/web-platform/tests/FileAPI/reading-data-section/filereader_readAsArrayBuffer.html new file mode 100644 index 000000000..31001a51a --- /dev/null +++ b/testing/web-platform/tests/FileAPI/reading-data-section/filereader_readAsArrayBuffer.html @@ -0,0 +1,38 @@ + + + + + FileAPI Test: filereader_readAsArrayBuffer + + + + + + +
+ + + + diff --git a/testing/web-platform/tests/FileAPI/reading-data-section/filereader_readAsDataURL.html b/testing/web-platform/tests/FileAPI/reading-data-section/filereader_readAsDataURL.html new file mode 100644 index 000000000..f0a3957e7 --- /dev/null +++ b/testing/web-platform/tests/FileAPI/reading-data-section/filereader_readAsDataURL.html @@ -0,0 +1,39 @@ + + + + + FileAPI Test: filereader_readAsDataURL + + + + + + +
+ + + + diff --git a/testing/web-platform/tests/FileAPI/reading-data-section/filereader_readAsText.html b/testing/web-platform/tests/FileAPI/reading-data-section/filereader_readAsText.html new file mode 100644 index 000000000..7d639d011 --- /dev/null +++ b/testing/web-platform/tests/FileAPI/reading-data-section/filereader_readAsText.html @@ -0,0 +1,51 @@ + + + + + FileAPI Test: filereader_readAsText + + + + + + +
+ + + + diff --git a/testing/web-platform/tests/FileAPI/reading-data-section/filereader_readystate.html b/testing/web-platform/tests/FileAPI/reading-data-section/filereader_readystate.html new file mode 100644 index 000000000..1586b8995 --- /dev/null +++ b/testing/web-platform/tests/FileAPI/reading-data-section/filereader_readystate.html @@ -0,0 +1,34 @@ + + + + + FileAPI Test: filereader_readystate + + + + + + +
+ + + + diff --git a/testing/web-platform/tests/FileAPI/reading-data-section/filereader_result.html b/testing/web-platform/tests/FileAPI/reading-data-section/filereader_result.html new file mode 100644 index 000000000..957d0337a --- /dev/null +++ b/testing/web-platform/tests/FileAPI/reading-data-section/filereader_result.html @@ -0,0 +1,59 @@ + + + + + FileAPI Test: filereader_result + + + + + + +
+ + + + diff --git a/testing/web-platform/tests/FileAPI/reading-data-section/support/blue-100x100.png b/testing/web-platform/tests/FileAPI/reading-data-section/support/blue-100x100.png new file mode 100644 index 000000000..5748719ff Binary files /dev/null and b/testing/web-platform/tests/FileAPI/reading-data-section/support/blue-100x100.png differ diff --git a/testing/web-platform/tests/FileAPI/support/Blob.js b/testing/web-platform/tests/FileAPI/support/Blob.js new file mode 100644 index 000000000..1d66f23a6 --- /dev/null +++ b/testing/web-platform/tests/FileAPI/support/Blob.js @@ -0,0 +1,49 @@ +function test_blob(fn, expectations) { + var expected = expectations.expected, + type = expectations.type, + desc = expectations.desc; + + var t = async_test(desc); + t.step(function() { + var blob = fn(); + assert_true(blob instanceof Blob); + assert_false(blob instanceof File); + assert_equals(blob.type, type); + assert_equals(blob.size, expected.length); + + var fr = new FileReader(); + fr.onload = t.step_func_done(function(event) { + assert_equals(this.result, expected); + }, fr); + fr.onerror = t.step_func(function(e) { + assert_unreached("got error event on FileReader"); + }); + fr.readAsText(blob, "UTF-8"); + }); +} + +function test_blob_binary(fn, expectations) { + var expected = expectations.expected, + type = expectations.type, + desc = expectations.desc; + + var t = async_test(desc); + t.step(function() { + var blob = fn(); + assert_true(blob instanceof Blob); + assert_false(blob instanceof File); + assert_equals(blob.type, type); + assert_equals(blob.size, expected.length); + + var fr = new FileReader(); + fr.onload = t.step_func_done(function(event) { + assert_true(this.result instanceof ArrayBuffer, + "Result should be an ArrayBuffer"); + assert_array_equals(new Uint8Array(this.result), expected); + }, fr); + fr.onerror = t.step_func(function(e) { + assert_unreached("got error event on FileReader"); + }); + fr.readAsArrayBuffer(blob); + }); +} diff --git a/testing/web-platform/tests/FileAPI/support/upload.txt b/testing/web-platform/tests/FileAPI/support/upload.txt new file mode 100644 index 000000000..5ab2f8a43 --- /dev/null +++ b/testing/web-platform/tests/FileAPI/support/upload.txt @@ -0,0 +1 @@ +Hello \ No newline at end of file diff --git a/testing/web-platform/tests/FileAPI/url/url_createobjecturl_blob.html b/testing/web-platform/tests/FileAPI/url/url_createobjecturl_blob.html new file mode 100644 index 000000000..db6b44180 --- /dev/null +++ b/testing/web-platform/tests/FileAPI/url/url_createobjecturl_blob.html @@ -0,0 +1,26 @@ + + +FileAPI Test: Creating Blob URL with Blob + + + + + +
+ + + diff --git a/testing/web-platform/tests/FileAPI/url/url_createobjecturl_file-manual.html b/testing/web-platform/tests/FileAPI/url/url_createobjecturl_file-manual.html new file mode 100644 index 000000000..5dcd1d49e --- /dev/null +++ b/testing/web-platform/tests/FileAPI/url/url_createobjecturl_file-manual.html @@ -0,0 +1,51 @@ + + +FileAPI Test: Creating Blob URL with File + + + + + + +
+

Test steps:

+
    +
  1. Download blue96x96.png to local.
  2. +
  3. Select the local file (blue96x96.png) to run the test.
  4. +
+
+ +
+ +
+ +
+ + + diff --git a/testing/web-platform/tests/FileAPI/url/url_createobjecturl_file_img-manual.html b/testing/web-platform/tests/FileAPI/url/url_createobjecturl_file_img-manual.html new file mode 100644 index 000000000..534c1de99 --- /dev/null +++ b/testing/web-platform/tests/FileAPI/url/url_createobjecturl_file_img-manual.html @@ -0,0 +1,28 @@ + + +FileAPI Test: Creating Blob URL with File as image source + + + +
+

Test steps:

+
    +
  1. Download blue96x96.png to local.
  2. +
  3. Select the local file (blue96x96.png) to run the test.
  4. +
+

Pass/fail criteria:

+

Test passes if there is a filled blue square.

+ +

+

+
+ + + diff --git a/testing/web-platform/tests/FileAPI/url/url_xmlhttprequest.html b/testing/web-platform/tests/FileAPI/url/url_xmlhttprequest.html new file mode 100644 index 000000000..7a86cdd1e --- /dev/null +++ b/testing/web-platform/tests/FileAPI/url/url_xmlhttprequest.html @@ -0,0 +1,29 @@ + + +FileAPI Test: Creating Blob URL via XMLHttpRequest + + + + + +
+ + + diff --git a/testing/web-platform/tests/FileAPI/url/url_xmlhttprequest_img-ref.html b/testing/web-platform/tests/FileAPI/url/url_xmlhttprequest_img-ref.html new file mode 100644 index 000000000..7d7390442 --- /dev/null +++ b/testing/web-platform/tests/FileAPI/url/url_xmlhttprequest_img-ref.html @@ -0,0 +1,12 @@ + + +FileAPI Reference File + + + +

Test passes if there is a filled blue square.

+ +

+ +

+ diff --git a/testing/web-platform/tests/FileAPI/url/url_xmlhttprequest_img.html b/testing/web-platform/tests/FileAPI/url/url_xmlhttprequest_img.html new file mode 100644 index 000000000..7f26633d8 --- /dev/null +++ b/testing/web-platform/tests/FileAPI/url/url_xmlhttprequest_img.html @@ -0,0 +1,28 @@ + + + +FileAPI Test: Creating Blob URL via XMLHttpRequest as image source + + + + +

Test passes if there is a filled blue square.

+ +

+ +

+ + + + + -- cgit v1.2.3