Closed
Bug 1094252
Opened 10 years ago
Closed 10 years ago
e10s - fix browser_locationBarCommand.js and browser_locationBarExternalLoad.js to work on e10s
Categories
(Firefox :: General, defect)
Firefox
General
Tracking
()
People
(Reporter: Gijs, Assigned: enndeakin)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 2 obsolete files)
10.32 KB,
patch
|
Gijs
:
review+
|
Details | Diff | Splinter Review |
Fails with various focus checks not having the correct result:
16 INFO TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/base/content/test/general/browser_locationBarCommand.js | There should be no focused element - Got [object XULElement], expected null
Stack trace:
chrome://mochikit/content/browser-test.js:test_is:828
chrome://mochitests/content/browser/browser/base/content/test/general/browser_locationBarCommand.js:runShiftLeftClickTest/listener</</<:41
chrome://mochikit/content/browser-test.js:testScope/test_executeSoon/<.run:858
null:null:0
17 INFO TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/base/content/test/general/browser_locationBarCommand.js | Content window should be focused - Got [object ChromeWindow], expected [object CPOW [object Window]]
Stack trace:
chrome://mochikit/content/browser-test.js:test_is:828
chrome://mochitests/content/browser/browser/base/content/test/general/browser_locationBarCommand.js:runShiftLeftClickTest/listener</</<:42
chrome://mochikit/content/browser-test.js:testScope/test_executeSoon/<.run:858
null:null:0
ad infinitum.
Flags: qe-verify-
Flags: in-testsuite+
Flags: firefox-backlog+
Reporter | ||
Updated•10 years ago
|
Points: --- → 3
Comment 1•10 years ago
|
||
e10s test bugs block e10s, but not a particular milestone.
tracking-e10s:
--- → +
Assignee | ||
Comment 2•10 years ago
|
||
This test retrieves gFocusManager.focusedElement and gFocusManager.focusedWindow at several points. It should instead either have the child send a message containing the focused element at the right time, or just check contentDocumentAsCPOW.activeElement.
The window can be verified by comparing document.activeElement and gBrowser.selectedBrowser.
The test should also wait for the focus to actually happen when needed. Currently, it is using the 'activate' event when it could just use waitForFocus or at least the focus event.
Blocks: 921935
Assignee | ||
Updated•10 years ago
|
Assignee | ||
Comment 3•10 years ago
|
||
The test browser_locationBarExternalLoad.js is similar.
Assignee | ||
Updated•10 years ago
|
Summary: e10s - fix browser_locationBarCommand.js to work on e10s → e10s - fix browser_locationBarCommand.js and browser_locationBarExternalLoad.js to work on e10s
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → enndeakin
Status: NEW → ASSIGNED
Assignee | ||
Comment 4•10 years ago
|
||
This patch works but I am investigating whether I can fix bug 917535 as well.
Assignee | ||
Updated•10 years ago
|
Iteration: --- → 39.3 - 30 Mar
Updated•10 years ago
|
Iteration: 39.3 - 30 Mar → 39.2 - 23 Mar
Assignee | ||
Updated•10 years ago
|
Attachment #8580146 -
Flags: review?(gijskruitbosch+bugs)
Reporter | ||
Comment 5•10 years ago
|
||
Comment on attachment 8580146 [details] [diff] [review]
browser_locationbartests
Review of attachment 8580146 [details] [diff] [review]:
-----------------------------------------------------------------
::: browser/base/content/test/general/browser.ini
@@ +333,5 @@
> skip-if = e10s # Bug 921957 - remote webprogress doesn't supply cancel method on the request object
> [browser_keywordSearch_postData.js]
> [browser_lastAccessedTab.js]
> skip-if = toolkit == "windows" # Disabled on Windows due to frequent failures (bug 969405)
> [browser_locationBarCommand.js]
Are you confident this will also address the linux intermittents?
::: browser/base/content/test/general/browser_locationBarCommand.js
@@ +12,5 @@
> + // Monkey patch saveURL to avoid dealing with file save code paths
> +
> + // Alt and left click to save the url
> + yield new Promise((resolve, reject) => {
> + var oldSaveURL = saveURL;
Nit: let
@@ +31,5 @@
> + Services.obs.addObserver(function observer(aSubject, aTopic) {
> + newwindow = aSubject;
> + Services.obs.removeObserver(observer, aTopic);
> + executeSoon(() => resolve());
> + }, "browser-delayed-startup-finished", false);
I think it would be better to reuse an existing "wait for a window to completely load" promise listener for this.
@@ +54,3 @@
>
> + let test = gTests.shift();
> + while (test) {
do {
let test = gTests.shift();
...
while (gTests.length);
@@ +74,5 @@
> + while (gBrowser.tabs.length > 1) {
> + gBrowser.removeTab(gBrowser.selectedTab);
> + }
> +
> + test = gTests.shift();
and nuke this, please. :-)
@@ +152,5 @@
> EventUtils.synthesizeKey("VK_RETURN", aEvent);
> }
>
> /* Checks that the URL was loaded in the current tab */
> function checkCurrent(aTab) {
This is a generator function that should have a * if we're using those...
@@ +162,5 @@
> is(gBrowser.selectedTab, aTab, "New URL was loaded in the current tab");
> }
>
> /* Checks that the URL was loaded in a new focused tab */
> function checkNewTab(aTab) {
Likewise.
@@ +172,5 @@
> isnot(gBrowser.selectedTab, aTab, "New URL was loaded in a new tab");
> }
>
> +function* promisePageShow(browser, expectedURL) {
> + yield new Promise((resolve, reject) => {
This should just return the promise and not be a generator function, AFAICT.
@@ +184,4 @@
> });
> }
>
> +function* promiseCheckChildFocusedElement(browser)
This returns something and never yields, so it isn't a generator function, right?
Also, this seems to essentially check whether focusedElement === null, so maybe we should call it "promiseCheckChildNoFocusedElement"?
Also, can we make it return a boolean instead of a string?
Attachment #8580146 -
Flags: review?(gijskruitbosch+bugs) → feedback+
Assignee | ||
Comment 6•10 years ago
|
||
> Are you confident this will also address the linux intermittents?
No, I intended to remove that again. But I am getting closer to finding out the cause.
> > + Services.obs.addObserver(function observer(aSubject, aTopic) {
> > + newwindow = aSubject;
> > + Services.obs.removeObserver(observer, aTopic);
> > + executeSoon(() => resolve());
> > + }, "browser-delayed-startup-finished", false);
>
> I think it would be better to reuse an existing "wait for a window to
> completely load" promise listener for this.
I need something that waits for a window to open, but I don't have access to the window yet.
Updated•10 years ago
|
Iteration: 39.2 - 23 Mar → 39.3 - 30 Mar
Assignee | ||
Comment 7•10 years ago
|
||
I addressed everything except 'reuse an existing "wait for a window to completely load"' since I couldn't find an existing function that looked suitable.
Attachment #8580146 -
Attachment is obsolete: true
Attachment #8582767 -
Flags: review?(gijskruitbosch+bugs)
Reporter | ||
Comment 8•10 years ago
|
||
Comment on attachment 8582767 [details] [diff] [review]
browser_locationbartests
Review of attachment 8582767 [details] [diff] [review]:
-----------------------------------------------------------------
r=me, but I have questions below. Up to you if there's a lot to change or not (and whether you want a re-review based on that)
::: browser/base/content/test/general/browser_locationBarCommand.js
@@ +72,5 @@
> + if (gMultiProcessBrowser && test.check == checkNewTab) {
> + // Trigger the command and wait for the new tab to be focused.
> + // In multi-process mode, the browser will get focused, blurred, then
> + // focused again in _adjustFocusAfterTabSwitch, so wait for two focus
> + // events on the browser.
Isn't this a bug?
@@ +89,5 @@
>
> + triggerCommand(test.click, test.event);
> + });
> +
> + yield test.check(tab);
Shouldn't this be yield* because the function you're calling has its own yields ?
Attachment #8582767 -
Flags: review?(gijskruitbosch+bugs) → review+
Assignee | ||
Comment 9•10 years ago
|
||
It turns out that Tim changed this test significantly in bug 1100291 so I'm redoing this work.
> ::: browser/base/content/test/general/browser_locationBarCommand.js
> @@ +72,5 @@
> > + if (gMultiProcessBrowser && test.check == checkNewTab) {
> > + // Trigger the command and wait for the new tab to be focused.
> > + // In multi-process mode, the browser will get focused, blurred, then
> > + // focused again in _adjustFocusAfterTabSwitch, so wait for two focus
> > + // events on the browser.
>
> Isn't this a bug?
Very likely. Bug 1108555 caused this to blur the focused element only to later focus it again. I'd have to look at that bug in more detail to understand what it was actually trying to accomplish.
Assignee | ||
Comment 10•10 years ago
|
||
Hopefully, one last time.
Attachment #8582767 -
Attachment is obsolete: true
Attachment #8584441 -
Flags: review?(gijskruitbosch+bugs)
Reporter | ||
Comment 11•10 years ago
|
||
Comment on attachment 8584441 [details] [diff] [review]
Rework test
Review of attachment 8584441 [details] [diff] [review]:
-----------------------------------------------------------------
::: browser/base/content/test/general/browser_locationBarCommand.js
@@ +191,5 @@
> });
> }
>
> function promiseNewTabSelected() {
> + // In mutli-process mode, we need to wait for the focus event that comes
Nit: multi-process
@@ +241,5 @@
> +{
> + if (!gMultiProcessBrowser) {
> + return Services.focus.focusedElement == null;
> + }
> +
Nit: trailing whitespace.
Attachment #8584441 -
Flags: review?(gijskruitbosch+bugs) → review+
Assignee | ||
Comment 12•10 years ago
|
||
Assignee | ||
Comment 13•10 years ago
|
||
I checked this in again using the TabSwitchDone event instead:
https://treeherder.mozilla.org/#/jobs?repo=mozilla-inbound&revision=cb4ecfdcf4b1
Updated•10 years ago
|
Iteration: 39.3 - 30 Mar → 40.1 - 13 Apr
Comment 14•10 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
status-firefox40:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 40
You need to log in
before you can comment on or make changes to this bug.
Description
•