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

Side by Side Diff: LayoutTests/inspector/debugger/debugger-script-preprocessor.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script> 3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/debugger-test.js"></script> 4 <script src="../../http/tests/inspector/debugger-test.js"></script>
5 <script> 5 <script>
6 6
7 function load() 7 function load()
8 { 8 {
9 eval("function dynamic" + "Script1() {}"); 9 eval("function dynamic" + "Script1() {}");
10 eval("function dynamic" + "Script2() {}"); 10 eval("function dynamic" + "Script2() {}");
11 runTest(); 11 runTest();
12 } 12 }
13 13
14 function test() 14 function test()
15 { 15 {
16 function preprocessor(script, name) 16 function preprocessor(script, name)
17 { 17 {
18 if (script.indexOf("dynamic" + "Script1") !== -1) 18 if (script.indexOf("dynamic" + "Script1") !== -1)
19 return script + "//@ sourceURL=dynamicScript1"; 19 return script + "//# sourceURL=dynamicScript1";
20 if (script.indexOf("dynamic" + "Script2") !== -1) { 20 if (script.indexOf("dynamic" + "Script2") !== -1) {
21 try { 21 try {
22 var w = eval("window"); 22 var w = eval("window");
23 return script + "//@ sourceURL=FAIL_window_should_not_be_there"; 23 return script + "//# sourceURL=FAIL_window_should_not_be_there";
24 } catch (e) { 24 } catch (e) {
25 return script + "//@ sourceURL=dynamicScript2"; 25 return script + "//# sourceURL=dynamicScript2";
26 } 26 }
27 } 27 }
28 // Verify that the |name| argument is correct. Note: if name is not pass ed in 28 // Verify that the |name| argument is correct. Note: if name is not pass ed in
29 // the results will be a script with a sourceURL equal to the original f ile name. 29 // the results will be a script with a sourceURL equal to the original f ile name.
30 return script + "//@ sourceURL=" + name + ".js"; 30 return script + "//# sourceURL=" + name + ".js";
31 } 31 }
32 32
33 InspectorTest.startDebuggerTest(step1); 33 InspectorTest.startDebuggerTest(step1);
34 34
35 function step1() 35 function step1()
36 { 36 {
37 InspectorTest.reloadPage(step2, undefined, "(" + preprocessor + ")"); 37 InspectorTest.reloadPage(step2, undefined, "(" + preprocessor + ")");
38 } 38 }
39 39
40 function step2() 40 function step2()
(...skipping 13 matching lines...) Expand all
54 </script> 54 </script>
55 </head> 55 </head>
56 56
57 <body onload="load()"> 57 <body onload="load()">
58 <p> 58 <p>
59 Tests script preprocessor (ability to preprocess all scripts upon reload). 59 Tests script preprocessor (ability to preprocess all scripts upon reload).
60 </p> 60 </p>
61 61
62 </body> 62 </body>
63 </html> 63 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698