Closed Bug 917706 Opened 11 years ago Closed 11 years ago

Browser Debugger shouldn't require a restart / new window

Categories

(DevTools :: Debugger, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 27

People

(Reporter: Gijs, Assigned: Gijs)

References

Details

(Whiteboard: [chrome-debug])

Attachments

(2 files, 3 obsolete files)

STR: 1. Open the Toolbox 2. Enable Chrome Debugging and Remote Debugging 3. Open the Developer Tools menu 4. Become very sad because the items you want aren't in there. Opening a new window actually shows these items, so we could just add a pref observer that toggles these items instead, and save us some cumbersome in cases like bug 895471 comment 2
This patch works, but it breaks mochitest-browser for me locally. It hangs waiting to start browser_cmd_settings.js, but only if browser_cmd_screenshot.js has run before it. I have poked at this for about an hour now, but I don't understand why this patch would affect that. I've tried sticking all the code I added in try catch blocks with Cu.reportErrors, and no errors are reported, so I'm a bit lost as to what the issue is.
Comment on attachment 806562 [details] [diff] [review] menu items and shortcuts should start working as soon as the relevant pref(s) are flipped, Rob, any idea why this would break tests as described?
Attachment #806562 - Flags: feedback?(rcampbell)
Comment on attachment 806562 [details] [diff] [review] menu items and shortcuts should start working as soon as the relevant pref(s) are flipped, Review of attachment 806562 [details] [diff] [review]: ----------------------------------------------------------------- That test() function in browser_cmd_screenshot.js is doing some funny things with promises. function test() { info("RUN TEST: non-private window"); let nonPrivDone = addWindow({ private: false }, addTabWithToolbarRunTests); let privDone = nonPrivDone.then(function() { info("RUN TEST: private window"); return addWindow({ private: true }, addTabWithToolbarRunTests); }); privDone.then(finish, function(error) { ok(false, 'Promise fail: ' + error); }); } nonPrivDone is a deferred promise. privDone calls nonPrivDone.then() but doesn't add an error function. You should add , function(error) { ok(false, 'Promise fail: ' + error); }); to the end of nonPrivDone.then(... and see what happens. I bet it's failing silently and helpfully eating the error message.
Attachment #806562 - Flags: feedback?(rcampbell)
OK, this works. It seems that DeveloperToolbar.show updates prefs and changes focus, which caused this code to be called multiple times when the test ended, which must have confused the focus checking in mochitest. Simple solution: don't run this code for *every* pref, just for the 'enabled' ones. I'll try to add a test for this functionality in a separate patch. I also believe that with this change, the 'restart now?' butto... err, links, in the settings panel, can disappear. Is that correct?
Attachment #806754 - Flags: review?(rcampbell)
Attachment #806562 - Attachment is obsolete: true
Some simple tests.
Attachment #806777 - Flags: review?(rcampbell)
Comment on attachment 806754 [details] [diff] [review] menu items and shortcuts should start working as soon as the relevant pref(s) are flipped, Review of attachment 806754 [details] [diff] [review]: ----------------------------------------------------------------- I'm fine with this with a successful try run and those extraneous prefs removed. ::: browser/devtools/framework/gDevTools.jsm @@ +367,5 @@ > + > + // Enable Chrome Debugger? > + let chromeEnabled = Services.prefs.getBoolPref("devtools.chrome.enabled"); > + let devtoolsRemoteEnabled = Services.prefs.getBoolPref("devtools.debugger.remote-enabled"); > + let remoteEnabled = chromeEnabled && devtoolsRemoteEnabled && nit: trailing space. @@ +377,5 @@ > + toggleCmd("Tools:ErrorConsole", consoleEnabled); > + > + // Enable Scratchpad in the UI, if the preference allows this. > + let scratchpadEnabled = Services.prefs.getBoolPref("devtools.scratchpad.enabled"); > + toggleCmd("Tools:Scratchpad", scratchpadEnabled); I think we can probably get rid of this pref altogether. @@ +384,5 @@ > + toggleCmd("Tools:DevToolsConnect", devtoolsRemoteEnabled); > + > + // Enable Responsive UI? > + let responsiveUIEnabled = Services.prefs.getBoolPref("devtools.responsiveUI.enabled"); > + toggleCmd("Tools:ResponsiveUI", responsiveUIEnabled); and this one.
Attachment #806754 - Flags: review?(rcampbell) → review+
Test without those two prefs.
Attachment #806796 - Flags: review?(rcampbell)
Attachment #806777 - Attachment is obsolete: true
Attachment #806777 - Flags: review?(rcampbell)
Attachment #806754 - Attachment is obsolete: true
Comment on attachment 806797 [details] [diff] [review] menu items and shortcuts should start working as soon as the relevant pref(s) are flipped, Carrying over r+. Will look at try tomorrow morning and land this assuming that's green and the tests look OK, too. :-)
Attachment #806797 - Flags: review+
sweet! thanks. :)
Attachment #806796 - Flags: review?(rcampbell)
Whiteboard: [chrome-debug] → [chrome-debug][fixed-in-fx-team]
Blocks: 918240
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [chrome-debug][fixed-in-fx-team] → [chrome-debug]
Target Milestone: --- → Firefox 27
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: