If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Intermittent browser_locationBarCommand.js | Content window should be focused - Got [object XrayWrapper [object Window @ 0x2edd060 (native @ 0x4abd4d0)]], expected [object XrayWrapper [object Window @ 0x5ff9990 (native @ 0x47333e0)]] and a bunch more

RESOLVED FIXED in Firefox 24

Status

()

Firefox
Address Bar
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: RyanVM, Assigned: ttaubert)

Tracking

({intermittent-failure})

Trunk
Firefox 25
x86_64
Linux
intermittent-failure
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(firefox24 fixed, firefox25 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

4 years ago
https://tbpl.mozilla.org/php/getParsedLog.php?id=25693203&tree=Fx-Team

Rev3 Fedora 12x64 fx-team debug test mochitest-browser-chrome on 2013-07-24 17:23:20 PDT for push 7d66decedd21
slave: talos-r3-fed64-064

17:28:43     INFO -  TEST-INFO | chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js | Console message: [JavaScript Error: "The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol." {file: "http://example.com/" line: 0}]
17:28:43     INFO -  TEST-INFO | chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js | pageshow: http://example.com/
17:28:43     INFO -  TEST-INFO | chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js | URL should be loaded in a new window
17:28:43     INFO -  TEST-PASS | chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js | Urlbar reverted to original value
17:28:43     INFO -  TEST-PASS | chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js | There should be no focused element
17:28:43  WARNING -  TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js | Content window should be focused - Got [object XrayWrapper [object Window @ 0x2edd060 (native @ 0x4abd4d0)]], expected [object XrayWrapper [object Window @ 0x5ff9990 (native @ 0x47333e0)]]
17:28:43     INFO -  Stack trace:
17:28:43     INFO -      JS frame :: chrome://mochikit/content/browser-test.js :: test_is :: line 560
17:28:43     INFO -      JS frame :: chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js :: runShiftLeftClickTest/listener</</< :: line 42
17:28:43     INFO -      JS frame :: chrome://mochikit/content/browser-test.js :: testScope/test_executeSoon/<.run :: line 589
17:28:43     INFO -      native frame :: <unknown filename> :: <TOP_LEVEL> :: line 0
17:28:43     INFO -  TEST-PASS | chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js | New URL is loaded in new window
17:28:43     INFO -  TEST-INFO | chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js | Running test: Right click on go button
17:28:43     INFO -  JavaScript strict warning: chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js, line 65: reference to undefined property test.startValue
17:28:43     INFO -  ++DOCSHELL 0x4ea4550 == 22 [id = 485]
17:28:43     INFO -  ++DOMWINDOW == 89 (0x59119e8) [serial = 1342] [outer = (nil)]
17:28:43     INFO -  ++DOMWINDOW == 90 (0x31431a8) [serial = 1343] [outer = 0x59119e8]
17:28:43     INFO -  WARNING: NS_ENSURE_TRUE(mMutable) failed: file ../../../../netwerk/base/src/nsSimpleURI.cpp, line 266
17:28:43     INFO -  WARNING: NS_ENSURE_TRUE(mMutable) failed: file ../../../../netwerk/base/src/nsSimpleURI.cpp, line 266
17:28:43     INFO -  TEST-INFO | chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js | Console message: [JavaScript Warning: "ReferenceError: reference to undefined property test.startValue" {file: "chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js" line: 65}]
17:28:43     INFO -  ++DOMWINDOW == 91 (0x1b26678) [serial = 1344] [outer = 0x59119e8]
17:28:43     INFO -  WARNING: NS_ENSURE_TRUE(mMutable) failed: file ../../../../netwerk/base/src/nsSimpleURI.cpp, line 266
17:28:43     INFO -  TEST-INFO | chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js | pageshow: about:blank
17:28:43     INFO -  TEST-PASS | chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js | page proxy state must be invalid for go button to be visible
17:28:44     INFO -  TEST-PASS | chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js | Urlbar still has the value we entered
17:28:44     INFO -  WARNING: NS_ENSURE_TRUE(mMutable) failed: file ../../../../netwerk/base/src/nsSimpleURI.cpp, line 266
17:28:44     INFO -  TEST-INFO | chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js | Running test: Left click on go button
17:28:44     INFO -  ++DOCSHELL 0x2897df0 == 23 [id = 486]
17:28:44     INFO -  ++DOMWINDOW == 92 (0x5f5d118) [serial = 1345] [outer = (nil)]
17:28:44     INFO -  ++DOMWINDOW == 93 (0x5f65518) [serial = 1346] [outer = 0x5f5d118]
17:28:44     INFO -  WARNING: NS_ENSURE_TRUE(mMutable) failed: file ../../../../netwerk/base/src/nsSimpleURI.cpp, line 266
17:28:44     INFO -  WARNING: NS_ENSURE_TRUE(mMutable) failed: file ../../../../netwerk/base/src/nsSimpleURI.cpp, line 266
17:28:44     INFO -  --DOMWINDOW == 92 (0x3cff458) [serial = 1275] [outer = (nil)] [url = about:blank]
17:28:44     INFO -  --DOMWINDOW == 91 (0x2a8f728) [serial = 1265] [outer = (nil)] [url = about:blank]
17:28:44     INFO -  ++DOMWINDOW == 92 (0x5e47d78) [serial = 1347] [outer = 0x5f5d118]
17:28:44     INFO -  --DOMWINDOW == 91 (0x46d1ef8) [serial = 1288] [outer = 0x50dae98] [url = about:blank]
17:28:44     INFO -  WARNING: NS_ENSURE_TRUE(mMutable) failed: file ../../../../netwerk/base/src/nsSimpleURI.cpp, line 266
17:28:44     INFO -  TEST-INFO | chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js | pageshow: about:blank
17:28:44     INFO -  TEST-PASS | chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js | page proxy state must be invalid for go button to be visible
17:28:44     INFO -  TEST-INFO | chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js | URL should be loaded in the current tab
17:28:44     INFO -  TEST-PASS | chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js | Urlbar still has the value we entered
17:28:44     INFO -  TEST-PASS | chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js | There should be no focused element
17:28:44  WARNING -  TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js | Content window should be focused - Got null, expected [object XrayWrapper [object Window @ 0x5ba0d50 (native @ 0x5e47cc0)]]
17:28:44     INFO -  Stack trace:
17:28:44     INFO -      JS frame :: chrome://mochikit/content/browser-test.js :: test_is :: line 560
17:28:44     INFO -      JS frame :: chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js :: checkCurrent :: line 155
17:28:44     INFO -      JS frame :: chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js :: runNextTest/< :: line 68
17:28:44     INFO -      JS frame :: chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js :: pageShowListener :: line 174
17:28:44     INFO -      native frame :: <unknown filename> :: <TOP_LEVEL> :: line 0
17:28:44     INFO -  TEST-PASS | chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js | New URL was loaded in the current tab
17:28:44     INFO -  WARNING: NS_ENSURE_TRUE(mMutable) failed: file ../../../../netwerk/base/src/nsSimpleURI.cpp, line 266
17:28:44     INFO -  TEST-INFO | chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js | Running test: Ctrl/Cmd left click on go button
17:28:44     INFO -  ++DOCSHELL 0x4c16120 == 24 [id = 487]
17:28:44     INFO -  ++DOMWINDOW == 92 (0x5224998) [serial = 1348] [outer = (nil)]
17:28:44     INFO -  ++DOMWINDOW == 93 (0x4a40ed8) [serial = 1349] [outer = 0x5224998]
17:28:44     INFO -  WARNING: NS_ENSURE_TRUE(mMutable) failed: file ../../../../netwerk/base/src/nsSimpleURI.cpp, line 266
17:28:44     INFO -  WARNING: NS_ENSURE_TRUE(mMutable) failed: file ../../../../netwerk/base/src/nsSimpleURI.cpp, line 266
17:28:44     INFO -  --DOMWINDOW == 92 (0x50dae98) [serial = 1286] [outer = (nil)] [url = about:blank]
17:28:44     INFO -  ++DOMWINDOW == 93 (0x4599398) [serial = 1350] [outer = 0x5224998]
17:28:44     INFO -  WARNING: NS_ENSURE_TRUE(mMutable) failed: file ../../../../netwerk/base/src/nsSimpleURI.cpp, line 266
17:28:44     INFO -  TEST-INFO | chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js | pageshow: about:blank
17:28:44     INFO -  TEST-PASS | chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js | page proxy state must be invalid for go button to be visible
17:28:44     INFO -  TEST-INFO | chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js | URL should be loaded in a new focused tab
17:28:44     INFO -  TEST-PASS | chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js | Urlbar still has the value we entered
17:28:44     INFO -  TEST-PASS | chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js | There should be no focused element
17:28:44  WARNING -  TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js | Content window should be focused - Got null, expected [object XrayWrapper [object Window @ 0x45727b0 (native @ 0x45992e0)]]
17:28:44     INFO -  Stack trace:
17:28:44     INFO -      JS frame :: chrome://mochikit/content/browser-test.js :: test_is :: line 560
17:28:44     INFO -      JS frame :: chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js :: checkNewTab :: line 164
17:28:44     INFO -      JS frame :: chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js :: runNextTest/< :: line 68
17:28:44     INFO -      JS frame :: chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js :: pageShowListener :: line 174
17:28:44     INFO -      native frame :: <unknown filename> :: <TOP_LEVEL> :: line 0
17:28:44  WARNING -  TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js | New URL was loaded in a new tab - Didn't expect [object XULElement], but got it
17:28:44     INFO -  Stack trace:
17:28:44     INFO -      JS frame :: chrome://mochikit/content/browser-test.js :: test_isnot :: line 564
17:28:44     INFO -      JS frame :: chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js :: checkNewTab :: line 165
17:28:44     INFO -      JS frame :: chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js :: runNextTest/< :: line 68
17:28:44     INFO -      JS frame :: chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js :: pageShowListener :: line 174
17:28:44     INFO -      native frame :: <unknown filename> :: <TOP_LEVEL> :: line 0
17:28:44     INFO -  WARNING: NS_ENSURE_TRUE(mMutable) failed: file ../../../../netwerk/base/src/nsSimpleURI.cpp, line 266
17:28:44     INFO -  TEST-INFO | chrome://mochitests/content/browser/browser/base/content/test/browser_locationBarCommand.js | Running test: Shift+Ctrl/Cmd left click on go button

etc...
Comment hidden (Treeherder Robot)
Comment hidden (Treeherder Robot)
(Assignee)

Comment 3

4 years ago
Created attachment 782179 [details] [diff] [review]
Fix focus issues and wait for delayed startup in browser_locationBarCommand.js

I can reproduce the intermittent 'Content window should be focused' and 'New URL is loaded in new window - Got , expected example.com' failures on my machine. They happen quite regularly.

The patch addresses bug 880101 as well. It should fix the focus issues by waiting for window activate events to start tests first when the window has focus. Second, it should fix the gURLBar.value issue by waiting for the delayed startup to be finished.
Assignee: nobody → ttaubert
Status: NEW → ASSIGNED
Attachment #782179 - Flags: review?(margaret.leibovic)
(Assignee)

Updated

4 years ago
Blocks: 880101
Comment on attachment 782179 [details] [diff] [review]
Fix focus issues and wait for delayed startup in browser_locationBarCommand.js

> WindowListener.prototype = {
>   onOpenWindow: function(aXULWindow) {
>-    var domwindow = aXULWindow.QueryInterface(Ci.nsIInterfaceRequestor)
>+    let cb = () => this.callback(domwindow);
>+    let domwindow = aXULWindow.QueryInterface(Ci.nsIInterfaceRequestor)
>                               .getInterface(Ci.nsIDOMWindow);
>-    var self = this;
>-    domwindow.addEventListener("load", function() {
>-      domwindow.removeEventListener("load", arguments.callee, false);
> 
>-      if (domwindow.document.location.href != self.url)
>-        return;
>+    function runCallback() {
>+      domwindow.BrowserChromeTest.runWhenReady(() => executeSoon(cb));
>+    }

See bug 896711. You should use whenDelayedStartupFinished.
(Assignee)

Comment 5

4 years ago
(In reply to Dão Gottwald [:dao] from comment #4)
> See bug 896711. You should use whenDelayedStartupFinished.

Oops, yeah. I should've remembered that.
(Assignee)

Comment 6

4 years ago
Created attachment 782182 [details] [diff] [review]
Fix focus issues and wait for delayed startup in browser_locationBarCommand.js, v2

Using whenDelayedStartupFinished() now.
Attachment #782179 - Attachment is obsolete: true
Attachment #782179 - Flags: review?(margaret.leibovic)
Attachment #782182 - Flags: review?(margaret.leibovic)
(Assignee)

Comment 7

4 years ago
Too bad. I just got 'New URL is loaded in new window - Got , expected example.com' failure in the try run.

Comment 8

4 years ago
Comment on attachment 782182 [details] [diff] [review]
Fix focus issues and wait for delayed startup in browser_locationBarCommand.js, v2

Review of attachment 782182 [details] [diff] [review]:
-----------------------------------------------------------------

This looks sensible to me, but it's been a long time since I've worked on browser chrome tests, so I'd feel more comfortable if someone else gave this an r+.
Attachment #782182 - Flags: review?(margaret.leibovic)
Attachment #782182 - Flags: review?(dao)
Attachment #782182 - Flags: feedback+
Comment on attachment 782182 [details] [diff] [review]
Fix focus issues and wait for delayed startup in browser_locationBarCommand.js, v2

Review of attachment 782182 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/base/content/test/browser_locationBarCommand.js
@@ +176,5 @@
>      cb();
>    });
>  }
>  
> +function whenWindowActivated(win, cb) {

One thing to note is that this function depends on something else triggering the activation - if that doesn't happen it will never call its callback.

Probably fine (since we only ever use WindowListener to watch for windows that will be opening, which AFAIK will always be activated at some point).

@@ +207,3 @@
>  
> +    whenWindowActivated(domwindow, maybeRunCallback);
> +    whenDelayedStartupFinished(domwindow, maybeRunCallback);

This makes WindowListener only work for browser chrome windows, when it otherwise would have been generic, so it might be nice to rename it BrowserWindowListener or something.
Attachment #782182 - Flags: review?(dao) → review+
(Assignee)

Comment 10

4 years ago
(In reply to :Gavin Sharp (use gavin@gavinsharp.com for email) from comment #9)
> > +function whenWindowActivated(win, cb) {
> 
> One thing to note is that this function depends on something else triggering
> the activation - if that doesn't happen it will never call its callback.
> 
> Probably fine (since we only ever use WindowListener to watch for windows
> that will be opening, which AFAIK will always be activated at some point).

Yeah, not very different from whenDelayedStartupFinished() thought which also relies on the behavior of the new window we just opened.

> > +    whenWindowActivated(domwindow, maybeRunCallback);
> > +    whenDelayedStartupFinished(domwindow, maybeRunCallback);
> 
> This makes WindowListener only work for browser chrome windows, when it
> otherwise would have been generic, so it might be nice to rename it
> BrowserWindowListener or something.

Ok, will do.
(Assignee)

Comment 11

4 years ago
https://hg.mozilla.org/integration/fx-team/rev/91ee26cefa71
(Reporter)

Comment 12

4 years ago
https://hg.mozilla.org/mozilla-central/rev/91ee26cefa71
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 25
(Reporter)

Comment 13

4 years ago
https://hg.mozilla.org/releases/mozilla-beta/rev/979ccf098181
status-firefox24: --- → fixed
status-firefox25: --- → fixed
You need to log in before you can comment on or make changes to this bug.