Closed Bug 1375710 Opened 7 years ago Closed 7 years ago

Remove more CPOWs from tests

Categories

(Firefox :: General, enhancement)

54 Branch
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 56
Tracking Status
firefox56 --- fixed

People

(Reporter: mrbkap, Assigned: mrbkap)

References

Details

Attachments

(10 files)

59 bytes, text/x-review-board-request
Details
59 bytes, text/x-review-board-request
Gijs
: review+
Details
59 bytes, text/x-review-board-request
Details
59 bytes, text/x-review-board-request
Details
59 bytes, text/x-review-board-request
Details
59 bytes, text/x-review-board-request
Details
59 bytes, text/x-review-board-request
Gijs
: review+
Details
59 bytes, text/x-review-board-request
Details
59 bytes, text/x-review-board-request
Details
59 bytes, text/x-review-board-request
Details
I removed more CPOWs from some tests.
Attachment #8880646 - Flags: review+
Attachment #8880646 - Flags: review?(felipc)
Attachment #8880647 - Flags: review?(felipc) → review?(gijskruitbosch+bugs)
Comment on attachment 8880647 [details] Bug 1375710 - Remove CPOWs from browser_500328.js. https://reviewboard.mozilla.org/r/151984/#review157100 I feel bad because this is a really nice refactoring, but I think using the browser.goBack()/goForward() APIs is actually part of the 'point' of this test, so switching those to content-process-side DOM API calls is not OK. ::: browser/components/sessionstore/test/browser_500328.js:19 (Diff revision 1) > - > + content.testState = "foo"; > - let popStateCount = 0; > > - browser.addEventListener("popstate", function(aEvent) { > - if (popStateCount == 0) { > - popStateCount++; > + // Now go back. This should trigger the popstate event handler. > + let popstatePromise = ContentTaskUtils.waitForEvent(this, "popstate", true); > + content.history.back(); Both here and in the forward() case, I think we should ensure that we continue to call browser.goForward / browser.goBack() . Bug 500328 landed a separate mochitest to check the DOM history APIs, and we should ensure that browser UI copes correctly with the push/popstate stuff as well. It enters docshell via a very different route, so it seems worth keeping the separate coverage.
Attachment #8880647 - Flags: review?(gijskruitbosch+bugs) → review-
Attachment #8880648 - Flags: review?(felipc) → review?(gijskruitbosch+bugs)
Attachment #8880649 - Flags: review?(felipc) → review?(gijskruitbosch+bugs)
Attachment #8880650 - Flags: review?(felipc) → review?(gijskruitbosch+bugs)
Comment on attachment 8880648 [details] Bug 1375710 - Remove CPOWs from browser_iframe_gone_mid_download.js. https://reviewboard.mozilla.org/r/151986/#review157102 yay, net code removal!
Attachment #8880648 - Flags: review?(gijskruitbosch+bugs) → review+
Attachment #8880650 - Flags: review?(gijskruitbosch+bugs) → review+
Attachment #8880651 - Flags: review?(felipc) → review?(gijskruitbosch+bugs)
Comment on attachment 8880649 [details] Bug 1375710 - Remove CPOWs from browser_bug575561.js. https://reviewboard.mozilla.org/r/151988/#review157106 The advantage of the progress listener approach was that we'd catch the load no matter which tab it happened in, and now we won't and the test will just time out if we expected the wrong thing. I checked bugzilla and all the current intermittent issues with the test come in the form of timeouts *anyway*, so still r+, though if it's not strictly necessary to abandon the progress listener approach (can't tell really quickly - are the nsIChannel/nsIRequests CPOWs, or something?) then perhaps you want to keep them? Up to you. ::: browser/base/content/test/general/browser_bug575561.js:61 (Diff revision 1) > - if (testSubFrame) > + await BrowserTestUtils.browserLoaded(browser); > - browser = browser.contentDocument.querySelector("iframe"); > > - let link; > - if (typeof aLinkIndexOrFunction == "function") { > - link = aLinkIndexOrFunction(browser.contentDocument); > + let promise; > + if (expectNewTab) { > + promise = BrowserTestUtils.waitForNewTab(gBrowser).then((tab) => { Nit: don't need () around a single-argument of an arrow function. ::: browser/base/content/test/general/browser_bug575561.js:87 (Diff revision 1) > + link.click(); > + return link.href; > + }); > + } > > - gBrowser.removeTab(appTab); > + let loaded = await promise; Please add an info() before this line saying something like 'waiting on load of <href>' so that if/when tests do fail with a timeout, it's more obvious what failed.
Attachment #8880649 - Flags: review?(gijskruitbosch+bugs) → review+
Attachment #8880651 - Flags: review?(gijskruitbosch+bugs) → review+
Attachment #8880652 - Flags: review?(felipc) → review?(gijskruitbosch+bugs)
Attachment #8880653 - Flags: review?(felipc) → review?(gijskruitbosch+bugs)
Attachment #8880654 - Flags: review?(felipc) → review?(gijskruitbosch+bugs)
Attachment #8880655 - Flags: review?(felipc) → review?(gijskruitbosch+bugs)
Comment on attachment 8880652 [details] Bug 1375710 - Remove CPOWs from browser_domFullscreen_fullscreenMode.js. https://reviewboard.mozilla.org/r/151994/#review157112 ::: commit-message-09fc5:3 (Diff revision 1) > +In these changes, note that the cleanup function was duplicating a check done > +at the end of the loop so didn't need to be duplicated. Well, the cleanup function is guaranteed to run, even if the test breaks halfway through... ::: browser/base/content/test/general/browser_domFullscreen_fullscreenMode.js (Diff revision 1) > - registerCleanupFunction(() => { > - if (browser.contentWindow.fullScreen) { > - BrowserFullScreen(); > - } > - gBrowser.removeTab(tab); > - }); How about just putting the cleanup from the end of the test in here: ```js registerCleanupFunction(async function() { if (window.fullScreen) { executeSoon(() => BrowserFullScreen()); await waitForFullscreenChanges(FS_CHANGE_SIZE); } }); ``` That is, assuming that doesn't race with the tab being closed triggering a full screen change as well...
Attachment #8880652 - Flags: review?(gijskruitbosch+bugs)
Comment on attachment 8880653 [details] Bug 1375710 - Remove CPOWs from browser_e10s_chrome_process. https://reviewboard.mozilla.org/r/151996/#review157118
Attachment #8880653 - Flags: review?(gijskruitbosch+bugs) → review+
Comment on attachment 8880654 [details] Bug 1375710 - Remove CPOWs from browser_visibleFindSelection.js. https://reviewboard.mozilla.org/r/151998/#review157120
Attachment #8880654 - Flags: review?(gijskruitbosch+bugs) → review+
Attachment #8880655 - Flags: review?(gijskruitbosch+bugs) → review+
For future reference, for test-only changes like this, if you use --artifact in the try syntax (on the assumption your changes are otherwise against a usual m-i or m-c changeset, not on top of a bunch of other patches) try can use artifact builds and the try push will complete a lot faster. :-)
Comment on attachment 8880649 [details] Bug 1375710 - Remove CPOWs from browser_bug575561.js. https://reviewboard.mozilla.org/r/151988/#review157106 > Please add an info() before this line saying something like 'waiting on load of <href>' so that if/when tests do fail with a timeout, it's more obvious what failed. If this turns out to be a problem, we can switch this to `BrowserTestUtils.firstBrowserLoaded` which waits for any foreground load. In practice, I'm not too worried, though.
Attachment #8880646 - Flags: review?(felipc)
Attachment #8880648 - Flags: review?(felipc)
Attachment #8880649 - Flags: review?(felipc)
Attachment #8880650 - Flags: review?(felipc)
Attachment #8880651 - Flags: review?(felipc)
Attachment #8880653 - Flags: review?(felipc)
Attachment #8880654 - Flags: review?(felipc)
Attachment #8880655 - Flags: review?(felipc)
Attachment #8880647 - Flags: review?(gijskruitbosch+bugs)
Attachment #8880652 - Flags: review?(gijskruitbosch+bugs)
Attachment #8880647 - Flags: review?(gijskruitbosch+bugs) → review+
Attachment #8880647 - Flags: review?(felipc)
Comment on attachment 8880652 [details] Bug 1375710 - Remove CPOWs from browser_domFullscreen_fullscreenMode.js. https://reviewboard.mozilla.org/r/151994/#review158102 ::: commit-message-09fc5:3 (Diff revision 2) > +In these changes, note that the cleanup function was duplicating a check done > +at the end of the loop so didn't need to be duplicated. Nit: please remove this comment from the commit message, as it's outdated now. :-)
Attachment #8880652 - Flags: review?(gijskruitbosch+bugs) → review+
Attachment #8880652 - Flags: review?(felipc)
Gijs, I added a hack to make things race less in non-e10s, I hope that's OK.
In browser_500328.js.
Pushed by mrbkap@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/34bd0360c470 Remove CPOWs from browser_tabfocus.js. r=Gijs https://hg.mozilla.org/integration/autoland/rev/b97f735867fe Remove CPOWs from browser_500328.js. r=Gijs https://hg.mozilla.org/integration/autoland/rev/8860147eb439 Remove CPOWs from browser_iframe_gone_mid_download.js. r=Gijs https://hg.mozilla.org/integration/autoland/rev/a15327f2942f Remove CPOWs from browser_bug575561.js. r=Gijs https://hg.mozilla.org/integration/autoland/rev/27bd2b13d517 Remove a CPOW from browser_bug734076.js. r=Gijs https://hg.mozilla.org/integration/autoland/rev/99e98edd0f98 Remove CPOWs from browser_bug592338.js. r=Gijs https://hg.mozilla.org/integration/autoland/rev/a55f83bca4e4 Remove CPOWs from browser_domFullscreen_fullscreenMode.js. r=Gijs https://hg.mozilla.org/integration/autoland/rev/30444454a15d Remove CPOWs from browser_e10s_chrome_process. r=Gijs https://hg.mozilla.org/integration/autoland/rev/988f116dc33b Remove CPOWs from browser_visibleFindSelection.js. r=Gijs https://hg.mozilla.org/integration/autoland/rev/5e2d242ba522 Remove CPOWs from browser_plainTextLinks.js. r=Gijs
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: