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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/inspector/sources/dont-diverge-script-evaluated-twice.html
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/dont-diverge-script-evaluated-twice.html b/third_party/WebKit/LayoutTests/inspector/sources/dont-diverge-script-evaluated-twice.html
new file mode 100644
index 0000000000000000000000000000000000000000..4fe4be73a9f5294eaa8666b1e404c1f9e5147ba7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector/sources/dont-diverge-script-evaluated-twice.html
@@ -0,0 +1,55 @@
+<html>
+<head>
+<script src="../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../http/tests/inspector/debugger-test.js"></script>
+<script>
+
+var test = function()
+{
+ const scriptSource = "239\n//# sourceURL=test.js";
+ const changedScriptSource = "42\n//# sourceURL=test.js";
+
+ InspectorTest.startDebuggerTest(step1);
+
+ function step1()
+ {
+ InspectorTest.waitForScriptSource("test.js", step2);
+ InspectorTest.evaluateInPage(scriptSource);
+ }
+
+ function step2(uiSourceCode)
+ {
+ InspectorTest.addSnifferPromise(WebInspector.ResourceScriptFile.prototype, "_mappingCheckedForTest").then(() => step3(uiSourceCode));
+ InspectorTest.showScriptSource("test.js");
+ }
+
+ function step3(uiSourceCode)
+ {
+ var mainTarget = WebInspector.targetManager.mainTarget();
+ var scriptFile = WebInspector.debuggerWorkspaceBinding.scriptFile(uiSourceCode, mainTarget);
+ if (!scriptFile) {
+ InspectorTest.addResult("[FAIL]: no script file for test.js");
+ InspectorTest.completeDebuggerTest();
lushnikov 2016/10/03 20:07:53 return;
kozy 2016/10/03 20:45:18 Done.
+ }
+ if (scriptFile.hasDivergedFromVM() || scriptFile.isDivergingFromVM()) {
+ InspectorTest.addResult("[FAIL]: script file is diverged from VM");
+ InspectorTest.completeDebuggerTest();
+ }
+
+ scriptFile.addEventListener(WebInspector.ResourceScriptFile.Events.DidDivergeFromVM, 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.
+ InspectorTest.addSnifferPromise(WebInspector.JavaScriptSourceFrame.prototype, "_didDivergeFromVM").then(dumpDivergeFromVM);
+ InspectorTest.addSnifferPromise(WebInspector.ResourceScriptFile.prototype, "_mappingCheckedForTest").then(() => InspectorTest.completeDebuggerTest());
+ InspectorTest.evaluateInPage(changedScriptSource);
+ }
+
+ function dumpDivergeFromVM()
+ {
+ InspectorTest.addResult("[FAIL]: script file was diverged from VM");
+ }
+}
+</script>
+</head>
+<body onload="runTest()">
+<p>Checks that script evaluated twice with different source and the same sourceURL won't be diverged from VM.</p>
+</body>
+</html>
« 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