Bug 966424 - Intermittent browser_bug765105_background_image_tooltip.js - Remove the timeout; r=miker
authorPatrick Brosset <pbrosset@mozilla.com>
Mon, 31 Mar 2014 11:11:37 +0200
changeset 194789 c77ff7b59bd42571ac9a72f3ba18a72a721cca24
parent 194788 3f245df4a3cd7949a1bcfbf5ae76b09bca9c2de5
child 194790 831be8bf62d3c94b772268f44f8c56387ae5bb88
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmiker
bugs966424
milestone31.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 966424 - Intermittent browser_bug765105_background_image_tooltip.js - Remove the timeout; r=miker
browser/devtools/styleinspector/test/head.js
toolkit/devtools/server/actors/inspector.js
--- a/browser/devtools/styleinspector/test/head.js
+++ b/browser/devtools/styleinspector/test/head.js
@@ -1,18 +1,18 @@
 /* vim:set ts=2 sw=2 sts=2 et: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const TEST_BASE_HTTP = "http://example.com/browser/browser/devtools/styleinspector/test/";
 const TEST_BASE_HTTPS = "https://example.com/browser/browser/devtools/styleinspector/test/";
 
-//Services.prefs.setBoolPref("devtools.dump.emit", true);
-Services.prefs.setBoolPref("devtools.debugger.log", true);
+// Services.prefs.setBoolPref("devtools.dump.emit", true);
+// Services.prefs.setBoolPref("devtools.debugger.log", true);
 
 let tempScope = {};
 
 Cu.import("resource:///modules/devtools/gDevTools.jsm", tempScope);
 let ConsoleUtils = tempScope.ConsoleUtils;
 let gDevTools = tempScope.gDevTools;
 
 Cu.import("resource://gre/modules/devtools/Loader.jsm", tempScope);
@@ -26,17 +26,17 @@ let {CssLogic, CssSelector} = devtools.r
 let promise = devtools.require("sdk/core/promise");
 
 gDevTools.testing = true;
 SimpleTest.registerCleanupFunction(() => {
   gDevTools.testing = false;
 });
 
 SimpleTest.registerCleanupFunction(() => {
-  Services.prefs.clearUserPref("devtools.debugger.log");
+  // Services.prefs.clearUserPref("devtools.debugger.log");
   Services.prefs.clearUserPref("devtools.dump.emit");
 });
 
 let {
   editableField,
   getInplaceEditorForSpan: inplaceEditor
 } = devtools.require("devtools/shared/inplace-editor");
 Components.utils.import("resource://gre/modules/devtools/Console.jsm", tempScope);
@@ -69,17 +69,17 @@ function openView(name, callback)
 {
   openInspector(inspector => {
     function onReady() {
       inspector.sidebar.select(name);
       let { view } = inspector.sidebar.getWindowForTab(name)[name];
       callback(inspector, view);
     }
 
-    if (inspector.sidebar.getTab(name)) {
+    if (inspector.sidebar.getWindowForTab(name)) {
       onReady();
     } else {
       inspector.sidebar.once(name + "-ready", onReady);
     }
   });
 }
 
 function openRuleView(callback)
--- a/toolkit/devtools/server/actors/inspector.js
+++ b/toolkit/devtools/server/actors/inspector.js
@@ -100,16 +100,18 @@ const PSEUDO_SELECTORS = [
 ];
 
 
 let HELPER_SHEET = ".__fx-devtools-hide-shortcut__ { visibility: hidden !important } ";
 HELPER_SHEET += ":-moz-devtools-highlighted { outline: 2px dashed #F06!important; outline-offset: -2px!important } ";
 
 Cu.import("resource://gre/modules/devtools/LayoutHelpers.jsm");
 
+loader.lazyImporter(this, "gDevTools", "resource:///modules/devtools/gDevTools.jsm");
+
 loader.lazyGetter(this, "DOMParser", function() {
   return Cc["@mozilla.org/xmlextras/domparser;1"].createInstance(Ci.nsIDOMParser);
 });
 
 exports.register = function(handle) {
   handle.addGlobalActor(InspectorActor, "inspectorActor");
   handle.addTabActor(InspectorActor, "inspectorActor");
 };
@@ -2597,20 +2599,22 @@ var InspectorActor = protocol.ActorClass
     }
 
     // If the URL doesn't point to a resource, reject
     img.onerror = () => {
       deferred.reject(new Error("Image " + url+ " not available"));
     }
 
     // If the request hangs for too long, kill it to avoid queuing up other requests
-    // to the same actor
-    this.window.setTimeout(() => {
-      deferred.reject(new Error("Image " + url + " could not be retrieved in time"));
-    }, IMAGE_FETCHING_TIMEOUT);
+    // to the same actor, except if we're running tests
+    if (!gDevTools.testing) {
+      this.window.setTimeout(() => {
+        deferred.reject(new Error("Image " + url + " could not be retrieved in time"));
+      }, IMAGE_FETCHING_TIMEOUT);
+    }
 
     img.src = url;
 
     return deferred.promise;
   }, {
     request: {url: Arg(0), maxDim: Arg(1, "nullable:number")},
     response: RetVal("imageData")
   })