| 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>
|
|
|