Bug 1265610 - test_postMessages.html and some dom/filesystem tests requires 'dom.input.dirpicker' to be true, r=smaug
authorAndrea Marchesini <amarchesini@mozilla.com>
Wed, 20 Apr 2016 11:39:33 +0200
changeset 331888 182a164b91ecba718b49f260f241f6cf2d22cfd3
parent 331887 5743f4601d3f75ee3d77a5a0b4138821b1df7d8b
child 331889 1e5e34826bd992c37b8bdebbd2c598d2d0fd9629
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1265610
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1265610 - test_postMessages.html and some dom/filesystem tests requires 'dom.input.dirpicker' to be true, r=smaug
dom/base/test/test_postMessages.html
dom/filesystem/tests/filesystem_commons.js
dom/filesystem/tests/test_basic.html
dom/filesystem/tests/test_worker_basic.html
--- a/dom/base/test/test_postMessages.html
+++ b/dom/base/test/test_postMessages.html
@@ -5,16 +5,20 @@
   <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="fileList" type="file"></input>
 <script type="application/javascript;version=1.7">
 
+function setup_tests() {
+  SpecialPowers.pushPrefEnv({"set": [["dom.input.dirpicker", true]]}, next);
+}
+
 function getType(a) {
   if (a === null || a === undefined)
     return 'null';
 
   if (Array.isArray(a))
     return 'array';
 
   if (typeof a == 'object')
@@ -522,16 +526,18 @@ function test_messagePort_inWorkers() {
         onmessage = null;
         next();
       }
     });
   }
 }
 
 var tests = [
+  setup_tests,
+
   create_fileList,
   create_directory,
 
   test_windowToWindow,
   test_windowToIframe,
   test_windowToCrossOriginIframe,
 
   test_workers,
--- a/dom/filesystem/tests/filesystem_commons.js
+++ b/dom/filesystem/tests/filesystem_commons.js
@@ -1,8 +1,12 @@
+function setup_tests(aNext) {
+  SpecialPowers.pushPrefEnv({"set": [["dom.input.dirpicker", true]]}, aNext);
+}
+
 function test_basic(aDirectory, aNext) {
   ok(aDirectory, "Directory exists.");
   ok(aDirectory instanceof Directory, "We have a directory.");
   is(aDirectory.path, '/' + aDirectory.name, "directory.path must be '/'+name");
   aNext();
 }
 
 function test_getFilesAndDirectories(aDirectory, aRecursive, aNext) {
--- a/dom/filesystem/tests/test_basic.html
+++ b/dom/filesystem/tests/test_basic.html
@@ -31,16 +31,18 @@ function create_fileList(aPath) {
     });
   }
 
   script.addMessageListener("dir.opened", onOpened);
   script.sendAsyncMessage("dir.open", { path: aPath });
 }
 
 var tests = [
+  function() { setup_tests(next); }
+
   function() { create_fileList('ProfD') },
   function() { test_basic(directory, next); },
   function() { test_getFilesAndDirectories(directory, true, next); },
   function() { test_getFiles(directory, false, next); },
   function() { test_getFiles(directory, true, next); },
 
   function() { create_fileList('test') },
   function() { test_getFiles_recursiveComparison(directory, next); },
--- a/dom/filesystem/tests/test_worker_basic.html
+++ b/dom/filesystem/tests/test_worker_basic.html
@@ -1,13 +1,14 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>Test for Directory API in workers</title>
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="text/javascript" src="filesystem_commons.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 
 <body>
 <input id="fileList" type="file"></input>
 <script type="application/javascript;version=1.7">
 
 function create_fileList() {
@@ -40,16 +41,18 @@ function test_worker() {
       }
     }
 
     worker.postMessage(array[0]);
   });
 }
 
 var tests = [
+  function() { setup_tests(next); }
+
   create_fileList,
   test_worker,
 ];
 
 function next() {
   if (!tests.length) {
     SimpleTest.finish();
     return;