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

Unified Diff: LayoutTests/inspector/debugger/source-url-comment.html

Issue 15832007: DevTools: Add support for //# sourceURL (sourceMappingURL) comments and deprecate //@ ones (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebaselined Created 7 years, 6 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
Index: LayoutTests/inspector/debugger/source-url-comment.html
diff --git a/LayoutTests/inspector/debugger/source-url-comment.html b/LayoutTests/inspector/debugger/source-url-comment.html
index 70bfcb223ec991d23f648af31cadfe18a42d5b0b..4366f51e9dfefde362f616dbb236d74071f38814 100644
--- a/LayoutTests/inspector/debugger/source-url-comment.html
+++ b/LayoutTests/inspector/debugger/source-url-comment.html
@@ -5,23 +5,28 @@
<script>
function keepAliveInInlineScript() { }
-//@ sourceURL=inlineScriptURL.js
+//# sourceURL=inlineScriptURL.js
</script>
<script>
function doEval()
{
- eval("function keepAlive() {}\n//@ sourceURL=evalURL.js");
+ eval("function keepAlive() {}\n//# sourceURL=evalURL.js");
+}
+
+function doDeprecatedEval()
+{
+ eval("function keepAlive() {}\n//@ sourceURL=deprecatedEvalURL.js");
}
function doEvalWithNonRelativeURL()
{
- eval("function relativeURLScript() {}\n//@ sourceURL=/js/nonRelativeURL.js");
+ eval("function relativeURLScript() {}\n//# sourceURL=/js/nonRelativeURL.js");
}
function doDynamicScript()
{
var scriptElement = document.createElement("script");
- scriptElement.textContent = "function keepAliveInDynamicScript() {}\n//@ sourceURL=dynamicScriptURL.js";
+ scriptElement.textContent = "function keepAliveInDynamicScript() {}\n//# sourceURL=dynamicScriptURL.js";
document.body.appendChild(scriptElement);
}
@@ -76,6 +81,24 @@ function test()
}
},
+ function testDeprecatedSourceURLComment(next)
+ {
+ InspectorTest.showScriptSource("deprecatedEvalURL.js", didShowScriptSource);
+ InspectorTest.evaluateInPage("setTimeout(doDeprecatedEval, 0)");
+
+ function didShowScriptSource(sourceFrame)
+ {
+ function checkScriptHasSourceURL(script)
+ {
+ InspectorTest.assertTrue(script.hasSourceURL, "hasSourceURL flag is not set for eval with sourceURL comment");
+ }
+
+ InspectorTest.addResult(sourceFrame.textEditor.text());
+ forEachScriptMatchingURL("deprecatedEvalURL.js", checkScriptHasSourceURL);
+ next();
+ }
+ },
+
function testSourceURLCommentInDynamicScript(next)
{
InspectorTest.showScriptSource("dynamicScriptURL.js", didShowScriptSource);

Powered by Google App Engine
This is Rietveld 408576698