Bug 890098 - Cannot run dom/plugins xpcshell tests concurrently. r=bsmedberg
authorMihnea Dobrescu-Balaur <mihneadb@gmail.com>
Thu, 18 Jul 2013 18:01:25 -0700
changeset 139272 79c68a7730803e83326138fc4c264a28d5b9a26f
parent 139271 7900b47971c79d954bd8eef2be573604e290bf79
child 139273 1c2d60525241341d015c7bad63268b2e00686141
push id24983
push userryanvm@gmail.com
push dateSat, 20 Jul 2013 00:51:06 +0000
treeherdermozilla-central@6030c759a502 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs890098
milestone25.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 890098 - Cannot run dom/plugins xpcshell tests concurrently. r=bsmedberg
dom/plugins/test/unit/test_nice_plugin_name.js
dom/plugins/test/unit/test_persist_in_prefs.js
--- a/dom/plugins/test/unit/test_nice_plugin_name.js
+++ b/dom/plugins/test/unit/test_nice_plugin_name.js
@@ -84,17 +84,18 @@ function run_test() {
   test_expected_permission_string(expectedDefaultPermissionString);
 
   let suffix = get_platform_specific_plugin_suffix();
   let pluginFile = get_test_plugin_no_symlink();
   let pluginDir = pluginFile.parent;
   pluginFile.copyTo(null, "npblah235" + suffix);
   let pluginCopy = pluginDir.clone();
   pluginCopy.append("npblah235" + suffix);
-  pluginFile.moveTo(pluginDir.parent, null);
+  let tempDir = do_get_tempdir();
+  pluginFile.moveTo(tempDir, null);
   test_expected_permission_string("plugin:npblah");
 
   pluginCopy.moveTo(null, "npasdf-3.2.2" + suffix);
   test_expected_permission_string("plugin:npasdf");
 
   pluginCopy.moveTo(null, "npasdf_##29387!{}{[][" + suffix);
   test_expected_permission_string("plugin:npasdf");
 
--- a/dom/plugins/test/unit/test_persist_in_prefs.js
+++ b/dom/plugins/test/unit/test_persist_in_prefs.js
@@ -45,17 +45,17 @@ function write_registry(version, info) {
 function run_test() {
   do_check_true(gIsWindows || gIsOSX || gIsLinux);
 
   let file = get_test_plugin_no_symlink();
   if (!file)
     do_throw("Plugin library not found");
 
   const pluginDir = file.parent;
-  const parentDir = pluginDir.parent;
+  const tempDir = do_get_tempdir();
   const suffix = get_platform_specific_plugin_suffix();
   const pluginName = file.leafName.substring(0, file.leafName.length - suffix.length).toLowerCase();
   const pluginHost = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
   const statePref = "plugin.state." + pluginName;
 
   // write plugin registry data
   let registry = "";
 
@@ -85,17 +85,17 @@ function run_test() {
   do_check_false(plugin.clicktoplay);
   // ... and imported into prefs, with 0 being the disabled state
   do_check_eq(0, Services.prefs.getIntPref(statePref));
 
   // prepare a copy of the plugin and backup the original
   file.copyTo(null, "nptestcopy" + suffix);
   let copy = pluginDir.clone();
   copy.append("nptestcopy" + suffix);
-  file.moveTo(parentDir, null);
+  file.moveTo(tempDir, null);
 
   // test that the settings persist through a few variations of test-plugin names
   let testNames = [
     pluginName + "2",
     pluginName.toUpperCase() + "_11_5_42_2323",
     pluginName + "-5.2.7"
   ];
   testNames.forEach(function(leafName) {
@@ -104,17 +104,17 @@ function run_test() {
     pluginHost.reloadPlugins(false);
     plugin = get_test_plugintag();
     do_check_false(plugin == null);
     do_check_true(plugin.disabled);
     do_check_false(plugin.clicktoplay);
   });
 
   // check that the state persists even if the plugin is not always present
-  copy.moveTo(parentDir, null);
+  copy.moveTo(tempDir, null);
   pluginHost.reloadPlugins(false);
   copy.moveTo(pluginDir, null);
   pluginHost.reloadPlugins(false);
 
   plugin = get_test_plugintag();
   do_check_false(plugin == null);
   do_check_true(plugin.disabled);
   do_check_false(plugin.clicktoplay);