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

Side by Side Diff: LayoutTests/inspector/extensions/extensions-reload.html

Issue 23514035: Add preprocessor to reloadOptions in chrome.devtools.inspectedWindow.reload(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 7 years, 3 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
« no previous file with comments | « no previous file | LayoutTests/inspector/extensions/extensions-reload-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/extensions-test.js"></script> 5 <script src="../../http/tests/inspector/extensions-test.js"></script>
5 <script type="text/javascript"> 6 <script type="text/javascript">
6 7
7 window.bar = "foo = " + window.foo; 8 window.bar = "foo = " + window.foo;
8 9
9 function extension_testReloadInjectsCode(nextTest) 10 function extension_testReloadInjectsCode(nextTest)
10 { 11 {
11 var valueWithInjectedCode; 12 var valueWithInjectedCode;
12 13
13 function onPageWithInjectedCodeLoaded() 14 function onPageWithInjectedCodeLoaded()
(...skipping 11 matching lines...) Expand all
25 output("Without injected code: " + value); 26 output("Without injected code: " + value);
26 nextTest(); 27 nextTest();
27 }); 28 });
28 } 29 }
29 evaluateOnFrontend("InspectorTest.runWhenPageLoads(reply)", onPageWithInject edCodeLoaded); 30 evaluateOnFrontend("InspectorTest.runWhenPageLoads(reply)", onPageWithInject edCodeLoaded);
30 webInspector.inspectedWindow.reload({ 31 webInspector.inspectedWindow.reload({
31 injectedScript: "window.foo = 42;" 32 injectedScript: "window.foo = 42;"
32 }); 33 });
33 } 34 }
34 35
36 function extension_testReloadPreprocessesCode(nextTest)
37 {
38 var valueWithPreprocessedCode;
39 function onPageWithPreprocessedCodeLoaded()
40 {
41 webInspector.inspectedWindow.eval("window.__preprocessed", function(valu e) {
42 valueWithPreprocessedCode = value;
43 evaluateOnFrontend("InspectorTest.runWhenPageLoads(reply)", onPageWi thoutPreprocessedCodeLoaded);
44 webInspector.inspectedWindow.reload({ });
45 });
46 }
47 function onPageWithoutPreprocessedCodeLoaded()
48 {
49 webInspector.inspectedWindow.eval("window.__preprocessed", function(valu e) {
50 output("With preprocessor:\n" + valueWithPreprocessedCode.map(functi on(url) { return url.split('/').pop(); }).join("\n"));
51 output("Without preprocessor: " + value);
52 nextTest();
53 });
54 }
55
56 evaluateOnFrontend("InspectorTest.runWhenPageLoads(reply)", onPageWithPrepro cessedCodeLoaded);
57 function preprocessor(src, url, fName)
58 {
59 var surl = url + (fName ? '_' + fName : '') + '.js';
60 return src + '\nwindow.__preprocessed.push(\"' + surl + '\");\n'+ '//@ s ourceURL=' + surl;
61 }
62 webInspector.inspectedWindow.reload({
63 injectedScript: "window.__preprocessed = [];",
64 preprocessingScript: "(" + preprocessor +")"
65 });
66 }
67
35 </script> 68 </script>
36 </head> 69 </head>
37 <body onload="runTest()"> 70 <body onload="runTest()">
38 <p>Tests that webInspector.inspectedWindow.reload() successfully injects user's code upon reload</p> 71 <p>Tests that webInspector.inspectedWindow.reload() successfully injects and pre processes user's code upon reload</p>
39 </body> 72 </body>
40 </html> 73 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/inspector/extensions/extensions-reload-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698