Closed
Bug 1421582
Opened 7 years ago
Closed 7 years ago
Fix dom/base/test/browser_bug902350.js to wait for events in proper order.
Categories
(Firefox :: General, enhancement)
Firefox
General
Tracking
()
RESOLVED
FIXED
Firefox 59
Tracking | Status | |
---|---|---|
firefox59 | --- | fixed |
People
(Reporter: arai, Assigned: arai)
References
Details
Attachments
(1 file)
(deleted),
patch
|
Gijs
:
review+
|
Details | Diff | Splinter Review |
after fixing bug 1193394, dom/base/test/browser_bug902350.js fails because of waiting for events that is already missed.
the test is now written in callback way, and it complicated the situation.
I'll rewrite it with async/await.
Assignee | ||
Comment 1•7 years ago
|
||
rewrote the test with async/await, with:
* Services.prefs.* => SpecialPowers.pushPrefEnv
* BrowserTestUtils.addTab => BrowserTestUtils.openNewForegroundTab
* 2 BrowserTestUtils.browserLoaded for top and frame => BrowserTestUtils.browserLoaded with url
* content.location.href check inside content => BrowserTestUtils.browserLoaded with the url
Attachment #8932832 -
Flags: review?(gijskruitbosch+bugs)
Comment 2•7 years ago
|
||
Comment on attachment 8932832 [details] [diff] [review]
Fix dom/base/test/browser_bug902350.js to wait for events in proper order.
Review of attachment 8932832 [details] [diff] [review]:
-----------------------------------------------------------------
LGTM, thanks for the cleanup!
::: dom/base/test/browser_bug902350.js
@@ +1,5 @@
> /*
> * Mixed Content Block frame navigates for target="_top" - Test for Bug 902350
> */
>
> +add_task(async function test() {
Nit: can you name this more descriptively? Also because 'test' as a function name has a special meaning in browser mochitests - I think this works as-is because it's used in an expression, but we might as well avoid doubt. :-)
@@ +3,5 @@
> */
>
> +add_task(async function test() {
> + const PREF_ACTIVE = "security.mixed_content.block_active_content";
> + const httpTestRoot = "https://example.com/browser/dom/base/test/";
Nit: you can use:
getRootDirectory(gTestPath).replace("chrome://mochitests/content", "http://example.com");
to get this, and that will work even if the test and its files are moved. :-)
@@ +14,5 @@
>
> + var url = httpTestRoot + "file_bug902350.html";
> + var frameUrl = httpTestRoot + "file_bug902350_frame.html";
> + let loadPromise = BrowserTestUtils.browserLoaded(testBrowser, false,
> + url);
Nit: this can be 1 line, I think? Looks shorter than the other stuff here, and less than 80ch afaict.
@@ -61,5 @@
>
> -function MixedTest1C() {
> - ContentTask.spawn(gTestBrowser, null, function() {
> - Assert.equal(content.location.href, "http://example.com/",
> - "Navigating to insecure domain through target='_top' failed.")
Ugh, assertion messages that only make sense when the test fails. This confused me for a bit!
Attachment #8932832 -
Flags: review?(gijskruitbosch+bugs) → review+
Pushed by arai_a@mac.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/d7fe31eaf4f3
Fix dom/base/test/browser_bug902350.js to wait for events in proper order. r=Gijs
Assignee | ||
Comment 4•7 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/d7fe31eaf4f38dec638d3ce322dde91763e7fb0f
Bug 1421582 - Fix dom/base/test/browser_bug902350.js to wait for events in proper order. r=Gijs
Comment 5•7 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox59:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 59
You need to log in
before you can comment on or make changes to this bug.
Description
•