Add a simple helper to start devtools for wptrunner
Categories
(DevTools :: General, task, P3)
Tracking
(firefox88 fixed)
Tracking | Status | |
---|---|---|
firefox88 | --- | fixed |
People
(Reporter: jdescottes, Assigned: jdescottes)
Details
Attachments
(2 files)
Web platform tests are adding support for opening DevTools on the test window. However, we lack a good single helper to do that so a bunch of devtools-specific code had to be written: https://github.com/web-platform-tests/wpt/pull/27309/files#diff-df97e1990f484c82b8d8a34baf584d01761bfd98386beb69fac702edb31003a3R630-R651
class MarionetteDebugProtocolPart(DebugProtocolPart):
def setup(self):
self.marionette = self.parent.marionette
def load_devtools(self):
with self.marionette.using_context(self.marionette.CONTEXT_CHROME):
self.parent.base.execute_script("""
const { require } = ChromeUtils.import("resource://devtools/shared/Loader.jsm");
const { TargetFactory } = require("devtools/client/framework/target");
const { gDevTools } = require("devtools/client/framework/devtools");
const callback = arguments[arguments.length - 1];
async function loadDevTools() {
const target = await TargetFactory.forTab(window.gBrowser.selectedTab);
await gDevTools.showToolbox(target, "webconsole", "bottom");
}
loadDevTools().catch(() => dump("Devtools failed to load"))
.then(callback);
""", asynchronous=True)
We should expose a single helper method allowing to easily open DevTools. Maybe from DevToolsShim.jsm ? Otherwise we might break this without realizing it.
Assignee | ||
Comment 1•3 years ago
|
||
We are going to refactor code around TargetFactory.forTab, mostly to use descriptors instead of targets, we should take care of that now.
Assignee | ||
Comment 2•3 years ago
|
||
The webplatform test runner recently added an option to open devtools during their tests.
The current implementation relies on TargetFactory::forTab and gDevTools::showToolbox.
Those methods will most likely change as we move away from targets and start using descriptors.
See previous WPT PR at https://github.com/web-platform-tests/wpt/pull/27309
Will open a PR on the wpt repo to update their snippet when this lands in m-c
Assignee | ||
Comment 3•3 years ago
|
||
Depends on D105740
WPT runner can target several older versions of Firefox, so only use the new showToolboxForTab when the API is available on DevToolsShim
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8a0f5c24ed9a [devtools] Add a simple helper to start devtools for wptrunner r=ladybenko https://hg.mozilla.org/integration/autoland/rev/ae1fa0484c91 Use showToolboxTab to open DevTools in wpt marionetteexecutor r=jgraham
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/27777 for changes under testing/web-platform/tests
Comment 6•3 years ago
|
||
Backed out 10 changesets (bug 1694140, bug 1694886, bug 1688688) for devtools failures on browser_CORS-console-warnings.js.
https://hg.mozilla.org/integration/autoland/rev/55019aa73595f6c194774b1999c440e1aef2bc9e
Push with failures:
https://treeherder.mozilla.org/jobs?repo=autoland&revision=1b7367a27d9ab527d63ef8eac7af1111ab0eb7b9&selectedTaskRun=ff1I83nYQSC8WTxh546ZAA.0
Failure log:
https://treeherder.mozilla.org/logviewer?job_id=331196400&repo=autoland&lineNumber=8892
Upstream PR was closed without merging
Assignee | ||
Comment 8•3 years ago
|
||
I missed one non-devtools callsite for forTab...
Assignee | ||
Comment 9•3 years ago
|
||
Also had a quick look at the TV failures, they seem to also fail on repeat without my patches
Comment 10•3 years ago
|
||
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4bbd72c94c26 [devtools] Add a simple helper to start devtools for wptrunner r=ladybenko https://hg.mozilla.org/integration/autoland/rev/546a19a61366 Use showToolboxTab to open DevTools in wpt marionetteexecutor r=jgraham
Comment 11•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/4bbd72c94c26
https://hg.mozilla.org/mozilla-central/rev/546a19a61366
Upstream PR merged by moz-wptsync-bot
Description
•