diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/FileAPI/idlharness-manual.html | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/tests/FileAPI/idlharness-manual.html')
-rw-r--r-- | testing/web-platform/tests/FileAPI/idlharness-manual.html | 167 |
1 files changed, 167 insertions, 0 deletions
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 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <title>File API manual IDL tests</title> + <link rel="author" title="Intel" href="http://www.intel.com"> + <link rel="help" href="http://dev.w3.org/2006/webapi/FileAPI/#conformance"> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/resources/WebIDLParser.js"></script> + <script src="/resources/idlharness.js"></script> + </head> + <body> + <h1>File API manual IDL tests</h1> + + <div> + <p>Test steps:</p> + <ol> + <li>Download <a href="support/upload.txt">upload.txt</a> to local.</li> + <li>Select the local upload.txt file to run the test.</li> + </ol> + </div> + + <form name="uploadData"> + <input type="file" id="fileChooser"> + </form> + + <div id="log"></div> + + <pre id="untested_idl" style="display: none"> + interface ArrayBuffer { + }; + + interface ArrayBufferView { + }; + + interface URL { + }; + + interface EventTarget { + }; + + interface Event { + }; + + [TreatNonCallableAsNull] + callback EventHandlerNonNull = any (Event event); + typedef EventHandlerNonNull? EventHandler; + </pre> + + <pre id="idl" style="display: none"> +[Constructor, + Constructor(sequence<(ArrayBuffer or ArrayBufferView or Blob or DOMString)> 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 = ""; +}; + +[Constructor(sequence<(Blob or DOMString or ArrayBufferView or ArrayBuffer)> fileBits, +[EnsureUTF16] DOMString fileName, optional FilePropertyBag options), Exposed=Window,Worker] +interface File : Blob { + + readonly attribute DOMString name; + readonly attribute long long lastModified; + +}; + +dictionary FilePropertyBag { + + DOMString type = ""; + 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 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 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 readAsText(Blob blob, optional DOMString label); + DOMString readAsDataURL(Blob blob); +}; + +partial interface URL { + + static DOMString createObjectURL(Blob blob); + static DOMString createFor(Blob blob); + static void revokeObjectURL(DOMString url); + +}; + </pre> + + <script> + var fileInput; + + setup(function() { + fileInput = document.querySelector("#fileChooser") + }, {explicit_done: true, explicit_timeout: true}); + + on_event(fileInput, "change", function(evt) { + var idl_array = new IdlArray(); + idl_array.add_untested_idls(document.getElementById("untested_idl").textContent); + idl_array.add_idls(document.getElementById("idl").textContent); + + idl_array.add_objects({ + FileList: [fileInput.files], + File: [fileInput.files[0]], + }); + idl_array.test(); + + done(); + }); + </script> + </body> +</html> |