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

Unified Diff: LayoutTests/inspector/sources/debugger/debugger-script-preprocessor.html

Issue 761143003: DevTools: remove ScriptPreprocessor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 5 years, 10 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/sources/debugger/debugger-script-preprocessor.html
diff --git a/LayoutTests/inspector/sources/debugger/debugger-script-preprocessor.html b/LayoutTests/inspector/sources/debugger/debugger-script-preprocessor.html
deleted file mode 100644
index a3546a78de98641635cc7245ecd9571ffe8b8e93..0000000000000000000000000000000000000000
--- a/LayoutTests/inspector/sources/debugger/debugger-script-preprocessor.html
+++ /dev/null
@@ -1,99 +0,0 @@
-<html>
-<head>
-<script src="../../../http/tests/inspector/inspector-test.js"></script>
-<script src="../../../http/tests/inspector/debugger-test.js"></script>
-<script src="resources/script1.js"></script>
-<script>
-
-function load()
-{
- eval("function dynamic" + "Script1() {}");
- eval("function dynamic" + "Script2() {}");
- eval("function dynamic" + "RuntimeError() {}");
- runTest();
-}
-
-function test()
-{
- function preprocessor(script, url, functionName)
- {
- function makeResponse(script, msg, url) {
- // write into the console to verify that no internal scripts are preprocessed.
- return script + ';\nconsole.log(\"' + msg + '\");\n//# sourceURL=' + url;
- }
- if (script.indexOf("dynamic" + "Script1") !== -1)
- return makeResponse(script, 'eval works', "dynamic"+"Script1");
- if (script.indexOf("dynamic" + "Script2") !== -1) {
- try {
- var w = eval("window.location.href");
- return makeResponse(script, 'verify href: ' + w, "dynamic"+"Script2");
- } catch (e) {
- return makeResponse(script, 'Did not find window href', "dynamic"+"Script2");
- }
- }
- if (script.indexOf("dynamic" + "RuntimeError") !== -1) {
- throw new Error("fake internal preprocessor error");
- }
- if (!this.String) {
- throw new Error("preprocessor environment is missing built-ins");
- }
- // Do not report tests/inspector files, their line numbers may change.
- if(/-test.js/.test(url))
- return script;
- // Verify functionName argument for DOM event handlers.
- if (functionName)
- url += '_' + functionName;
- // Verify that the |url| argument is correct.
- url = url.replace(/\.html/, '_html') + '.js';
- return makeResponse(script, 'preprocessed ' + url, url);
- }
-
- var failingPreprocessor = "(function() {throw new Error(\"failingPreprocessor throws\");}())"
- var syntaxError = "(function preprocessor(script, url) {\nsyntax error\n}\n)";
-
- InspectorTest.startDebuggerTest(step1);
-
- function step1()
- {
- InspectorTest.reloadPage(step2, undefined, "(" + preprocessor + ")");
- }
-
- function step2()
- {
- function accept(script)
- {
- return !!script.sourceURL;
- }
- var scripts = InspectorTest.queryScripts(accept);
- for (var i = 0; i < scripts.length; ++i)
- InspectorTest.addResult("sourceURLs[" + i +"]=" + WebInspector.displayNameForURL(scripts[i].sourceURL));
-
- InspectorTest.reloadPage(step3, undefined, "(" + failingPreprocessor + ")");
- }
-
- function step3()
- {
- InspectorTest.reloadPage(step4, undefined, "var notAFunctionOrSyntaxError;");
- }
-
- function step4()
- {
- InspectorTest.reloadPage(step5, undefined, syntaxError);
- }
-
- function step5()
- {
- InspectorTest.reloadPage(InspectorTest.completeDebuggerTest.bind(InspectorTest));
- }
-}
-
-</script>
-</head>
-
-<body onload="load()">
-<p>
-Tests script preprocessor (ability to preprocess all scripts upon reload).
-</p>
-
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698