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

Unified Diff: third_party/WebKit/LayoutTests/inspector-protocol/debugger/resources/script-blocked-by-csp.js

Issue 2968523003: [DevTools] Migrate inspector-protocol/debugger tests to new harness (Closed)
Patch Set: all tests Created 3 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: third_party/WebKit/LayoutTests/inspector-protocol/debugger/resources/script-blocked-by-csp.js
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/debugger/resources/script-blocked-by-csp.js b/third_party/WebKit/LayoutTests/inspector-protocol/debugger/resources/script-blocked-by-csp.js
deleted file mode 100644
index 31a5ce5c72109d80831cd62d583dc7b9bdf873df..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/inspector-protocol/debugger/resources/script-blocked-by-csp.js
+++ /dev/null
@@ -1,50 +0,0 @@
-function test()
-{
- InspectorTest.sendCommand("Debugger.enable", {});
- InspectorTest.sendCommand("DOM.enable", {});
- InspectorTest.sendCommand("DOMDebugger.enable", {});
- InspectorTest.sendCommand("DOMDebugger.setInstrumentationBreakpoint", {"eventName":"scriptBlockedByCSP"});
- InspectorTest.eventHandler["Debugger.paused"] = handleDebuggerPaused;
-
- var expressions = [
- "\n document.getElementById('testButton').click();",
-
- "\n var script = document.createElement('script');" +
- "\n script.innerText = 'alert(1)';" +
- "\n document.body.appendChild(script);",
-
- "\n var a = document.createElement('a');" +
- "\n a.setAttribute('href', 'javascript:alert(1);');" +
- "\n var dummy = 1; " +
- "\n document.body.appendChild(a); a.click();"
- ];
- var descriptions = [
- "blockedEventHandler",
- "blockedScriptInjection",
- "blockedScriptUrl"
- ];
-
- function nextExpression()
- {
- if (!expressions.length) {
- InspectorTest.completeTest();
- return;
- }
- var description = descriptions.shift();
- InspectorTest.log("\n-------\n" + description);
- InspectorTest.sendCommand("Runtime.evaluate", { "expression": "function " + description + "() {" + expressions.shift() + "}\n" + description + "()"});
- }
-
- function handleDebuggerPaused(messageObject)
- {
- var params = messageObject.params;
- InspectorTest.log("Paused at: " + params.callFrames[0].functionName + "@" + params.callFrames[0].location.lineNumber);
- InspectorTest.log("Reason: " + params.reason + "; Data:");
- InspectorTest.logObject(params.data);
- InspectorTest.sendCommand("Debugger.resume", { }, nextExpression);
- }
-
- nextExpression();
-}
-
-window.addEventListener("load", runTest.bind(null, false));

Powered by Google App Engine
This is Rietveld 408576698