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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/inspector/extensions/extensions-reload-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/inspector/extensions/extensions-reload.html
diff --git a/LayoutTests/inspector/extensions/extensions-reload.html b/LayoutTests/inspector/extensions/extensions-reload.html
index 55d0a7f8a0ba1eeeaca73282d2699e6bea9f381e..a118d055094a6e216e0e5f4000231a685d558cf1 100644
--- a/LayoutTests/inspector/extensions/extensions-reload.html
+++ b/LayoutTests/inspector/extensions/extensions-reload.html
@@ -1,6 +1,7 @@
<html>
<head>
<script src="../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../http/tests/inspector/debugger-test.js"></script>
<script src="../../http/tests/inspector/extensions-test.js"></script>
<script type="text/javascript">
@@ -32,9 +33,41 @@ function extension_testReloadInjectsCode(nextTest)
});
}
+function extension_testReloadPreprocessesCode(nextTest)
+{
+ var valueWithPreprocessedCode;
+ function onPageWithPreprocessedCodeLoaded()
+ {
+ webInspector.inspectedWindow.eval("window.__preprocessed", function(value) {
+ valueWithPreprocessedCode = value;
+ evaluateOnFrontend("InspectorTest.runWhenPageLoads(reply)", onPageWithoutPreprocessedCodeLoaded);
+ webInspector.inspectedWindow.reload({ });
+ });
+ }
+ function onPageWithoutPreprocessedCodeLoaded()
+ {
+ webInspector.inspectedWindow.eval("window.__preprocessed", function(value) {
+ output("With preprocessor:\n" + valueWithPreprocessedCode.map(function(url) { return url.split('/').pop(); }).join("\n"));
+ output("Without preprocessor: " + value);
+ nextTest();
+ });
+ }
+
+ evaluateOnFrontend("InspectorTest.runWhenPageLoads(reply)", onPageWithPreprocessedCodeLoaded);
+ function preprocessor(src, url, fName)
+ {
+ var surl = url + (fName ? '_' + fName : '') + '.js';
+ return src + '\nwindow.__preprocessed.push(\"' + surl + '\");\n'+ '//@ sourceURL=' + surl;
+ }
+ webInspector.inspectedWindow.reload({
+ injectedScript: "window.__preprocessed = [];",
+ preprocessingScript: "(" + preprocessor +")"
+ });
+}
+
</script>
</head>
<body onload="runTest()">
-<p>Tests that webInspector.inspectedWindow.reload() successfully injects user's code upon reload</p>
+<p>Tests that webInspector.inspectedWindow.reload() successfully injects and preprocesses user's code upon reload</p>
</body>
</html>
« 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