Closed Bug 1459301 Opened 6 years ago Closed 6 years ago

Fix and add more onNewSession tests

Categories

(GeckoView :: General, enhancement, P2)

All
Android
enhancement

Tracking

(firefox62 fixed)

RESOLVED FIXED
mozilla62
Tracking Status
firefox62 --- fixed

People

(Reporter: jchen, Assigned: jchen)

References

Details

Attachments

(4 files)

Fix the existing onNewSession tests and add a few more involving onNewSession behavior.
Priority: -- → P2
Comment on attachment 8974542 [details]
Bug 1459301 - 1. Wait on sessions opened through onNewSession response;

https://reviewboard.mozilla.org/r/242882/#review249276

The about:blank stuff is such a giant PITA. We should try to fix that in Gecko some day if possible.
Attachment #8974542 - Flags: review?(snorp) → review+
Comment on attachment 8974543 [details]
Bug 1459301 - 2. Allow nested loopUntilIdle calls;

https://reviewboard.mozilla.org/r/242884/#review249280
Attachment #8974543 - Flags: review?(snorp) → review+
Comment on attachment 8974544 [details]
Bug 1459301 - 3. Fix and add onNewSession tests;

https://reviewboard.mozilla.org/r/242886/#review249282

Nice!

::: mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/NavigationDelegateTest.kt:362
(Diff revision 2)
> -        sessionRule.delegateDuringNextWait(object : Callbacks.NavigationDelegate {
> +        sessionRule.session.evaluateJS("window.open('newSession_child.html', '_blank')")
> +
> +        sessionRule.session.waitUntilCalled(object : Callbacks.NavigationDelegate {
> +            @AssertCalled(count = 1, order = [1])
> +            override fun onLoadRequest(session: GeckoSession, uri: String, where: Int, flags: Int, response: GeckoResponse<Boolean>) {
> +                assertThat("URI should be correct", uri, endsWith(NEW_SESSION_CHILD_HTML_PATH))

We could make assertions about the flags here too.
Attachment #8974544 - Flags: review?(snorp) → review+
Pushed by nchen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1b3a0ac4aa60
1. Wait on sessions opened through onNewSession response; r=snorp
https://hg.mozilla.org/integration/autoland/rev/c0c7fa0ae459
2. Allow nested loopUntilIdle calls; r=snorp
https://hg.mozilla.org/integration/autoland/rev/0b3b40464bbd
3. Fix and add onNewSession tests; r=snorp
Manually turn off the popup blocker for all link-clicking tests so local
runs of the tests pass.
Attachment #8975868 - Flags: review+
Pushed by nchen@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/6ddc3b915c34
4. Follow up to fix tests for local runs; r=me
Product: Firefox for Android → GeckoView
Target Milestone: Firefox 62 → mozilla62
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: