Bug 1137285 - Convert addTab+openInspector to openInspectorForURL r=pbrosset
☠☠ backed out by bcca2f834b76 ☠ ☠
authorAlexandre Poirot <poirot.alex@gmail.com>
Wed, 15 Apr 2015 13:55:29 +0200
changeset 257380 145f6347bb119c65198bb1e7f105574413e2c0bf
parent 257379 75cc30c9a4017b48609d075408c87574f38cc0c7
child 257381 120d272971a6f3746e701744694d387b14ced429
push id1541
push usermichael.l.comella@gmail.com
push dateWed, 15 Apr 2015 18:43:45 +0000
reviewerspbrosset
bugs1137285
milestone40.0a1
Bug 1137285 - Convert addTab+openInspector to openInspectorForURL r=pbrosset
browser/devtools/inspector/test/browser_inspector_breadcrumbs_highlight_hover.js
browser/devtools/inspector/test/browser_inspector_highlight_after_transition.js
browser/devtools/inspector/test/browser_inspector_highlighter-01.js
browser/devtools/inspector/test/browser_inspector_infobar_01.js
browser/devtools/inspector/test/browser_inspector_pseudoclass-menu.js
--- a/browser/devtools/inspector/test/browser_inspector_breadcrumbs_highlight_hover.js
+++ b/browser/devtools/inspector/test/browser_inspector_breadcrumbs_highlight_hover.js
@@ -3,18 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 // Test that hovering over nodes on the breadcrumb buttons in the inspector shows the highlighter over
 // those nodes
 add_task(function*() {
   info("Loading the test document and opening the inspector");
-  yield addTab("data:text/html;charset=utf-8,<h1>foo</h1><span>bar</span>");
-  let {toolbox, inspector} = yield openInspector();
+  let {toolbox, inspector} = yield openInspectorForURL("data:text/html;charset=utf-8,<h1>foo</h1><span>bar</span>");
   info("Selecting the test node");
   yield selectNode("span", inspector);
   let bcButtons = inspector.breadcrumbs["container"];
 
   let onNodeHighlighted = toolbox.once("node-highlight");
   let button = bcButtons.childNodes[1];
   EventUtils.synthesizeMouseAtCenter(button, {type: "mousemove"}, button.ownerDocument.defaultView);
   yield onNodeHighlighted;
--- a/browser/devtools/inspector/test/browser_inspector_highlight_after_transition.js
+++ b/browser/devtools/inspector/test/browser_inspector_highlight_after_transition.js
@@ -1,25 +1,22 @@
 /* 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/. */
 
 "use strict";
 
-const TEST_URI = "http://example.com/browser/browser/devtools/inspector/" +
-                 "test/browser_inspector_highlight_after_transition.html";
+const TEST_URI = TEST_URL_ROOT + "doc_inspector_highlight_after_transition.html";
 
 // Test that the nodeinfobar is never displayed above the top or below the
 // bottom of the content area.
 add_task(function*() {
   info("Loading the test document and opening the inspector");
 
-  yield addTab(TEST_URI);
-
-  let {inspector} = yield openInspector();
+  let {inspector} = yield openInspectorForURL(TEST_URI);
 
   yield checkDivHeight(inspector);
 });
 
 function* checkDivHeight(inspector) {
   let div = getNode("div");
 
   div.setAttribute("visible", "true");
--- a/browser/devtools/inspector/test/browser_inspector_highlighter-01.js
+++ b/browser/devtools/inspector/test/browser_inspector_highlighter-01.js
@@ -3,18 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 // Test that hovering over nodes in the markup-view shows the highlighter over
 // those nodes
 add_task(function*() {
   info("Loading the test document and opening the inspector");
-  yield addTab("data:text/html;charset=utf-8,<h1>foo</h1><span>bar</span>");
-  let {toolbox, inspector} = yield openInspector();
+  let {toolbox, inspector} = yield openInspectorForURL("data:text/html;charset=utf-8,<h1>foo</h1><span>bar</span>");
 
   let isVisible = yield isHighlighting(toolbox);
   ok(!isVisible, "The highlighter is hidden by default");
 
   info("Selecting the test node");
   yield selectNode("span", inspector);
   let container = yield getContainerForSelector("h1", inspector);
 
--- a/browser/devtools/inspector/test/browser_inspector_infobar_01.js
+++ b/browser/devtools/inspector/test/browser_inspector_infobar_01.js
@@ -1,22 +1,20 @@
 /* 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/. */
 
 "use strict";
 
 // Check the position and text content of the highlighter nodeinfo bar.
 
-const TEST_URI = "http://example.com/browser/browser/devtools/inspector/" +
-                 "test/doc_inspector_infobar_01.html";
+const TEST_URI = TEST_URL_ROOT + "doc_inspector_infobar_01.html";
 
 add_task(function*() {
-  yield addTab(TEST_URI);
-  let {inspector} = yield openInspector();
+  let {inspector} = yield openInspectorForURL(TEST_URI);
 
   let testData = [
     {
       selector: "#top",
       position: "bottom",
       tag: "DIV",
       id: "top",
       classes: ".class1.class2",
--- a/browser/devtools/inspector/test/browser_inspector_pseudoclass-menu.js
+++ b/browser/devtools/inspector/test/browser_inspector_pseudoclass-menu.js
@@ -2,27 +2,28 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 "use strict";
 
 // Test that the inspector has the correct pseudo-class locking menu items and
 // that these items actually work
 
 const DOMUtils = Cc["@mozilla.org/inspector/dom-utils;1"].getService(Ci.inIDOMUtils);
+const TEST_URI = "data:text/html;charset=UTF-8," +
+                 "pseudo-class lock node menu tests";
 const PSEUDOS = ["hover", "active", "focus"];
 
 add_task(function*() {
-  yield addTab("data:text/html,pseudo-class lock node menu tests");
+  let {inspector} = yield openInspectorForURL(TEST_URI);
 
   info("Creating the test element");
   let div = content.document.createElement("div");
   div.textContent = "test div";
   content.document.body.appendChild(div);
 
-  let {inspector} = yield openInspector();
   yield selectNode("div", inspector);
 
   info("Getting the inspector ctx menu and opening it");
   let menu = inspector.panelDoc.getElementById("inspector-node-popup");
   yield openMenu(menu);
 
   yield testMenuItems(div, menu, inspector);
 });