|
4 | 4 | // Tests loading sourcemapped sources, setting breakpoints, and |
5 | 5 | // inspecting restored scopes. |
6 | 6 |
|
7 | | -function toggleNode(dbg, index) { |
8 | | - clickElement(dbg, "scopeNode", index); |
9 | | -} |
10 | | - |
11 | | -function getLabel(dbg, index) { |
12 | | - return findElement(dbg, "scopeNode", index).innerText; |
13 | | -} |
14 | | - |
15 | | -function hasScopeNode(dbg, index) { |
16 | | - return !!findElement(dbg, "scopeNode", index); |
17 | | -} |
18 | | - |
19 | | -async function waitForScopeNode(dbg, index) { |
20 | | - const selector = getSelector("scopeNode", index); |
21 | | - return waitForElementWithSelector(dbg, selector); |
22 | | -} |
23 | | - |
24 | 7 | // This source map does not have source contents, so it's fetched separately |
25 | 8 | add_task(async function() { |
26 | 9 | // NOTE: the CORS call makes the test run times inconsistent |
@@ -50,36 +33,27 @@ add_task(async function() { |
50 | 33 | await waitForPaused(dbg); |
51 | 34 | assertPausedLocation(dbg); |
52 | 35 |
|
53 | | - await waitForDispatch(dbg, "MAP_SCOPES"); |
| 36 | + is(getScopeLabel(dbg, 1), "Block"); |
| 37 | + is(getScopeLabel(dbg, 2), "na"); |
| 38 | + is(getScopeLabel(dbg, 3), "nb"); |
54 | 39 |
|
55 | | - is(getLabel(dbg, 1), "Block"); |
56 | | - is(getLabel(dbg, 2), "<this>"); |
57 | | - is(getLabel(dbg, 3), "na"); |
58 | | - is(getLabel(dbg, 4), "nb"); |
| 40 | + is(getScopeLabel(dbg, 4), "Block"); |
59 | 41 |
|
60 | | - is(getLabel(dbg, 5), "Block"); |
61 | | - is( |
62 | | - hasScopeNode(dbg, 8) && !hasScopeNode(dbg, 9), |
63 | | - true, |
64 | | - "scope count before expand" |
65 | | - ); |
66 | | - toggleNode(dbg, 5); |
| 42 | + await toggleScopeNode(dbg, 4); |
67 | 43 |
|
68 | | - await waitForScopeNode(dbg, 9); |
| 44 | + is(getScopeLabel(dbg, 5), "ma"); |
| 45 | + is(getScopeLabel(dbg, 6), "mb"); |
69 | 46 |
|
70 | | - is(getLabel(dbg, 6), "ma"); |
71 | | - is(getLabel(dbg, 7), "mb"); |
| 47 | + await toggleScopeNode(dbg, 7); |
72 | 48 |
|
73 | | - is( |
74 | | - hasScopeNode(dbg, 10) && !hasScopeNode(dbg, 11), |
75 | | - true, |
76 | | - "scope count before expand" |
77 | | - ); |
78 | | - toggleNode(dbg, 8); |
| 49 | + is(getScopeLabel(dbg, 8), "a"); |
| 50 | + is(getScopeLabel(dbg, 9), "b"); |
| 51 | + |
| 52 | + is(getScopeLabel(dbg, 10), "Module"); |
79 | 53 |
|
80 | | - await waitForScopeNode(dbg, 11); |
| 54 | + await toggleScopeNode(dbg, 10); |
81 | 55 |
|
82 | | - is(getLabel(dbg, 9), "a"); |
83 | | - is(getLabel(dbg, 10), "arguments"); |
84 | | - is(getLabel(dbg, 11), "b"); |
| 56 | + is(getScopeLabel(dbg, 11), "binaryLookup:o()"); |
| 57 | + is(getScopeLabel(dbg, 12), "comparer:t()"); |
| 58 | + is(getScopeLabel(dbg, 13), "fancySort"); |
85 | 59 | }); |
0 commit comments