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

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: addressed comments 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..70b75a017343c03ef7791682f184e2d3b7c71330
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector/sources/dont-diverge-script-evaluated-twice.html
@@ -0,0 +1,56 @@
+<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();
+ return;
+ }
+ if (scriptFile.hasDivergedFromVM() || scriptFile.isDivergingFromVM()) {
+ InspectorTest.addResult("[FAIL]: script file is diverged from VM");
+ InspectorTest.completeDebuggerTest();
+ return;
+ }
+
+ 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