Backed out changeset e2ac4f906a29 (bug 843019) for intermittent test failures.
authorRyan VanderMeulen <ryanvm@gmail.com>
Tue, 30 Jul 2013 21:59:11 -0400
changeset 153010 393828fbbfb161a7c6cde1f1e973693d5e5904f6
parent 153009 3b9baad9148559d47f4b59b7d5e52cc76ee29c4f
child 153011 5e5bb1036572c60073039330a3b82f5ea78157dd
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs843019
milestone25.0a1
backs oute2ac4f906a29740a71d7407a945edca23478e0e5
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
Backed out changeset e2ac4f906a29 (bug 843019) for intermittent test failures.
browser/devtools/netmonitor/netmonitor-controller.js
browser/devtools/netmonitor/netmonitor-view.js
browser/devtools/shared/widgets/VariablesView.jsm
browser/devtools/shared/widgets/VariablesViewController.jsm
browser/devtools/webconsole/test/Makefile.in
browser/devtools/webconsole/test/browser_webconsole_bug_843019_variables_view_filter.js
browser/devtools/webconsole/webconsole.js
--- a/browser/devtools/netmonitor/netmonitor-controller.js
+++ b/browser/devtools/netmonitor/netmonitor-controller.js
@@ -9,17 +9,16 @@ const { classes: Cc, interfaces: Ci, uti
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 let promise = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js").Promise;
 Cu.import("resource:///modules/source-editor.jsm");
 Cu.import("resource:///modules/devtools/shared/event-emitter.js");
 Cu.import("resource:///modules/devtools/SideMenuWidget.jsm");
 Cu.import("resource:///modules/devtools/VariablesView.jsm");
-Cu.import("resource:///modules/devtools/VariablesViewController.jsm");
 Cu.import("resource:///modules/devtools/ViewHelpers.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
   "resource://gre/modules/PluralForm.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "NetworkHelper",
   "resource://gre/modules/devtools/NetworkHelper.jsm");
 
--- a/browser/devtools/netmonitor/netmonitor-view.js
+++ b/browser/devtools/netmonitor/netmonitor-view.js
@@ -1501,17 +1501,16 @@ NetworkDetailsView.prototype = {
       Heritage.extend(GENERIC_VARIABLES_VIEW_SETTINGS, {
         emptyText: L10N.getStr("paramsEmptyText"),
         searchPlaceholder: L10N.getStr("paramsFilterText")
       }));
     this._json = new VariablesView($("#response-content-json"),
       Heritage.extend(GENERIC_VARIABLES_VIEW_SETTINGS, {
         searchPlaceholder: L10N.getStr("jsonFilterText")
       }));
-    VariablesViewController.attach(this._json);
 
     this._paramsQueryString = L10N.getStr("paramsQueryString");
     this._paramsFormData = L10N.getStr("paramsFormData");
     this._paramsPostPayload = L10N.getStr("paramsPostPayload");
     this._requestHeaders = L10N.getStr("requestHeaders");
     this._responseHeaders = L10N.getStr("responseHeaders");
     this._requestCookies = L10N.getStr("requestCookies");
     this._responseCookies = L10N.getStr("responseCookies");
@@ -1849,20 +1848,19 @@ NetworkDetailsView.prototype = {
 
         // Valid JSON.
         if (jsonObject) {
           $("#response-content-json-box").hidden = false;
           let jsonScopeName = callbackPadding
             ? L10N.getFormatStr("jsonpScopeName", callbackPadding[0].slice(0, -1))
             : L10N.getStr("jsonScopeName");
 
-          this._json.controller.setSingleVariable({
-            label: jsonScopeName,
-            rawObject: jsonObject,
-          });
+          let jsonScope = this._json.addScope(jsonScopeName);
+          jsonScope.addItem().populate(jsonObject, { expanded: true });
+          jsonScope.expanded = true;
         }
         // Malformed JSON.
         else {
           $("#response-content-textarea-box").hidden = false;
           NetMonitorView.editor("#response-content-textarea").then(aEditor => {
             aEditor.setMode(SourceEditor.MODES.JAVASCRIPT);
             aEditor.setText(aString);
           });
--- a/browser/devtools/shared/widgets/VariablesView.jsm
+++ b/browser/devtools/shared/widgets/VariablesView.jsm
@@ -1159,17 +1159,16 @@ Scope.prototype = {
       return null;
     }
 
     let child = this._createChild(aName, aDescriptor);
     this._store.set(aName, child);
     this._variablesView._itemsByElement.set(child._target, child);
     this._variablesView._currHierarchy.set(child._absoluteName, child);
     child.header = !!aName;
-    child._wasToggled = !aName;
     return child;
   },
 
   /**
    * Adds items for this variable.
    *
    * @param object aItems
    *        An object containing some { name: descriptor } data properties,
--- a/browser/devtools/shared/widgets/VariablesViewController.jsm
+++ b/browser/devtools/shared/widgets/VariablesViewController.jsm
@@ -25,26 +25,26 @@ this.EXPORTED_SYMBOLS = ["VariablesViewC
 
 /**
  * Controller for a VariablesView that handles interfacing with the debugger
  * protocol. Is able to populate scopes and variables via the protocol as well
  * as manage actor lifespans.
  *
  * @param VariablesView aView
  *        The view to attach to.
- * @param object aOptions [optional]
+ * @param object aOptions
  *        Options for configuring the controller. Supported options:
  *        - getGripClient: callback for creating an object grip client
  *        - getLongStringClient: callback for creating a long string grip client
  *        - releaseActor: callback for releasing an actor when it's no longer needed
  *        - overrideValueEvalMacro: callback for creating an overriding eval macro
  *        - getterOrSetterEvalMacro: callback for creating a getter/setter eval macro
  *        - simpleValueEvalMacro: callback for creating a simple value eval macro
  */
-function VariablesViewController(aView, aOptions = {}) {
+function VariablesViewController(aView, aOptions) {
   this.addExpander = this.addExpander.bind(this);
 
   this._getGripClient = aOptions.getGripClient;
   this._getLongStringClient = aOptions.getLongStringClient;
   this._releaseActor = aOptions.releaseActor;
 
   if (aOptions.overrideValueEvalMacro) {
     this._overrideValueEvalMacro = aOptions.overrideValueEvalMacro;
@@ -326,44 +326,16 @@ VariablesViewController.prototype = {
    */
   releaseActors: function(aFilter) {
     for (let actor of this._actors) {
       if (!aFilter || aFilter(actor)) {
         this.releaseActor(actor);
       }
     }
   },
-
-  /**
-   * Helper function for setting up a single Scope with a single Variable
-   * contained within it.
-   *
-   * @param object aOptions
-   *        Options for the contents of the view:
-   *        - objectActor: the grip of the new ObjectActor to show.
-   *        - rawObject: the new raw object to show.
-   *        - label: the new label for the inspected object.
-   * @return Variable
-   *         The single Variable in the Scope.
-   */
-  setSingleVariable: function(aOptions) {
-    let scope = this.view.addScope(aOptions.label);
-    scope.expanded = true;
-    scope.locked = true;
-
-    let container = scope.addItem();
-
-    if (aOptions.objectActor) {
-      this.expand(container, aOptions.objectActor);
-    } else if (aOptions.rawObject) {
-      container.populate(aOptions.rawObject, { expanded: true });
-    }
-
-    return container;
-  },
 };
 
 
 /**
  * Attaches a VariablesViewController to a VariablesView if it doesn't already
  * have one.
  *
  * @param VariablesView aView
--- a/browser/devtools/webconsole/test/Makefile.in
+++ b/browser/devtools/webconsole/test/Makefile.in
@@ -101,17 +101,16 @@ MOCHITEST_BROWSER_FILES = \
 	browser_webconsole_bug_704295.js \
 	browser_webconsole_bug_658368_time_methods.js \
 	browser_webconsole_bug_764572_output_open_url.js \
 	browser_webconsole_bug_622303_persistent_filters.js \
 	browser_webconsole_bug_770099_bad_policyuri.js \
 	browser_webconsole_bug_770099_violation.js \
 	browser_webconsole_bug_766001_JS_Console_in_Debugger.js \
 	browser_webconsole_bug_782653_CSS_links_in_Style_Editor.js \
-	browser_webconsole_bug_843019_variables_view_filter.js \
 	browser_cached_messages.js \
 	browser_bug664688_sandbox_update_after_navigation.js \
 	browser_result_format_as_string.js \
 	browser_webconsole_bug_737873_mixedcontent.js \
 	browser_output_breaks_after_console_dir_uninspectable.js \
 	browser_console_log_inspectable_object.js \
 	browser_bug_638949_copy_link_location.js \
 	browser_output_longstring_expand.js \
deleted file mode 100644
--- a/browser/devtools/webconsole/test/browser_webconsole_bug_843019_variables_view_filter.js
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-// Test for bug 843019.
-// Check that variables view filter works as expected in the web console.
-
-const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-eval-in-stackframe.html";
-
-let gVariablesView;
-
-function test()
-{
-  addTab(TEST_URI);
-  browser.addEventListener("load", function onLoad() {
-    browser.removeEventListener("load", onLoad, true);
-    openConsole(null, consoleOpened);
-  }, true);
-}
-
-function consoleOpened(hud)
-{
-  hud.jsterm.execute("fooObj", () => {
-    let msg = hud.outputNode.querySelector(".webconsole-msg-output");
-    ok(msg, "output message found");
-    isnot(msg.textContent.indexOf("[object Object]"), -1, "message text check");
-
-    hud.jsterm.once("variablesview-fetched", (aEvent, aVar) => {
-      gVariablesView = aVar._variablesView;
-      ok(gVariablesView, "variables view object");
-
-      findVariableViewProperties(aVar, [
-        { name: "testProp", value: "testValue" },
-      ], { webconsole: hud }).then(onTestPropFound);
-    });
-
-    executeSoon(() =>
-      EventUtils.synthesizeMouse(msg, 2, 2, {}, hud.iframeWindow)
-    );
-  });
-}
-
-function onTestPropFound([result])
-{
-  let target = result.matchedProp.target;
-  let win = gVariablesView.window;
-  win.focus();
-  gVariablesView._searchboxContainer.firstChild.focus();
-
-  ok(!target.hasAttribute("non-match"),
-    "Property starts visible");
-  EventUtils.synthesizeKey("X", {}, win);
-  ok(target.hasAttribute("non-match"),
-    "Property is hidden on non-matching search");
-  EventUtils.synthesizeKey("VK_ESCAPE", {}, win);
-  ok(!target.hasAttribute("non-match"),
-    "Pressing ESC makes the property visible again");
-  EventUtils.synthesizeKey("t", {}, win);
-  ok(!target.hasAttribute("non-match"),
-    "Property still visible when search matches");
-
-  gVariablesView = null;
-  finishTest();
-}
--- a/browser/devtools/webconsole/webconsole.js
+++ b/browser/devtools/webconsole/webconsole.js
@@ -3408,23 +3408,30 @@ JSTerm.prototype = {
       view.delete = this._variablesViewDelete.bind(this, aOptions);
     }
     else {
       view.eval = null;
       view.switch = null;
       view.delete = null;
     }
 
-    let container = view.controller.setSingleVariable(aOptions);
+    let scope = view.addScope(aOptions.label);
+    scope.expanded = true;
+    scope.locked = true;
+
+    let container = scope.addItem();
     container.evaluationMacro = simpleValueEvalMacro;
 
     if (aOptions.objectActor) {
+      view.controller.expand(container, aOptions.objectActor);
       view._consoleLastObjectActor = aOptions.objectActor.actor;
     }
     else if (aOptions.rawObject) {
+      container.populate(aOptions.rawObject);
+      view.commitHierarchy();
       view._consoleLastObjectActor = null;
     }
     else {
       throw new Error("Variables View cannot open without giving it an object " +
                       "display.");
     }
 
     this.emit("variablesview-updated", view, aOptions);