Backed out changeset df8bf3b71adb (bug 1006589) for frequent dt1 test failures
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Thu, 08 May 2014 09:26:29 +0200
changeset 182100 2a03b34c89536a80360bb7786acd2596ccf5100e
parent 182069 4c4dcf7533cbd1e78a38e27c9a287538ea0e247e
child 182101 2915a02d24cd006be910eb4d3836f2c5908fd618
push id43215
push usercbook@mozilla.com
push dateThu, 08 May 2014 12:19:13 +0000
treeherdermozilla-inbound@525b22a6baae [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1006589
milestone32.0a1
backs outdf8bf3b71adbb229cb3a157b0e33bb08214d1095
first release with
nightly linux32
2a03b34c8953 / 32.0a1 / 20140508030203 / files
nightly linux64
2a03b34c8953 / 32.0a1 / 20140508030203 / files
nightly mac
2a03b34c8953 / 32.0a1 / 20140508030203 / files
nightly win32
2a03b34c8953 / 32.0a1 / 20140508030203 / files
nightly win64
2a03b34c8953 / 32.0a1 / 20140508030203 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset df8bf3b71adb (bug 1006589) for frequent dt1 test failures
browser/devtools/debugger/debugger-controller.js
browser/devtools/debugger/debugger-panes.js
browser/devtools/debugger/debugger-view.js
browser/devtools/debugger/test/browser.ini
browser/devtools/debugger/test/browser_dbg_variables-view-popup-16.js
browser/devtools/debugger/test/head.js
--- a/browser/devtools/debugger/debugger-controller.js
+++ b/browser/devtools/debugger/debugger-controller.js
@@ -780,24 +780,20 @@ StackFrames.prototype = {
     // Don't change the editor's location if the execution was paused by a
     // public client evaluation. This is useful for adding overlays on
     // top of the editor, like a variable inspection popup.
     let isClientEval = this._currentFrameDescription == FRAME_TYPE.PUBLIC_CLIENT_EVAL;
     let isPopupShown = DebuggerView.VariableBubble.contentsShown();
     if (!isClientEval && !isPopupShown) {
       // Move the editor's caret to the proper url and line.
       DebuggerView.setEditorLocation(where.url, where.line);
-    } else {
-      // Highlight the line where the execution is paused in the editor.
-      DebuggerView.setEditorLocation(where.url, where.line, { noCaret: true });
+      // Highlight the breakpoint at the specified url and line if it exists.
+      DebuggerView.Sources.highlightBreakpoint(where, { noEditorUpdate: true });
     }
 
-    // Highlight the breakpoint at the line and column if it exists.
-    DebuggerView.Sources.highlightBreakpointAtCursor();
-
     // Don't display the watch expressions textbox inputs in the pane.
     DebuggerView.WatchExpressions.toggleContents(false);
 
     // Start recording any added variables or properties in any scope and
     // clear existing scopes to create each one dynamically.
     DebuggerView.Variables.empty();
 
     // If watch expressions evaluation results are available, create a scope
--- a/browser/devtools/debugger/debugger-panes.js
+++ b/browser/devtools/debugger/debugger-panes.js
@@ -410,27 +410,16 @@ SourcesView.prototype = Heritage.extend(
     if (aOptions.openPopup) {
       this._openConditionalPopup();
     } else {
       this._hideConditionalPopup();
     }
   },
 
   /**
-   * Highlight the breakpoint on the current currently focused line/column
-   * if it exists.
-   */
-  highlightBreakpointAtCursor: function() {
-    let url = DebuggerView.Sources.selectedValue;
-    let line = DebuggerView.editor.getCursor().line + 1;
-    let location = { url: url, line: line };
-    this.highlightBreakpoint(location, { noEditorUpdate: true });
-  },
-
-  /**
    * Unhighlights the current breakpoint in this sources container.
    */
   unhighlightBreakpoint: function() {
     this._unselectBreakpoint();
     this._hideConditionalPopup();
   },
 
   /**
@@ -2009,31 +1998,31 @@ VariableBubbleView.prototype = {
   _getOverrideValueEvalMacro: function(aPrefix) {
     return (item, string) =>
       VariablesView.overrideValueEvalMacro(item, string, aPrefix);
   },
 
   /**
    * The mousemove listener for the source editor.
    */
-  _onMouseMove: function(e) {
+  _onMouseMove: function({ clientX: x, clientY: y, buttons: btns }) {
     // Prevent the variable inspection popup from showing when the thread client
     // is not paused, or while a popup is already visible, or when the user tries
     // to select text in the editor.
-    let isResumed = gThreadClient && gThreadClient.state != "paused";
-    let isSelecting = DebuggerView.editor.somethingSelected() && e.buttons > 0;
-    let isPopupVisible = !this._tooltip.isHidden();
-    if (isResumed || isSelecting || isPopupVisible) {
+    if (gThreadClient && gThreadClient.state != "paused"
+        || !this._tooltip.isHidden()
+        || (DebuggerView.editor.somethingSelected()
+         && btns > 0)) {
       clearNamedTimeout("editor-mouse-move");
       return;
     }
     // Allow events to settle down first. If the mouse hovers over
     // a certain point in the editor long enough, try showing a variable bubble.
     setNamedTimeout("editor-mouse-move",
-      EDITOR_VARIABLE_HOVER_DELAY, () => this._findIdentifier(e.clientX, e.clientY));
+      EDITOR_VARIABLE_HOVER_DELAY, () => this._findIdentifier(x, y));
   },
 
   /**
    * The mouseleave listener for the source editor container node.
    */
   _onMouseLeave: function() {
     clearNamedTimeout("editor-mouse-move");
   },
--- a/browser/devtools/debugger/debugger-view.js
+++ b/browser/devtools/debugger/debugger-view.js
@@ -365,17 +365,18 @@ let DebuggerView = {
    *
    * You should use DebuggerView.updateEditor instead. It updates the current
    * caret and debug location based on a requested url and line.
    *
    * @param object aSource
    *        The source object coming from the active thread.
    * @param object aFlags
    *        Additional options for setting the source. Supported options:
-   *          - force: boolean forcing all text to be reshown in the editor
+   *          - force: boolean allowing whether we can get the selected url's
+   *                   text again.
    * @return object
    *         A promise that is resolved after the source text has been set.
    */
   _setEditorSource: function(aSource, aFlags={}) {
     // Avoid setting the same source text in the editor again.
     if (this._editorSource.url == aSource.url && !aFlags.force) {
       return this._editorSource.promise;
     }
@@ -435,17 +436,18 @@ let DebuggerView = {
    *        Additional options for showing the source. Supported options:
    *          - charOffset: character offset for the caret or debug location
    *          - lineOffset: line offset for the caret or debug location
    *          - columnOffset: column offset for the caret or debug location
    *          - noCaret: don't set the caret location at the specified line
    *          - noDebug: don't set the debug location at the specified line
    *          - align: string specifying whether to align the specified line
    *                   at the "top", "center" or "bottom" of the editor
-   *          - force: boolean forcing all text to be reshown in the editor
+   *          - force: boolean allowing whether we can get the selected url's
+   *                   text again
    * @return object
    *         A promise that is resolved after the source text has been set.
    */
   setEditorLocation: function(aUrl, aLine = 0, aFlags = {}) {
     // Avoid trying to set a source for a url that isn't known yet.
     if (!this.Sources.containsValue(aUrl)) {
       return promise.reject(new Error("Unknown source for the specified URL."));
     }
--- a/browser/devtools/debugger/test/browser.ini
+++ b/browser/devtools/debugger/test/browser.ini
@@ -280,17 +280,16 @@ skip-if = (os == 'mac' || os == 'win') &
 [browser_dbg_variables-view-popup-08.js]
 [browser_dbg_variables-view-popup-09.js]
 [browser_dbg_variables-view-popup-10.js]
 [browser_dbg_variables-view-popup-11.js]
 [browser_dbg_variables-view-popup-12.js]
 [browser_dbg_variables-view-popup-13.js]
 [browser_dbg_variables-view-popup-14.js]
 [browser_dbg_variables-view-popup-15.js]
-[browser_dbg_variables-view-popup-16.js]
 [browser_dbg_variables-view-reexpand-01.js]
 [browser_dbg_variables-view-reexpand-02.js]
 [browser_dbg_variables-view-reexpand-03.js]
 [browser_dbg_variables-view-webidl.js]
 [browser_dbg_watch-expressions-01.js]
 [browser_dbg_watch-expressions-02.js]
 [browser_dbg_chrome-create.js]
 skip-if = true # Test doesn't clean up after itself (bug 918507), but also bug 847558 on Linux
deleted file mode 100644
--- a/browser/devtools/debugger/test/browser_dbg_variables-view-popup-16.js
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Tests if opening the variables inspection popup preserves the highlighting
- * associated with the currently debugged line.
- */
-
-const TAB_URL = EXAMPLE_URL + "doc_recursion-stack.html";
-
-function test() {
-  Task.spawn(function() {
-    let [tab, debuggee, panel] = yield initDebugger(TAB_URL);
-    let win = panel.panelWin;
-    let events = win.EVENTS;
-    let editor = win.DebuggerView.editor;
-    let frames = win.DebuggerView.StackFrames;
-    let variables = win.DebuggerView.Variables;
-    let bubble = win.DebuggerView.VariableBubble;
-    let tooltip = bubble._tooltip.panel;
-
-    function checkView(selectedFrame, caretLine, debugLine = caretLine) {
-      is(win.gThreadClient.state, "paused",
-        "Should only be getting stack frames while paused.");
-      is(frames.itemCount, 25,
-        "Should have 25 frames.");
-      is(frames.selectedDepth, selectedFrame,
-        "The correct frame is selected in the widget.");
-      ok(isCaretPos(panel, caretLine),
-        "Editor caret location is correct.");
-      ok(isDebugPos(panel, debugLine),
-        "Editor caret location is correct.");
-    }
-
-    function expandGlobalScope() {
-      let globalScope = variables.getScopeAtIndex(1);
-      is(globalScope.expanded, false,
-        "The globalScope should not be expanded yet.");
-
-      let finished = waitForDebuggerEvents(panel, events.FETCHED_VARIABLES);
-      globalScope.expand();
-      return finished;
-    }
-
-    // Allow this generator function to yield first.
-    executeSoon(() => debuggee.recurse());
-    yield waitForSourceAndCaretAndScopes(panel, ".html", 26);
-    checkView(0, 26);
-
-    yield expandGlobalScope();
-    checkView(0, 26);
-
-    // Inspect variable in topmost frame.
-    yield openVarPopup(panel, { line: 26, ch: 11 });
-    checkView(0, 26);
-
-    yield resumeDebuggerThenCloseAndFinish(panel);
-  });
-}
--- a/browser/devtools/debugger/test/head.js
+++ b/browser/devtools/debugger/test/head.js
@@ -295,22 +295,16 @@ function isCaretPos(aPanel, aLine, aCol 
   let editor = aPanel.panelWin.DebuggerView.editor;
   let cursor = editor.getCursor();
 
   // Source editor starts counting line and column numbers from 0.
   info("Current editor caret position: " + (cursor.line + 1) + ", " + (cursor.ch + 1));
   return cursor.line == (aLine - 1) && cursor.ch == (aCol - 1);
 }
 
-function isDebugPos(aPanel, aLine) {
-  let editor = aPanel.panelWin.DebuggerView.editor;
-  let location = editor.getDebugLocation();
-  return location != null && editor.hasLineClass(aLine - 1, "debug-line");
-}
-
 function isEditorSel(aPanel, [start, end]) {
   let editor = aPanel.panelWin.DebuggerView.editor;
   let range = {
     start: editor.getOffset(editor.getCursor("start")),
     end:   editor.getOffset(editor.getCursor())
   };
 
   // Source editor starts counting line and column numbers from 0.