gecko-dev/docshell
Andrew McCreight 2b7c6b4c81 Bug 1592465 - Modernize browser_bug343515.js. r=bzbarsky
I rewrote BrowserUtils.addContentEventListener(), and that caused an
intermittent failure in browser_bug343515.js. The use of
addContentEventListener in the test is questionable, and the test as a
whole is old, so I freshened it up.

Instead of nShotsListener (and oneShotListener, which is a special
case of that) which waits for a hard coded number of load events to
fire to ensure that a page and its subframes are all loaded, I use
BrowserTestUtils.browserLoaded().

Instead of waitForPageshow, which runs a script in the content process
that waits for an event, it uses BrowserTestUtils.waitForContentEvent,
which does the same thing in a hopefully more resilient fashion.

The largest change in terms of number of characters changed is that I
rewrote the test so that it is written inside of a single add_task
async function, instead of being split into a chain of async
functions. I also used await to flatten a lot of .then() chained
things.

I fixed up some variable shadowing. There was some trickiness around
shadowed variable names being used as field names, so I introduced an
intermediate 'data' variable to hold the structure.

Finally, I call BrowserTestUtils.removeTab() instead of calling
removeTab() directly on the browser. I figured that was probably
better, though maybe it does not matter.

I added a check after each step that the URI is correct, where
missing, which would have caught a bug in an earlier version of this
patch.

Differential Revision: https://phabricator.services.mozilla.com/D51183

--HG--
extra : moz-landing-system : lando
2019-10-31 02:47:08 +00:00
..
base Backed out 13 changesets (bug 1581637) for xpchell failures at test_anonymous-coalescing.js on a CLOSED TREE 2019-10-31 02:45:42 +02:00
build Bug 1532703 - Redirect "about:config" to the HTML version on all channels for browser builds. r=mconley 2019-10-14 15:58:42 +00:00
resources/content Backed out changeset 5f185a11889b (bug 1584998) for perma fails on browser_bug593387.js. CLOSED TREE 2019-10-30 23:26:01 +02:00
shistory Bug 1586911: Silence SHEntry assertion after local->remote->local iframe navigation. r=peterv 2019-10-11 19:32:02 +00:00
test Bug 1592465 - Modernize browser_bug343515.js. r=bzbarsky 2019-10-31 02:47:08 +00:00
moz.build Bug 1532703 - Redirect "about:config" to the HTML version on all channels for browser builds. r=mconley 2019-10-14 15:58:42 +00:00