| OLD | NEW |
| 1 |
| 1 <html> | 2 <html> |
| 2 <head> | 3 <head> |
| 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> | 4 <script src="../../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../../http/tests/inspector/debugger-test.js"></script> | 5 <script src="../../../http/tests/inspector/debugger-test.js"></script> |
| 5 <script> | 6 <script> |
| 6 | 7 |
| 7 var a = 1; | 8 var a = 1; |
| 8 function testFunction() | 9 function testFunction() |
| 9 { | 10 { |
| 10 var var1 = 2; | 11 var var1 = 2; |
| 11 var var2 = 3; | 12 var var2 = 3; |
| 12 var arr1 = [1,2,3]; | 13 var arr1 = [1,2,3]; |
| 13 var arr2 = new Uint8Array(new ArrayBuffer(Math.pow(2, 29))); | 14 var arr2 = new Uint8Array(new ArrayBuffer(Math.pow(2, 29))); |
| 14 debugger; | 15 debugger; |
| 15 } | 16 } |
| 16 | 17 |
| 17 function test() | 18 function test() |
| 18 { | 19 { |
| 19 var executionContext = WebInspector.context.flavor(WebInspector.ExecutionCon
text); | 20 var executionContext = WebInspector.context.flavor(WebInspector.ExecutionCon
text); |
| 20 InspectorTest.runDebuggerTestSuite([ | 21 InspectorTest.runDebuggerTestSuite([ |
| 21 function step1(next) | 22 function step1(next) |
| 22 { | 23 { |
| 23 InspectorTest.runTestFunctionAndWaitUntilPaused(next); | 24 InspectorTest.runTestFunctionAndWaitUntilPaused(next); |
| 24 }, | 25 }, |
| 25 | 26 |
| 26 function step2(next) | 27 function step2(next) |
| 27 { | 28 { |
| 28 executionContext.completionsForExpression("", "var", 3, "var", false
, checkAgainstGolden.bind(this, ["var1", "var2"], [], next)); | 29 executionContext.completionsForExpression("", "var", false, checkAga
instGolden.bind(this, ["var1", "var2"], [], next)); |
| 29 }, | 30 }, |
| 30 | 31 |
| 31 function step3(next) | 32 function step3(next) |
| 32 { | 33 { |
| 33 executionContext.completionsForExpression("", "di", 2, "di", false,
checkAgainstGolden.bind(this, ["dir", "dirxml"], [], next)); | 34 executionContext.completionsForExpression("", "di", false, checkAgai
nstGolden.bind(this, ["dir", "dirxml"], [], next)); |
| 34 }, | 35 }, |
| 35 | 36 |
| 36 function step4(next) | 37 function step4(next) |
| 37 { | 38 { |
| 38 executionContext.completionsForExpression("", "win", 3, "win", false
, checkAgainstGolden.bind(this, ["window"], [], next)); | 39 executionContext.completionsForExpression("", "win", false, checkAga
instGolden.bind(this, ["window"], [], next)); |
| 39 }, | 40 }, |
| 40 | 41 |
| 41 function step5(next) | 42 function step5(next) |
| 42 { | 43 { |
| 43 executionContext.completionsForExpression("", "t", 1, "t", false, ch
eckAgainstGolden.bind(this, ["this"], [], next)); | 44 executionContext.completionsForExpression("", "t", false, checkAgain
stGolden.bind(this, ["this"], [], next)); |
| 44 }, | 45 }, |
| 45 | 46 |
| 46 function step6(next) | 47 function step6(next) |
| 47 { | 48 { |
| 48 executionContext.completionsForExpression("var1", "var1.toExp", 10,
"toExp", false, checkAgainstGolden.bind(this, ["toExponential"], [], next)); | 49 executionContext.completionsForExpression("var1", "toExp", false, ch
eckAgainstGolden.bind(this, ["toExponential"], [], next)); |
| 49 }, | 50 }, |
| 50 | 51 |
| 51 function step7(next) | 52 function step7(next) |
| 52 { | 53 { |
| 53 executionContext.completionsForExpression("123", "123.toExp", 9, "to
Exp", false, checkAgainstGolden.bind(this, [], ["toExponential"], next)); | 54 executionContext.completionsForExpression("123", "toExp", false, che
ckAgainstGolden.bind(this, [], ["toExponential"], next)); |
| 54 }, | 55 }, |
| 55 | 56 |
| 56 function step8(next) | 57 function step8(next) |
| 57 { | 58 { |
| 58 executionContext.completionsForExpression("", "", 0, "", false, chec
kAgainstGolden.bind(this, [], ["$"], next)); | 59 executionContext.completionsForExpression("", "", false, checkAgain
stGolden.bind(this, [], ["$"], next)); |
| 59 }, | 60 }, |
| 60 | 61 |
| 61 function step9(next) | 62 function step9(next) |
| 62 { | 63 { |
| 63 executionContext.completionsForExpression("", "", 0, "", true, check
AgainstGolden.bind(this, ["$", "window"], [], next)); | 64 executionContext.completionsForExpression("", "", true, checkAgainst
Golden.bind(this, ["$", "window"], [], next)); |
| 64 }, | 65 }, |
| 65 | 66 |
| 66 function step10(next) | 67 function step10(next) |
| 67 { | 68 { |
| 68 executionContext.completionsForExpression("console", "console.log('b
ar');", 19, "log('bar');", false, checkAgainstGolden.bind(this, [], ["$"], next)
); | 69 executionContext.completionsForExpression("console", "log('bar');",
false, checkAgainstGolden.bind(this, [], ["$"], next)); |
| 69 }, | 70 }, |
| 70 | 71 |
| 71 function step11(next) | 72 function step11(next) |
| 72 { | 73 { |
| 73 executionContext.completionsForExpression("arr1.", "arr1.", 5, "", f
alse, checkAgainstGolden.bind(this, ["length"], ["1", "2", "3"], next)); | 74 executionContext.completionsForExpression("arr1.", "", false, checkA
gainstGolden.bind(this, ["length"], ["1", "2", "3"], next)); |
| 74 }, | 75 }, |
| 75 | 76 |
| 76 function step12(next) | 77 function step12(next) |
| 77 { | 78 { |
| 78 executionContext.completionsForExpression("arr1[", "arr1[", 5, "", f
alse, checkAgainstGolden.bind(this, ["\"length\"]"], ["3]"], next)); | 79 executionContext.completionsForExpression("arr1[", "", false, checkA
gainstGolden.bind(this, ["\"length\"]"], ["3]"], next)); |
| 79 }, | 80 }, |
| 80 | 81 |
| 81 function step13_ShouldNotCrash(next) | 82 function step13_ShouldNotCrash(next) |
| 82 { | 83 { |
| 83 executionContext.completionsForExpression("arr2.", "arr2.", 5, "", f
alse, checkAgainstGolden.bind(this, ["length"], ["1", "2", "3"], next)); | 84 executionContext.completionsForExpression("arr2.", "", false, check
AgainstGolden.bind(this, ["length"], ["1", "2", "3"], next)); |
| 84 }, | 85 }, |
| 85 ]); | 86 ]); |
| 86 | 87 |
| 87 function checkAgainstGolden(golden, antiGolden, continuation, completions) | 88 function checkAgainstGolden(golden, antiGolden, continuation, completions) |
| 88 { | 89 { |
| 89 var failed = false; | 90 var failed = false; |
| 90 for (var i = 0; i < golden.length; ++i) { | 91 for (var i = 0; i < golden.length; ++i) { |
| 91 if (completions.indexOf(golden[i]) === -1) { | 92 if (completions.indexOf(golden[i]) === -1) { |
| 92 failed = true; | 93 failed = true; |
| 93 InspectorTest.addResult("FAIL: NOT FOUND: " + golden[i]); | 94 InspectorTest.addResult("FAIL: NOT FOUND: " + golden[i]); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 111 </script> | 112 </script> |
| 112 </head> | 113 </head> |
| 113 | 114 |
| 114 <body onload="runTest()"> | 115 <body onload="runTest()"> |
| 115 <p> | 116 <p> |
| 116 Test that completions in the context of the call frame will result in names | 117 Test that completions in the context of the call frame will result in names |
| 117 of its scope variables. | 118 of its scope variables. |
| 118 </p> | 119 </p> |
| 119 </body> | 120 </body> |
| 120 </html> | 121 </html> |
| OLD | NEW |