Bug 1287169 - Fix intermittent failure in test_no_dnd.html, r=smaug
authorAndrea Marchesini <amarchesini@mozilla.com>
Sat, 16 Jul 2016 08:29:31 +0200
changeset 330259 6d6a147955f35e2838c0dd10ee98b5bafef15b1b
parent 330258 7fef388bc6cf208be8015f654bb0415118cda6b3
child 330260 515b58073c4619d3c08391beef75e479b5b896f3
push id9858
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 14:37:10 +0000
treeherdermozilla-aurora@203106ef6cb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1287169
milestone50.0a1
Bug 1287169 - Fix intermittent failure in test_no_dnd.html, r=smaug
dom/filesystem/compat/tests/test_no_dnd.html
--- a/dom/filesystem/compat/tests/test_no_dnd.html
+++ b/dom/filesystem/compat/tests/test_no_dnd.html
@@ -2,49 +2,50 @@
 <html>
 <head>
   <title>Test for Blink FileSystem API - no DND == no webkitEntries</title>
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 
 <body>
-<input id="entries" type="file"></input>
 <script type="application/javascript;version=1.7">
 
 var fileEntry;
 var directoryEntry;
 var script;
+var entries;
 
 function setup_tests() {
   SpecialPowers.pushPrefEnv({"set": [["dom.webkitBlink.dirPicker.enabled", true],
                                      ["dom.webkitBlink.filesystem.enabled", true]]}, next);
 }
 
 function populate_entries() {
+  entries = document.createElement('input');
+  entries.setAttribute('type', 'file');
+  document.body.appendChild(entries);
+
   var url = SimpleTest.getTestFileURL("script_entries.js");
   script = SpecialPowers.loadChromeScript(url);
 
   function onOpened(message) {
-    var entries = document.getElementById('entries');
-
     for (var i = 0 ; i < message.data.length; ++i) {
       if (message.data[i] instanceof File) {
         SpecialPowers.wrap(entries).mozSetFileArray([message.data[i]]);
         next();
       }
     }
   }
 
   script.addMessageListener("entries.opened", onOpened);
   script.sendAsyncMessage("entries.open");
 }
 
 function test_entries() {
-  var entries = document.getElementById('entries');
   ok("webkitEntries" in entries, "HTMLInputElement.webkitEntries");
   is(entries.webkitEntries.length, 0, "HTMLInputElement.webkitEntries.length == 0");
   is(entries.files.length, 1, "HTMLInputElement.files is still populated");
 
   next();
 }
 
 function cleanUpTestingFiles() {