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

Unified Diff: LayoutTests/inspector/elements/styles/add-new-rule-inline-style-csp.html

Issue 1158883003: DevTools: shard inspector/elements tests for faster execution. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 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/elements/styles/add-new-rule-inline-style-csp.html
diff --git a/LayoutTests/inspector/elements/styles/add-new-rule-inline-style-csp.html b/LayoutTests/inspector/elements/styles/add-new-rule-inline-style-csp.html
deleted file mode 100644
index 9ae897950ae5117947b0525e22fb595304c56e6a..0000000000000000000000000000000000000000
--- a/LayoutTests/inspector/elements/styles/add-new-rule-inline-style-csp.html
+++ /dev/null
@@ -1,120 +0,0 @@
-<html>
-<head>
-<meta http-equiv="Content-Security-Policy" content="style-src https://*:443 'unsafe-eval'">
-<script src="../../../http/tests/inspector/inspector-test.js"></script>
-<script src="../../../http/tests/inspector/elements-test.js"></script>
-<script>
-
-function test()
-{
- var nodeId;
- var rule;
-
-
- InspectorTest.runTestSuite([
- function testSetUp(next) {
- InspectorTest.selectNodeAndWaitForStyles("inspected", next);
- },
-
- function testAddRule(next)
- {
- InspectorTest.nodeWithId("inspected", nodeCallback);
-
- function nodeCallback(node)
- {
- nodeId = node.id;
- InspectorTest.addNewRule("#inspected", successCallback);
- }
-
- function successCallback(section)
- {
- rule = section.styleRule.rule();
- InspectorTest.addResult("=== Rule added ===");
- InspectorTest.addResult(rule.selectorText + " {" + rule.style.cssText + "}");
- InspectorTest.addResult("Selectors matching the (#inspected) node: " + InspectorTest.matchingSelectors(rule));
- next();
- }
- },
-
- function testAddProperty(next)
- {
- rule.style.appendProperty("width", "100%", callback);
-
- function callback(newStyle)
- {
- InspectorTest.addResult("=== Added rule modified ===");
- if (!newStyle) {
- InspectorTest.addResult("[!] No valid rule style received");
- InspectorTest.completeTest();
- } else {
- dumpProperties(newStyle);
- InspectorTest.cssModel.setRuleSelector(rule, nodeId, "body", successCallback, failureCallback);
- }
- }
-
- function successCallback(rule)
- {
- var doesAffectSelectedNode = rule.matchingSelectors.length > 0;
- InspectorTest.addResult("=== Selector changed ===");
- InspectorTest.addResult(rule.selectorText + " {" + rule.style.cssText + "}");
- InspectorTest.addResult("Selectors matching the (#inspected) node: " + InspectorTest.matchingSelectors(rule));
-
- next();
- }
-
- function failureCallback()
- {
- InspectorTest.addResult("[!] Failed to change selector");
- InspectorTest.completeTest();
- }
- },
-
- function testModifyInlineStyle(next)
- {
- InspectorTest.cssModel.getInlineStylesAsync(nodeId, stylesCallback);
-
- function stylesCallback(inlineStyle)
- {
- if (!inlineStyle) {
- InspectorTest.completeTest();
- return;
- }
- inlineStyle.appendProperty("font-size", "14px", appendCallback);
- }
-
- function appendCallback(newStyle)
- {
- InspectorTest.addResult("=== Inline style modified ===");
- if (!newStyle) {
- InspectorTest.addResult("No valid inline style received");
- InspectorTest.completeTest();
- return;
- }
-
- dumpProperties(newStyle);
- next();
- }
- }
- ]);
-
- function dumpProperties(style)
- {
- if (!style)
- return;
- var allProperties = style.allProperties;
- for (var i = 0; i < allProperties.length; ++i)
- InspectorTest.addResult(allProperties[i].text);
- }
-}
-</script>
-</head>
-
-<body onload="runTest()">
-<p>
-Tests that adding a new rule does not crash the renderer and modifying an inline style does not report errors when forbidden by Content-Security-Policy.
-</p>
-
-<div id="inspected">Text</div>
-
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698