Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../http/tests/inspector/debugger-test.js"></script> | 4 <script src="../../http/tests/inspector/debugger-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 | 6 |
| 7 var test = function() | 7 var test = function() |
| 8 { | 8 { |
| 9 const scriptSource = "239\n//# sourceURL=test.js"; | 9 const scriptSource = "239\n//# sourceURL=test.js"; |
| 10 const changedScriptSource = "42\n//# sourceURL=test.js"; | 10 const changedScriptSource = "42\n//# sourceURL=test.js"; |
| 11 | 11 |
| 12 InspectorTest.startDebuggerTest(step1); | 12 InspectorTest.startDebuggerTest(step1); |
| 13 | 13 |
| 14 function step1() | 14 function step1() |
| 15 { | 15 { |
| 16 InspectorTest.waitForScriptSource("test.js", step2); | 16 InspectorTest.waitForScriptSource("test.js", step2); |
| 17 InspectorTest.evaluateInPage(scriptSource); | 17 InspectorTest.evaluateInPage(scriptSource); |
| 18 } | 18 } |
| 19 | 19 |
| 20 function step2(uiSourceCode) | 20 function step2(uiSourceCode) |
| 21 { | 21 { |
| 22 InspectorTest.addSnifferPromise(Bindings.ResourceScriptFile.prototype, " _mappingCheckedForTest").then(() => step3(uiSourceCode)); | 22 InspectorTest.addSnifferPromise(Bindings.ResourceScriptFile.prototype, " _mappingCheckedForTest").then(() => step3(uiSourceCode)); |
| 23 InspectorTest.showScriptSource("test.js"); | 23 InspectorTest.showScriptSource("test.js"); |
| 24 } | 24 } |
| 25 | 25 |
| 26 function step3(uiSourceCode) | 26 function step3(uiSourceCode) |
| 27 { | 27 { |
| 28 var mainTarget = SDK.targetManager.mainTarget(); | 28 var mainTarget = SDK.targetManager.mainTarget(); |
|
caseq
2017/03/17 18:30:43
ditto.
dgozman
2017/03/17 21:43:46
Done.
| |
| 29 var debuggerModel = SDK.DebuggerModel.fromTarget(mainTarget); | 29 var debuggerModel = InspectorTest.debuggerModel; |
| 30 var scriptFile = Bindings.debuggerWorkspaceBinding.scriptFile(uiSourceCo de, debuggerModel); | 30 var scriptFile = Bindings.debuggerWorkspaceBinding.scriptFile(uiSourceCo de, debuggerModel); |
| 31 if (!scriptFile) { | 31 if (!scriptFile) { |
| 32 InspectorTest.addResult("[FAIL]: no script file for test.js"); | 32 InspectorTest.addResult("[FAIL]: no script file for test.js"); |
| 33 InspectorTest.completeDebuggerTest(); | 33 InspectorTest.completeDebuggerTest(); |
| 34 return; | 34 return; |
| 35 } | 35 } |
| 36 if (scriptFile.hasDivergedFromVM() || scriptFile.isDivergingFromVM()) { | 36 if (scriptFile.hasDivergedFromVM() || scriptFile.isDivergingFromVM()) { |
| 37 InspectorTest.addResult("[FAIL]: script file is diverged from VM"); | 37 InspectorTest.addResult("[FAIL]: script file is diverged from VM"); |
| 38 InspectorTest.completeDebuggerTest(); | 38 InspectorTest.completeDebuggerTest(); |
| 39 return; | 39 return; |
| 40 } | 40 } |
| 41 | 41 |
| 42 InspectorTest.addSnifferPromise(Sources.JavaScriptSourceFrame.prototype, "_didDivergeFromVM").then(dumpDivergeFromVM); | 42 InspectorTest.addSnifferPromise(Sources.JavaScriptSourceFrame.prototype, "_didDivergeFromVM").then(dumpDivergeFromVM); |
| 43 InspectorTest.addSnifferPromise(Bindings.ResourceScriptFile.prototype, " _mappingCheckedForTest").then(() => InspectorTest.completeDebuggerTest()); | 43 InspectorTest.addSnifferPromise(Bindings.ResourceScriptFile.prototype, " _mappingCheckedForTest").then(() => InspectorTest.completeDebuggerTest()); |
| 44 InspectorTest.evaluateInPage(changedScriptSource); | 44 InspectorTest.evaluateInPage(changedScriptSource); |
| 45 } | 45 } |
| 46 | 46 |
| 47 function dumpDivergeFromVM() | 47 function dumpDivergeFromVM() |
| 48 { | 48 { |
| 49 InspectorTest.addResult("[FAIL]: script file was diverged from VM"); | 49 InspectorTest.addResult("[FAIL]: script file was diverged from VM"); |
| 50 } | 50 } |
| 51 } | 51 } |
| 52 </script> | 52 </script> |
| 53 </head> | 53 </head> |
| 54 <body onload="runTest()"> | 54 <body onload="runTest()"> |
| 55 <p>Checks that script evaluated twice with different source and the same sourceU RL won't be diverged from VM.</p> | 55 <p>Checks that script evaluated twice with different source and the same sourceU RL won't be diverged from VM.</p> |
| 56 </body> | 56 </body> |
| 57 </html> | 57 </html> |
| OLD | NEW |