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

Unified Diff: third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/scripts-with-same-source-url.html

Issue 1409223006: DevTools: replace content provider when re-adding into network project (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Same with isLiveEdit flag in a scriptParsed. Created 5 years, 1 month 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
Index: third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/scripts-with-same-source-url.html
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/scripts-with-same-source-url.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/scripts-with-same-source-url.html
new file mode 100644
index 0000000000000000000000000000000000000000..d122d517dd62d689b0a0e591edb0ae4e48a56456
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/scripts-with-same-source-url.html
@@ -0,0 +1,52 @@
+<html>
+<head>
+<script src="../../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../../http/tests/inspector/debugger-test.js"></script>
+<script>
+function injectScript(value)
+{
+ eval("function foo() { return " + value + "; } //# sourceURL=MyScript.js");
+}
+
+function test()
+{
+ InspectorTest.evaluateInPage("injectScript(1);");
+ InspectorTest.evaluateInPage("injectScript(2);");
+
+ WebInspector.workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeAdded, reportAdded);
+ WebInspector.workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeRemoved, reportRemoved);
+
+ var iteration = 0;
+
+ function reportAdded(event)
+ {
+ if (event.data.originURL() !== "MyScript.js")
+ return;
+ InspectorTest.addResult("Added: " + event.data.originURL() + " to " + event.data.project().type());
+ if (event.data.project().type() !== "network")
+ return;
+ event.data.requestContent(function(it, content) {
+ InspectorTest.addResult("Content: " + content);
+ if (it)
+ InspectorTest.completeTest();
+ }.bind(null, iteration++));
+ }
+
+ function reportRemoved(event)
+ {
+ if (event.data.originURL() !== "MyScript.js")
+ return;
+ InspectorTest.addResult("Removed: " + event.data.originURL() + " from " + event.data.project().type());
+ }
+}
+
+</script>
+</head>
+
+<body onload="runTest()">
+<p>
+Tests that script is replaced with the newer version when the names match.
+</p>
+
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698