| Index: LayoutTests/inspector/elements/styles/get-set-stylesheet-text.html
|
| diff --git a/LayoutTests/inspector/elements/styles/get-set-stylesheet-text.html b/LayoutTests/inspector/elements/styles/get-set-stylesheet-text.html
|
| deleted file mode 100644
|
| index ee42dd720b109fa58f096328c1a2332201f4c1ac..0000000000000000000000000000000000000000
|
| --- a/LayoutTests/inspector/elements/styles/get-set-stylesheet-text.html
|
| +++ /dev/null
|
| @@ -1,121 +0,0 @@
|
| -<html>
|
| -<head>
|
| -
|
| -<style>
|
| -
|
| -/* An inline stylesheet */
|
| -body.mainpage {
|
| - text-decoration: none;
|
| -}
|
| -</style>
|
| -
|
| -<link rel="stylesheet" href="resources/get-set-stylesheet-text.css">
|
| -
|
| -<script src="../../../http/tests/inspector/inspector-test.js"></script>
|
| -<script src="../../../http/tests/inspector/elements-test.js"></script>
|
| -<script>
|
| -
|
| -function test()
|
| -{
|
| - var foundStyleSheetHeader;
|
| - var foundStyleSheetText;
|
| -
|
| - findStyleSheet();
|
| -
|
| - function findStyleSheet()
|
| - {
|
| - var styleSheetHeaders = InspectorTest.cssModel.styleSheetHeaders();
|
| - for (var i = 0; i < styleSheetHeaders.length; ++i) {
|
| - styleSheetHeader = styleSheetHeaders[i];
|
| - if (styleSheetHeader.sourceURL.indexOf("get-set-stylesheet-text.css") >= 0) {
|
| - foundStyleSheetHeader = styleSheetHeader;
|
| - foundStyleSheetHeader.requestContent(callback);
|
| - }
|
| - if (!foundStyleSheetHeader)
|
| - InspectorTest.cssModel.addEventListener(WebInspector.CSSStyleModel.Events.StyleSheetAdded, styleSheetAdded);
|
| - }
|
| -
|
| - function callback(content)
|
| - {
|
| - foundStyleSheetText = content;
|
| - InspectorTest.runTestSuite([ testSetText, testNewElementStyles ]);
|
| - }
|
| -
|
| - function styleSheetAdded()
|
| - {
|
| - InspectorTest.cssModel.removeEventListener(WebInspector.CSSStyleModel.Events.StyleSheetAdded, styleSheetAdded);
|
| - findStyleSheet();
|
| - }
|
| - }
|
| -
|
| - function testSetText(next)
|
| - {
|
| - function callback(error)
|
| - {
|
| - if (error) {
|
| - InspectorTest.addResult("Failed to set stylesheet text: " + error);
|
| - return;
|
| - }
|
| - }
|
| -
|
| - InspectorTest.addResult("=== Original stylesheet text: ===");
|
| - InspectorTest.addResult(foundStyleSheetText);
|
| - InspectorTest.cssModel.addEventListener(WebInspector.CSSStyleModel.Events.StyleSheetChanged, next, this);
|
| - InspectorTest.cssModel.setStyleSheetText(foundStyleSheetHeader.id, "h1 { COLOR: Red; }", true, callback);
|
| - }
|
| -
|
| - function testNewElementStyles()
|
| - {
|
| - function callback(error, matchedCSSRules)
|
| - {
|
| - if (error) {
|
| - InspectorTest.addResult("error: " + error);
|
| - return;
|
| - }
|
| -
|
| - InspectorTest.addResult("=== Matched rules for h1 after setText() ===");
|
| - dumpMatchesArray(matchedCSSRules);
|
| - InspectorTest.completeTest();
|
| - }
|
| -
|
| - function nodeCallback(node)
|
| - {
|
| - InspectorTest.CSSAgent.getMatchedStylesForNode(node.id, true, true, callback);
|
| - }
|
| -
|
| - InspectorTest.selectNodeWithId("inspected", nodeCallback);
|
| - }
|
| -
|
| -
|
| - // Data dumping
|
| -
|
| - function dumpMatchesArray(rules)
|
| - {
|
| - if (!rules)
|
| - return;
|
| - for (var i = 0; i < rules.length; ++i)
|
| - dumpRuleOrStyle(rules[i].rule);
|
| - }
|
| -
|
| - function dumpRuleOrStyle(ruleOrStyle)
|
| - {
|
| - if (!ruleOrStyle)
|
| - return;
|
| - var isRule = !!(ruleOrStyle.style);
|
| - var style = isRule ? ruleOrStyle.style : ruleOrStyle;
|
| - InspectorTest.addResult("");
|
| - InspectorTest.addResult(isRule ? "rule" : "style");
|
| - InspectorTest.addResult((isRule ? (ruleOrStyle.selectorList.text + ": [" + ruleOrStyle.origin + "]") : "raw style"));
|
| - InspectorTest.dumpStyle(style);
|
| - }
|
| -}
|
| -</script>
|
| -</head>
|
| -
|
| -<body onload="runTest()">
|
| -<p>
|
| -Tests that WebInspector.CSSStyleSheet methods work as expected.
|
| -</p>
|
| -<h1 id="inspected">Inspect Me</h1>
|
| -</body>
|
| -</html>
|
|
|