Bug 1892041 - Part 1: Update test262 features. r=spidermonkey-reviewers,dminor
[gecko.git] / dom / filesystem / tests / test_bug1319088.html
blob98e0ad46f0e48ad430b8d1915a79b4eb94859f96
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>Test for bug 1319088</title>
5 <script src="/tests/SimpleTest/SimpleTest.js"></script>
6 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
7 </head>
9 <body>
10 <input id="input" type="file"></input>
12 <script type="application/javascript">
14 function testSetup() {
15 SpecialPowers.pushPrefEnv({"set": [["dom.webkitBlink.dirPicker.enabled", true]]}, next);
18 function populateInputFile() {
19 var url = SimpleTest.getTestFileURL("script_fileList.js");
20 var script = SpecialPowers.loadChromeScript(url);
22 function onOpened(message) {
23 var input = document.getElementById("input");
24 SpecialPowers.wrap(input).mozSetFileArray([message.file]);
26 script.destroy();
27 next();
30 script.addMessageListener("file.opened", onOpened);
31 script.sendAsyncMessage("file.open");
34 function checkBug() {
35 var input = document.getElementById("input");
36 is(input.files[0].webkitRelativePath, "", "No relative path!");
38 let form = document.createElement("form");
39 form.appendChild(input);
41 is(input.files[0].webkitRelativePath, "", "No relative path!");
42 SimpleTest.finish();
45 var tests = [
46 testSetup,
47 populateInputFile,
48 checkBug,
51 function next() {
52 if (!tests.length) {
53 SimpleTest.finish();
54 return;
57 var test = tests.shift();
58 test();
61 SimpleTest.waitForExplicitFinish();
62 next();
63 </script>
64 </body>
65 </html>