Backed out changeset b3ad07be866f (bug 1310416) for pushing dt4 and dt5 over 4800 seconds on Linux debug most of the time, a=backout
authorPhil Ringnalda <philringnalda@gmail.com>
Mon, 14 Nov 2016 18:28:14 -0800
changeset 440004 aeb8bcaafe56ee681cf19a13398cd14d163af6ca
parent 440003 f11ca24b2382ed6c8c7970a82fff53f7f3e0aa6d
child 440005 d32b3458265589c2e9bc2f9413b5a3256a6f9ea3
push id36143
push userjkingston@mozilla.com
push dateWed, 16 Nov 2016 22:20:38 +0000
reviewersbackout
bugs1310416
milestone52.0a2
backs outb3ad07be866f0d891fdfca9b8e6077431b5b52a7
Backed out changeset b3ad07be866f (bug 1310416) for pushing dt4 and dt5 over 4800 seconds on Linux debug most of the time, a=backout CLOSED TREE
devtools/client/inspector/inspector.js
devtools/client/inspector/inspector.xhtml
devtools/client/inspector/shared/test/browser_styleinspector_context-menu-copy-urls.js
devtools/client/inspector/shared/test/head.js
devtools/client/inspector/toolsidebar.js
--- a/devtools/client/inspector/inspector.js
+++ b/devtools/client/inspector/inspector.js
@@ -3,16 +3,18 @@
 /* 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/. */
 
 /* global window */
 
 "use strict";
 
