Closed
Bug 895180
Opened 12 years ago
Closed 11 years ago
Add a new Scratchpad context - remote connection
Categories
(DevTools Graveyard :: Scratchpad, defect, P3)
DevTools Graveyard
Scratchpad
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 27
People
(Reporter: bbenvie, Assigned: bbenvie)
References
Details
Attachments
(1 file, 14 obsolete files)
37.88 KB,
patch
|
bbenvie
:
review+
|
Details | Diff | Splinter Review |
Scratchpad needs a new context so the user can execute to a remotely connected DebuggerServer.
Assignee | ||
Updated•12 years ago
|
Priority: -- → P3
Comment 1•12 years ago
|
||
I was thinking, if a remote toolbox included the scratchpad icon on the right and had some way to pass the target to it, then we wouldn't need an explicit scratchpad context or connection screen. I haven't looked into this, but IIRC those tools (scratchpad, tilt, etc.) don't have panel definitions with isTargetSupported() and constructors that take the target as a parameter. Joe may remember why, but if we can make them more like the other tools, that would go a long way towards letting them target remote devices.
Updated•12 years ago
|
Blocks: tb-debugger
Assignee | ||
Comment 2•11 years ago
|
||
Rather than create a new context option, this patch adds a Scratchpad tab to the toolbox that uses the toolbox's target. This is an early WIP.
Assignee | ||
Comment 3•11 years ago
|
||
Attachment #796563 -
Attachment is obsolete: true
Assignee | ||
Comment 5•11 years ago
|
||
Changes ScratchpadPanel.jsm to be scratchpad-panel.js, uses module loader. Something changed recently though, and the panel will not open when I add the Scratchpad as a tool. Not getting any useful debug dump either, so having a hell of a time debugging it.
Assignee | ||
Comment 6•11 years ago
|
||
Forgot to add scratchpad-panel.js.
Attachment #801774 -
Attachment is obsolete: true
Comment 8•11 years ago
|
||
Oh dear god this patch is going to bit rot my patch for bug 912260 so hard. Or vice versa. :)
Comment 9•11 years ago
|
||
it's a race!™
Assignee | ||
Comment 10•11 years ago
|
||
Going crazy trying to figure out why this won't work!
Assignee | ||
Comment 11•11 years ago
|
||
I'm a dunce, it was working. How does computer work.
Attachment #801837 -
Attachment is obsolete: true
Assignee | ||
Comment 12•11 years ago
|
||
Attachment #801970 -
Attachment is obsolete: true
Assignee | ||
Comment 13•11 years ago
|
||
The last piece remaining is to update the webconsole so that when clicking on a console message link from a Scratchpad that lives in a devtools toolbox, it focuses the toolbox and switches to the Scratchpad tab.
Rob, I just wanted you to check that this is something we actually want landing. When I discussed it with other people, there seemed to be agreement that adding a Scratchpad tab for remote targets was acceptable.
Attachment #802599 -
Attachment is obsolete: true
Attachment #803186 -
Flags: feedback?(rcampbell)
Assignee | ||
Comment 14•11 years ago
|
||
This iteration makes it so clicking the link from the webconsole that resulted from a Scratchpad tab console message will switch to the correct tab and focus the editor.
Attachment #803186 -
Attachment is obsolete: true
Attachment #803186 -
Flags: feedback?(rcampbell)
Attachment #803352 -
Flags: feedback?(rcampbell)
Assignee | ||
Comment 15•11 years ago
|
||
I'm going to go ahead and upgrade this to a review, since this is complete in its current form and it would be nice to get this landed for 26.
Attachment #803352 -
Attachment is obsolete: true
Attachment #803352 -
Flags: feedback?(rcampbell)
Attachment #803780 -
Flags: review?(rcampbell)
Assignee | ||
Comment 16•11 years ago
|
||
Comment 17•11 years ago
|
||
Comment on attachment 803780 [details] [diff] [review]
WIP9
Review of attachment 803780 [details] [diff] [review]:
-----------------------------------------------------------------
this looks pretty clean.
We could probably use a unittest to verify that we get the correct scratchpad when clicking via the webconsole.
tagging dcamp for changes to main.js.
::: browser/devtools/main.js
@@ +231,5 @@
> Tools.jsdebugger,
> Tools.inspector,
> Tools.jsprofiler,
> + Tools.netMonitor,
> + Tools.scratchpad
should we add this behind a pref in case we need to disable in a later release?
Would also like Dave to review the loader changes.
Attachment #803780 -
Flags: review?(rcampbell)
Attachment #803780 -
Flags: review?(dcamp)
Attachment #803780 -
Flags: review+
Comment 18•11 years ago
|
||
JavaScript error: resource://gre/modules/devtools/Loader.jsm, line 86: NS_ERROR_FILE_UNRECOGNIZED_PATH: Component returned failure code: 0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH) [nsILocalFile.initWithPath]
JavaScript error: chrome://browser/content/browser.xul, line 1: DeveloperToolbar is not defined
running with this patch installed. Attempting to open the Toolbar.
Comment 19•11 years ago
|
||
presumably this needs another try run.
Assignee | ||
Comment 20•11 years ago
|
||
Think I got hosed by something else landing, checking into it.
Assignee | ||
Comment 21•11 years ago
|
||
Did need a rebase, but there was also some tests to fix <:|. Should be fixed. Working on adding additional test now, but in the meantime have a tryrun:
https://tbpl.mozilla.org/?tree=Try&rev=658857742b35
Attachment #803780 -
Attachment is obsolete: true
Attachment #803780 -
Flags: review?(dcamp)
Attachment #804511 -
Flags: review?(dcamp)
Updated•11 years ago
|
Attachment #804511 -
Flags: review?(dcamp) → review+
Assignee | ||
Comment 22•11 years ago
|
||
Rebase. Still needs that test.
Attachment #804511 -
Attachment is obsolete: true
Assignee | ||
Comment 23•11 years ago
|
||
Adds a test confirming the link behavior is as expected. Mihai, could you review the webconsole changes for this? The test I added lives in the webconsole tests and the additional behavior in the Scratchpad link click handler. Thanks!
https://tbpl.mozilla.org/?tree=Try&rev=71cd0e2412a9
Attachment #809364 -
Attachment is obsolete: true
Attachment #812936 -
Flags: review?(mihai.sucan)
Comment 24•11 years ago
|
||
Comment on attachment 812936 [details] [diff] [review]
WIP12
Review of attachment 812936 [details] [diff] [review]:
-----------------------------------------------------------------
Patch looks good. Please remove all trailing white space from the patch.
r+ with the comments addressed.
::: browser/devtools/framework/test/browser_toolbox_options.js
@@ +77,5 @@
> cleanup();
> }
>
> function checkTools() {
> + let toolsPref = panelWin.document.querySelectorAll("#default-tools-box > checkbox:not([label$='*'])");
is this safe? you might want an attribute or class name on the checkbox.
::: browser/devtools/webconsole/test/browser_webconsole_scratchpad_panel_link.js
@@ +51,5 @@
> + yield scratchpad.run();
> +
> + info("Clicking link to switch to and focus Scratchpad");
> +
> + let [matched] = [...(yield message)[0].matched];
Nit: the test looks good but I was surprised to see waitForMessages() called before console.log() and without a yield.
Maybe you can move the |let message = wait...| line after the scratchpad.run() call, with a yield. Might be less confusing for me / more obvious that waitForMessages() returns a promise.
@@ +53,5 @@
> + info("Clicking link to switch to and focus Scratchpad");
> +
> + let [matched] = [...(yield message)[0].matched];
> + ok(matched, "Found logged message from Scratchpad");
> + let anchor = matched.querySelector("a");
The selector should probably be a.location.
@@ +56,5 @@
> + ok(matched, "Found logged message from Scratchpad");
> + let anchor = matched.querySelector("a");
> + EventUtils.synthesizeMouse(anchor, 2, 2, {}, hud.iframeWindow);
> +
> + is(aToolbox.getCurrentPanel(), scratchpadPanel,
The mouse click is sync but, IIAMN, it is only an implementation detail that the click also changes the current panel in sync. Should the test wait for the panel selection event?
::: browser/devtools/webconsole/webconsole.js
@@ +2589,5 @@
>
> // Make the location clickable.
> this._addMessageLinkCallback(locationNode, () => {
> if (isScratchpad) {
> + // Check for matching top level Scratchpad window.
This callback function is growing too big. Can you please move the code from the if (isScratchpad) { ... } block into its own method? Please put it in hudservice.js, WebConsole.viewSourceInScratchpad(aURL, aLine), near the other viewSource*() methods.
Thanks!
Attachment #812936 -
Flags: review?(mihai.sucan) → review+
Assignee | ||
Comment 25•11 years ago
|
||
Addresses Mihai's comments:
* Change to '@@iterator' since bug 907077 landed
* Make options toolbox add "unsupported" attribute for unsupported tool checkboxes and use this in the test
* Reorder test so `scratchpad.run()` comes before `yield waitForMessage()` to make more sense.
* Change selector in test to be "a.location"
* change test to use an event listener for "scratchpad-selected" so as to not assume synchronicity
* move logic to WebConsole#viewSourceInScratchpad
* remove trailing whitespace
Attachment #812936 -
Attachment is obsolete: true
Attachment #813791 -
Flags: review+
Assignee | ||
Comment 26•11 years ago
|
||
Whiteboard: [fixed-in-fx-team]
Comment 27•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 27
Updated•7 years ago
|
Product: Firefox → DevTools
Updated•5 years ago
|
Product: DevTools → DevTools Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•