Closed Bug 1340529 Opened 7 years ago Closed 7 years ago

Fix shown/hidden events for a devtools_panel toggled from toolbox preferences

Categories

(WebExtensions :: Developer Tools, defect, P2)

defect

Tracking

(firefox54 fixed)

RESOLVED FIXED
mozilla54
Iteration:
54.3 - Mar 6
Tracking Status
firefox54 --- fixed

People

(Reporter: rpl, Assigned: rpl)

References

Details

(Whiteboard: [devtools][devtools.panels] triaged)

Attachments

(1 file)

This issue is a follow up fix for Bug 1300587 (which has introduced the devtools.panels.create API method and the new devtools_panel WebExtension view), in particular related to the following scenario:

- Like the other devtools panels, the devtools panels created from a devtools_page on an opened developer toolbox can be enabled/disabled using the preferences panel (https://developer.mozilla.org/en-US/docs/Tools/Settings).

- When the user uncheck the panel on the toolbox preferences, the panel instance is removed (and the related devtools panel context destroyed), while its definition is not "unregistered" (on purpose, because it can be re-enabled again by check the panel from the toolbox preferences).

- Once the addon devtools panel has been enabled again by the user (from the toolbox preferences), a panel instance is re-created from the previously registered panel definition.

- When the user select/unselect the panel, the "shown and hidden" events should be fired again (and received by the listeners oo the panel.onShown and panel.onHidden events, which have been subscribed when the panel definition has been created)

- Currently, if the panel has been toggled from the toolbox preferences, the shown/hidden events are not fired anymore (because the devtools panel internals are not completely cleaned up from the references of the previous panel instance)

I'm going to attach to this issue the proposed changes, needed to fix the above issue, and the additional test cases for this scenario.
Assignee: nobody → lgreco
Blocks: 1211859
Status: NEW → ASSIGNED
Summary: Fix devtools_panel shown/hidden events after being toggled from toolbox preferences → Fix shown/hidden events for a devtools_panel toggled from toolbox preferences
Attachment #8838527 - Flags: review?(kmaglione+bmo)
Iteration: --- → 54.3 - Mar 6
Priority: -- → P2
Whiteboard: [devtools][devtools.panels] triaged
Comment on attachment 8838527 [details]
Bug 1340529 - Fix shown/hidden events for a devtools_panel toggled from toolbox preferences.

https://reviewboard.mozilla.org/r/113438/#review118886

::: browser/components/extensions/test/browser/browser_ext_devtools_panel.js:175
(Diff revision 1)
> +  // devtools panel events has been fired as expected.
> +  yield gDevTools.showToolbox(target, panelId);
> +  yield extension.awaitMessage("devtools_panel_shown");
> +  info("Addon Devtools Panel shown - after visibilityswitch toggled");
> +
> +  info("wait Addon Devtools Panel has been loaded - after visibilityswitch toggled");

Please capitalize. And something like s/wait/Wait until/
Attachment #8838527 - Flags: review?(kmaglione+bmo) → review+
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/17658ab4c138
Fix shown/hidden events for a devtools_panel toggled from toolbox preferences. r=kmag
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/17658ab4c138
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.