Closed Bug 1661332 Opened 4 years ago Closed 4 years ago

Marionette reftests have to run in content and not chrome context

Categories

(Remote Protocol :: Marionette, defect, P1)

Default
defect

Tracking

(Fission Milestone:M6c, firefox82 fixed)

RESOLVED FIXED
82 Branch
Fission Milestone M6c
Tracking Status
firefox82 --- fixed

People

(Reporter: annyG, Assigned: whimboo)

References

Details

(Whiteboard: [marionette-fission-mvp], [wptsync upstream])

Attachments

(2 files)

No description provided.

The code as added on bug 1658696 calls into this.driver.currentURL, which returns the URL of the currently active browsing context based on the selected context. In case of reftests this currently is chrome. All reftests are run within a browser element, and as such we should actually have the content context set.

James, do you remember why chrome is selected? If not I will dive into that tomorrow.

Flags: needinfo?(james)
Summary: In ensureWindow set the context properly so lastURL will be set correctly → Marionette reftests set the chrome context so driver.currentURL reports the wrong URL

I'm not certain, but given that it's creating a custom kind of browser and accessing the elements directly I wouldn't be surprised to find that the assumptions in content context around the existence of a tabbedbrowser &c. don't hold.

Flags: needinfo?(james)

I'm not fully understanding your reply due to the double negative wordings, but I just tried to see what happens when running reftests in content scope and it all looks fine locally. As such there shouldn't be a need to force chrome context.

Lets see how it looks like in CI:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=9555e9f616cd1069f32270286b315a631318fd1d

Assignee: nobody → hskupin
Severity: -- → S3
Status: NEW → ASSIGNED
Priority: -- → P1

As it can be seen in the try build a lot of jobs are failing because of assertions. So I spoke with James and Emilio on Matrix. It took us a while to figure out what's wrong here, and it all makes sense.

Given that until now the reftests always run in chrome context the following line was not executed in content but in chrome context:

https://searchfox.org/mozilla-central/rev/27932d4e6ebd2f4b8519865dad864c72176e4e3b/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/executormarionette.py#414-415

By making use of using_context three lines above the context switched from chrome -> chrome, and once using_context has been left, chrome context is still present.

As such we now have to account for the correct number of assertions in the test ini files.

Summary: Marionette reftests set the chrome context so driver.currentURL reports the wrong URL → Marionette reftests have to run in content and not chrome context

Reftests are running inside a custom browser element, which basically is
reflected as content context in Marionette. And given that some commands
like "WebDriver:GetCurrentURL" rely on the correct context to be set,
wrong data would be returned.

To allow that all commands are working based on the custom browser element
don't enforce chrome context for the Reftests code in Marionette.

This change also fixes the code which counts the assertions as seen for
debug builds. Until now only assertions from chrome context have been
collected.

Until now only assertions from chrome context have been counted.
With this patch we also account for content scope assertions.

Pushed by hskupin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3b672b3916de [marionette] Run reftests in content and not chrome context. r=marionette-reviewers,jgraham https://hg.mozilla.org/integration/autoland/rev/0b71328757e6 [wpt] Fix assertion counts for content context for wpt-reftests. r=jgraham
Whiteboard: [marionette-fission-mvp]
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/25262 for changes under testing/web-platform/tests
Whiteboard: [marionette-fission-mvp] → [marionette-fission-mvp], [wptsync upstream]
Fission Milestone: --- → M6c
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch

(In reply to Web Platform Test Sync Bot (Matrix: #interop:mozilla.org) from comment #8)

Created web-platform-tests PR
https://github.com/web-platform-tests/wpt/pull/25262 for changes under
testing/web-platform/tests

James, can you please check why this cannot be merged? Thanks.

Flags: needinfo?(james)
Upstream PR was closed without merging
Upstream PR merged by moz-wptsync-bot
Flags: needinfo?(james)
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: