3 <script src=
"../../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"../../../http/tests/inspector/debugger-test.js"></script>
8 function testFunction()
13 var arr2
= new Uint8Array(new ArrayBuffer(Math
.pow(2, 29)));
19 var executionContext
= WebInspector
.context
.flavor(WebInspector
.ExecutionContext
);
20 InspectorTest
.runDebuggerTestSuite([
23 InspectorTest
.runTestFunctionAndWaitUntilPaused(next
);
28 executionContext
.completionsForExpression("", "var", false, checkAgainstGolden
.bind(this, ["var1", "var2"], [], next
));
33 executionContext
.completionsForExpression("", "di", false, checkAgainstGolden
.bind(this, ["dir", "dirxml"], [], next
));
38 executionContext
.completionsForExpression("", "win", false, checkAgainstGolden
.bind(this, ["window"], [], next
));
43 executionContext
.completionsForExpression("", "t", false, checkAgainstGolden
.bind(this, ["this"], [], next
));
48 executionContext
.completionsForExpression("var1", "toExp", false, checkAgainstGolden
.bind(this, ["toExponential"], [], next
));
53 executionContext
.completionsForExpression("123", "toExp", false, checkAgainstGolden
.bind(this, [], ["toExponential"], next
));
58 executionContext
.completionsForExpression("", "", false, checkAgainstGolden
.bind(this, [], ["$"], next
));
63 executionContext
.completionsForExpression("", "", true, checkAgainstGolden
.bind(this, ["$", "window"], [], next
));
68 executionContext
.completionsForExpression("console", "log('bar');", false, checkAgainstGolden
.bind(this, [], ["$"], next
));
73 executionContext
.completionsForExpression("arr1.", "", false, checkAgainstGolden
.bind(this, ["length"], ["1", "2", "3"], next
));
78 executionContext
.completionsForExpression("arr1[", "", false, checkAgainstGolden
.bind(this, ["0]", "1]", "2]", "\"length\"]"], ["3]"], next
));
81 function step13_ShouldNotCrash(next
)
83 executionContext
.completionsForExpression("arr2.", "", false, checkAgainstGolden
.bind(this, ["length"], ["1", "2", "3"], next
));
87 function checkAgainstGolden(golden
, antiGolden
, continuation
, completions
)
90 for (var i
= 0; i
< golden
.length
; ++i
) {
91 if (completions
.indexOf(golden
[i
]) === -1) {
93 InspectorTest
.addResult("FAIL: NOT FOUND: " + golden
[i
]);
97 for (var i
= 0; i
< antiGolden
.length
; ++i
) {
98 if (completions
.indexOf(antiGolden
[i
]) !== -1) {
100 InspectorTest
.addResult("FAIL: FOUND: " + antiGolden
[i
]);
105 InspectorTest
.addResult("PASS");
114 <body onload=
"runTest()">
116 Test that completions in the context of the call frame will result in names
117 of its scope variables.