Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/sources/dont-diverge-script-evaluated-twice.html

Issue 2384953002: [DevTools] Fixed breakpoints in hotreloaded scripts (Closed)
Patch Set: added a test Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/sources/dont-diverge-script-evaluated-twice-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/debugger-test.js"></script>
5 <script>
6
7 var test = function()
8 {
9 const scriptSource = "239\n//# sourceURL=test.js";
10 const changedScriptSource = "42\n//# sourceURL=test.js";
11
12 InspectorTest.startDebuggerTest(step1);
13
14 function step1()
15 {
16 InspectorTest.waitForScriptSource("test.js", step2);
17 InspectorTest.evaluateInPage(scriptSource);
18 }
19
20 function step2(uiSourceCode)
21 {
22 InspectorTest.addSnifferPromise(WebInspector.ResourceScriptFile.prototyp e, "_mappingCheckedForTest").then(() => step3(uiSourceCode));
23 InspectorTest.showScriptSource("test.js");
24 }
25
26 function step3(uiSourceCode)
27 {
28 var mainTarget = WebInspector.targetManager.mainTarget();
29 var scriptFile = WebInspector.debuggerWorkspaceBinding.scriptFile(uiSour ceCode, mainTarget);
30 if (!scriptFile) {
31 InspectorTest.addResult("[FAIL]: no script file for test.js");
32 InspectorTest.completeDebuggerTest();
lushnikov 2016/10/03 20:07:53 return;
kozy 2016/10/03 20:45:18 Done.
33 }
34 if (scriptFile.hasDivergedFromVM() || scriptFile.isDivergingFromVM()) {
35 InspectorTest.addResult("[FAIL]: script file is diverged from VM");
36 InspectorTest.completeDebuggerTest();
37 }
38
39 scriptFile.addEventListener(WebInspector.ResourceScriptFile.Events.DidDi vergeFromVM, dumpDivergeFromVM, this);
lushnikov 2016/10/03 20:07:53 scriptFile is a new one; this won't fire
kozy 2016/10/03 20:45:18 Done.
40 InspectorTest.addSnifferPromise(WebInspector.JavaScriptSourceFrame.proto type, "_didDivergeFromVM").then(dumpDivergeFromVM);
41 InspectorTest.addSnifferPromise(WebInspector.ResourceScriptFile.prototyp e, "_mappingCheckedForTest").then(() => InspectorTest.completeDebuggerTest());
42 InspectorTest.evaluateInPage(changedScriptSource);
43 }
44
45 function dumpDivergeFromVM()
46 {
47 InspectorTest.addResult("[FAIL]: script file was diverged from VM");
48 }
49 }
50 </script>
51 </head>
52 <body onload="runTest()">
53 <p>Checks that script evaluated twice with different source and the same sourceU RL won't be diverged from VM.</p>
54 </body>
55 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/sources/dont-diverge-script-evaluated-twice-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698