Closed
Bug 1399158
Opened 7 years ago
Closed 7 years ago
Add a --jsdebugger flag to geckodriver
Categories
(Testing :: geckodriver, enhancement, P5)
Tracking
(firefox60 fixed)
RESOLVED
FIXED
mozilla60
Tracking | Status | |
---|---|---|
firefox60 | --- | fixed |
People
(Reporter: impossibus, Assigned: paul.eliot.warner, Mentored)
References
Details
(Keywords: good-first-bug, Whiteboard: [lang=rust])
Attachments
(1 file, 2 obsolete files)
7.51 KB,
patch
|
Details | Diff | Splinter Review |
When running wdspec tests now, it's not easy or convenient to debug js code.
Similar to --port, a --jsdebugger option in geckodriver could override relevant prefs to enable the debugger.
The prefs for debugging can be found here: https://searchfox.org/mozilla-central/rev/51eae084534f522a502e4b808484cde8591cb502/testing/marionette/client/marionette_driver/geckoinstance.py#173
This in turn could be used when calling wptrunner if you pass something like `--webdriver-arg=--jsdebugger` (and disable timeouts).
Updated•7 years ago
|
Comment 1•7 years ago
|
||
FWIW
"""safaridriver supports two special WebDriver capabilities just for debugging. The automaticInspection capability will preload the Web Inspector and JavaScript debugger in the background; to pause test execution and bring up Web Inspector’s Debugger tab, you can simply evaluate a debugger; statement in the test page. The automaticProfiling capability will preload the Web Inspector and start a timeline recording in the background; if you later want to see details of what happened during the test, you can open the Timelines tab in Web Inspector to see the captured timeline recording in its entirety."""
Reporter | ||
Updated•7 years ago
|
Mentor: ato
Whiteboard: [lang=rust]
Updated•7 years ago
|
Priority: -- → P5
Updated•7 years ago
|
Whiteboard: [lang=rust] → [lang=rs]
Updated•7 years ago
|
Whiteboard: [lang=rs] → [lang=rust]
Comment 2•7 years ago
|
||
Is it ok if I start working on this?
Comment 3•7 years ago
|
||
(In reply to Øyvind Strømmen (:insulaventus) from comment #2)
> Is it ok if I start working on this?
Sorry, nevermind. I'm gonna work on another bug and won't be able to pick this up right now.
Assignee | ||
Comment 4•7 years ago
|
||
If this still needs to be worked on, I can take care of it.
Comment 5•7 years ago
|
||
Please go ahead.
Assignee | ||
Comment 6•7 years ago
|
||
Assignee | ||
Comment 7•7 years ago
|
||
I've attached a patch. Let me know what you think.
Updated•7 years ago
|
Assignee: nobody → paul.eliot.warner
Status: NEW → ASSIGNED
Comment 8•7 years ago
|
||
Comment on attachment 8944968 [details] [diff] [review]
Added --jsdebugger to geckodriver
Review of attachment 8944968 [details] [diff] [review]:
-----------------------------------------------------------------
Thanks for the patch!
The commit message should contain a reference to the bug and be
written in imperative form. It would also be useful if you expanded
it to explain what the patch adds and what it is for. The first
line should contain the bug reference followed by a short message,
then optionally followed by a blank line and a longer message, like
this:
> Bug 1399158 - Add --jsdebugger flag to geckodriver. r?ato
>
> This patch adds a new flag, --jsdebugger, to the geckodriver
> WebDriver implementation. The flag will cause some preferences to
> be written to the profile before Firefox is started. These will
> start the Browser Toolbox debugger.
::: testing/geckodriver/src/main.rs
@@ +124,5 @@
> .requires("marionette_port")
> .help("Connect to an existing Firefox instance"))
> + .arg(Arg::with_name("jsdebugger")
> + .long("jsdebugger")
> + .value_name("JSDEBUGGER")
No need for a flag value name since this is a boolean flag.
@@ +126,5 @@
> + .arg(Arg::with_name("jsdebugger")
> + .long("jsdebugger")
> + .value_name("JSDEBUGGER")
> + .takes_value(false)
> + .help("Enable js debugging"))
This help message could be better. I would suggest something like
“Enable browser toolbox debugger for Firefox”.
@@ +197,5 @@
> port: marionette_port,
> binary: binary,
> connect_existing: matches.is_present("connect_existing"),
> log_level: log_level,
> + enable_debugger: matches.is_present("jsdebugger")
s/enable_debugger/jsdebugger/g as Gecko has multiple different types
of debuggers.
Missing trailing comma.
::: testing/geckodriver/src/marionette.rs
@@ +506,1 @@
> prefs.insert_slice(&extra_prefs[..]);
This can cause the preferences to be overridden by extra_prefs
on :506. I would consider it a bug if a user passes --jsdebugger
and it does not start.
Attachment #8944968 -
Flags: review-
Assignee | ||
Comment 9•7 years ago
|
||
This patch adds a new flag, --jsdebugger, to the geckodriver WebDriver
implementation. This flag will override several preferences before Firefox is
started. These flags will start the Browser Toolbox debugger.
Assignee | ||
Comment 10•7 years ago
|
||
Alright, I fixed all the things you mentioned. Sorry about the little stuff - I'll make sure it doesn't happen again. The changes to the preferences have been moved to after prefs.insert_slice(&extra_prefs[..]), so the preferences should be set correctly regardless of extra preferences. Let me know what you think.
Updated•7 years ago
|
Attachment #8944968 -
Attachment is obsolete: true
Comment 11•7 years ago
|
||
This looks mostly fine now (with the exception of the variable name
enable_debugger) and it compiles fine.
However, when I launch geckodriver with --jsdebugger and start a
new session I get the global modal dialogue asking me if I’m ready
to run the Marionette tests, but the actual browser toolbox does
not open. I can’t see that geckoinstance.py is doing this any
differently.
I will have a closer look in the morning.
Assignee | ||
Comment 12•7 years ago
|
||
What method are you using to launch/test geckodriver?
Comment 13•7 years ago
|
||
Sorry for leaving this dangling. The problem here is that -jsdebugger
isn’t passed on to Firefox.
Comment 14•7 years ago
|
||
When --jsdebugger is passed to geckodriver, it will override
preferences related to starting the Browser Toolbox and pass
-jsdebugger on to the Firefox process.
It is functionally equivalent to "./mach marionette test --jsdebugger".
MozReview-Commit-ID: ADfrLPXtQoy
Updated•7 years ago
|
Attachment #8945212 -
Attachment is obsolete: true
Updated•7 years ago
|
Summary: add a --jsdebugger option to geckodriver → Add a --jsdebugger flag to geckodriver
Comment 15•7 years ago
|
||
Pushed by atolfsen@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b8a6c14ad280
Add --jsdebugger flag to geckodriver. r=ato
Comment 16•7 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox60:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
Assignee | ||
Comment 17•7 years ago
|
||
Awesome.
I'm going to be looking for some new bugs to take on. I'd like to stick around geckodriver, but if you have some other place you think I could be more useful, let me know and I'll try and help out there.
You need to log in
before you can comment on or make changes to this bug.
Description
•