1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const TARGET_PANES = [
{
title: "Temporary Extensions",
pref: "devtools.aboutdebugging.collapsibilities.temporaryExtension",
},
{
title: "Extensions",
pref: "devtools.aboutdebugging.collapsibilities.installedExtension",
},
{
title: "Tabs",
pref: "devtools.aboutdebugging.collapsibilities.tab",
},
{
title: "Service Workers",
pref: "devtools.aboutdebugging.collapsibilities.serviceWorker",
},
{
title: "Shared Workers",
pref: "devtools.aboutdebugging.collapsibilities.sharedWorker",
},
{
title: "Other Workers",
pref: "devtools.aboutdebugging.collapsibilities.otherWorker",
},
];
/* exported TARGET_PANES */
function prepareCollapsibilitiesTest() {
// Make all collapsibilities to be expanded.
for (const { pref } of TARGET_PANES) {
Services.prefs.setBoolPref(pref, false);
}
}
/* exported prepareCollapsibilitiesTest */
async function toggleCollapsibility(debugTargetPane) {
debugTargetPane.querySelector(".qa-debug-target-pane-title").click();
// Wait for animation of collapse/expand.
const animations = debugTargetPane.ownerDocument.getAnimations();
await Promise.all(animations.map(animation => animation.finished));
}
/* exported toggleCollapsibility */
registerCleanupFunction(() => {
for (const { pref } of TARGET_PANES) {
Services.prefs.clearUserPref(pref);
}
});
|