+var Cu = Components.utils;
+var { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
 var Services = require("Services");
 var promise = require("promise");
 var defer = require("devtools/shared/defer");
 var EventEmitter = require("devtools/shared/event-emitter");
 const {executeSoon} = require("devtools/shared/DevToolsUtils");
 var {KeyShortcuts} = require("devtools/client/shared/key-shortcuts");
 var {Task} = require("devtools/shared/task");
 const {initCssProperties} = require("devtools/shared/fronts/css-properties");
@@ -408,31 +410,36 @@ Inspector.prototype = {
         str = INSPECTOR_L10N.getStr("inspector.searchResultsNone");
       }
     }
 
     this.searchResultsLabel.textContent = str;
   },
 
   get React() {
-    return require("devtools/client/shared/vendor/react");
+    return this._toolbox.React;
   },
 
   get ReactDOM() {
-    return require("devtools/client/shared/vendor/react-dom");
+    return this._toolbox.ReactDOM;
   },
 
   get ReactRedux() {
-    return require("devtools/client/shared/vendor/react-redux");
+    return this._toolbox.ReactRedux;
+  },
+
+  get browserRequire() {
+    return this._toolbox.browserRequire;
   },
 
   get InspectorTabPanel() {
     if (!this._InspectorTabPanel) {
       this._InspectorTabPanel =
-        this.React.createFactory(require("devtools/client/inspector/components/inspector-tab-panel"));
+        this.React.createFactory(this.browserRequire(
+        "devtools/client/inspector/components/inspector-tab-panel"));
     }
     return this._InspectorTabPanel;
   },
 
   /**
    * Check if the inspector should use the landscape mode.
    *
    * @return {Boolean} true if the inspector should be in landscape mode.
@@ -442,17 +449,18 @@ Inspector.prototype = {
     return clientWidth > PORTRAIT_MODE_WIDTH;
   },
 
   /**
    * Build Splitter located between the main and side area of
    * the Inspector panel.
    */
   setupSplitter: function () {
-    let SplitBox = this.React.createFactory(require("devtools/client/shared/components/splitter/split-box"));
+    let SplitBox = this.React.createFactory(this.browserRequire(
+      "devtools/client/shared/components/splitter/split-box"));
 
     let splitter = SplitBox({
       className: "inspector-sidebar-splitter",
       initialWidth: INITIAL_SIDEBAR_SIZE,
       initialHeight: INITIAL_SIDEBAR_SIZE,
       splitterSize: 1,
       endPanelControl: true,
       startPanel: this.InspectorTabPanel({
@@ -555,17 +563,17 @@ Inspector.prototype = {
       "computedview",
       INSPECTOR_L10N.getStr("inspector.sidebar.computedViewTitle"),
       defaultTab == "computedview");
 
     this.ruleview = new RuleViewTool(this, this.panelWin);
     this.computedview = new ComputedViewTool(this, this.panelWin);
 
     if (Services.prefs.getBoolPref("devtools.layoutview.enabled")) {
-      const {LayoutView} = require("devtools/client/inspector/layout/layout");
+      const {LayoutView} = this.browserRequire("devtools/client/inspector/layout/layout");
       this.layoutview = new LayoutView(this, this.panelWin);
     }
 
     if (this.target.form.animationsActor) {
       this.sidebar.addFrameTab(
         "animationinspector",
         INSPECTOR_L10N.getStr("inspector.sidebar.animationInspectorTitle"),
         "chrome://devtools/content/animationinspector/animation-inspector.xhtml",
@@ -603,17 +611,18 @@ Inspector.prototype = {
   addSidebarTab: function (id, title, panel, selected) {
     this.sidebar.addTab(id, title, panel, selected);
   },
 
   setupToolbar: function () {
     this.teardownToolbar();
 
     // Setup the sidebar toggle button.
-    let SidebarToggle = this.React.createFactory(require("devtools/client/shared/components/sidebar-toggle"));
+    let SidebarToggle = this.React.createFactory(this.browserRequire(
+      "devtools/client/shared/components/sidebar-toggle"));
 
     let sidebarToggle = SidebarToggle({
       onClick: this.onPaneToggleButtonClicked,
       collapsed: false,
       expandPaneTitle: INSPECTOR_L10N.getStr("inspector.expandPane"),
       collapsePaneTitle: INSPECTOR_L10N.getStr("inspector.collapsePane"),
     });
 
@@ -1842,17 +1851,16 @@ Inspector.prototype = {
 // URL constructor doesn't support chrome: scheme
 let href = window.location.href.replace(/chrome:/, "http://");
 let url = new window.URL(href);
 
 // Only use this method to attach the toolbox if some query parameters are given
 if (url.search.length > 1) {
   const { targetFromURL } = require("devtools/client/framework/target-from-url");
   const { attachThread } = require("devtools/client/framework/attach-thread");
-  const Cu = Components.utils;
   const { BrowserLoader } =
     Cu.import("resource://devtools/client/shared/browser-loader.js", {});
 
   const { Selection } = require("devtools/client/framework/selection");
   const { InspectorFront } = require("devtools/shared/fronts/inspector");
   const { getHighlighterUtils } = require("devtools/client/framework/toolbox-highlighter-utils");
 
   Task.spawn(function* () {
--- a/devtools/client/inspector/inspector.xhtml
+++ b/devtools/client/inspector/inspector.xhtml
@@ -21,23 +21,16 @@
   <link rel="stylesheet" href="resource://devtools/client/shared/components/tabs/tabs.css"/>
   <link rel="stylesheet" href="resource://devtools/client/shared/components/tabs/tabbar.css"/>
   <link rel="stylesheet" href="resource://devtools/client/inspector/components/inspector-tab-panel.css"/>
   <link rel="stylesheet" href="resource://devtools/client/shared/components/splitter/split-box.css"/>
   <link rel="stylesheet" href="resource://devtools/client/inspector/layout/components/Accordion.css"/>
 
   <script type="application/javascript;version=1.8"
           src="chrome://devtools/content/shared/theme-switching.js"></script>
-  <script type="application/javascript;version=1.8">
-    const { BrowserLoader } = Components.utils.import("resource://devtools/client/shared/browser-loader.js", {});
-    const { require } = BrowserLoader({
-      window,
-      baseURI: "resource://devtools/client/inspector/",
-    });
-    </script>
   <script type="application/javascript;version=1.8" src="inspector.js" defer="true"></script>
 </head>
 <body class="theme-body" role="application">
   <div class="inspector-responsive-container theme-body inspector">
 
     <!-- Main Panel Content -->
     <div id="inspector-main-content" class="devtools-main-content">
       <div id="inspector-toolbar" class="devtools-toolbar" nowindowdrag="true"
--- a/devtools/client/inspector/shared/test/browser_styleinspector_context-menu-copy-urls.js
+++ b/devtools/client/inspector/shared/test/browser_styleinspector_context-menu-copy-urls.js
@@ -63,17 +63,17 @@ function* startTest() {
 }
 
 function* testCopyUrlToClipboard({view, inspector}, type, selector, expected) {
   info("Select node in inspector panel");
   yield selectNode(selector, inspector);
 
   info("Retrieve background-image link for selected node in current " +
        "styleinspector view");
-  let property = getBackgroundImageProperty(inspector, view, selector);
+  let property = getBackgroundImageProperty(view, selector);
   let imageLink = property.valueSpan.querySelector(".theme-link");
   ok(imageLink, "Background-image link element found");
 
   info("Simulate right click on the background-image URL");
   let allMenuItems = openStyleContextMenuAndGetAllItems(view, imageLink);
   let menuitemCopyUrl = allMenuItems.find(item => item.label ===
     STYLE_INSPECTOR_L10N.getStr("styleinspector.contextmenu.copyUrl"));
   let menuitemCopyImageDataUrl = allMenuItems.find(item => item.label ===
@@ -95,15 +95,15 @@ function* testCopyUrlToClipboard({view, 
     yield waitForClipboardPromise(() => {
       return menuitemCopyUrl.click();
     }, expected);
   }
 
   info("Hide context menu");
 }
 
-function getBackgroundImageProperty(inspector, view, selector) {
-  let isRuleView = view === inspector.ruleview.view;
+function getBackgroundImageProperty(view, selector) {
+  let isRuleView = view instanceof CssRuleView;
   if (isRuleView) {
     return getRuleViewProperty(view, selector, "background-image");
   }
   return getComputedViewProperty(view, "background-image");
 }
--- a/devtools/client/inspector/shared/test/head.js
+++ b/devtools/client/inspector/shared/test/head.js
@@ -5,16 +5,17 @@
 /* import-globals-from ../../test/head.js */
 "use strict";
 
 // Import the inspector's head.js first (which itself imports shared-head.js).
 Services.scriptloader.loadSubScript(
   "chrome://mochitests/content/browser/devtools/client/inspector/test/head.js",
   this);
 
+var {CssRuleView} = require("devtools/client/inspector/rules/rules");
 var {getInplaceEditorForSpan: inplaceEditor} =
   require("devtools/client/shared/inplace-editor");
 const {getColor: getThemeColor} = require("devtools/client/shared/theme");
 
 const TEST_URL_ROOT =
   "http://example.com/browser/devtools/client/inspector/shared/test/";
 const TEST_URL_ROOT_SSL =
   "https://example.com/browser/devtools/client/inspector/shared/test/";
--- a/devtools/client/inspector/toolsidebar.js
+++ b/devtools/client/inspector/toolsidebar.js
@@ -56,24 +56,29 @@ ToolSidebar.prototype = {
   get React() {
     return this._toolPanel.React;
   },
 
   get ReactDOM() {
     return this._toolPanel.ReactDOM;
   },
 
+  get browserRequire() {
+    return this._toolPanel.browserRequire;
+  },
+
   get InspectorTabPanel() {
     return this._toolPanel.InspectorTabPanel;
   },
 
   // Rendering
 
   render: function () {
-    let Tabbar = this.React.createFactory(require("devtools/client/shared/components/tabs/tabbar"));
+    let Tabbar = this.React.createFactory(this.browserRequire(
+      "devtools/client/shared/components/tabs/tabbar"));
 
     let sidebar = Tabbar({
       toolbox: this._toolPanel._toolbox,
       showAllTabsMenu: true,
       onSelect: this.handleSelectionChange.bind(this),
     });
 
     this._tabbar = this.ReactDOM.render(sidebar, this._tabbox);