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

Unified Diff: LayoutTests/inspector/elements/styles/styles-history.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/styles-history.html
diff --git a/LayoutTests/inspector/elements/styles/styles-history.html b/LayoutTests/inspector/elements/styles/styles-history.html
deleted file mode 100644
index 961f4b4e09d08654e19dcc80a4f2bbc1feefc212..0000000000000000000000000000000000000000
--- a/LayoutTests/inspector/elements/styles/styles-history.html
+++ /dev/null
@@ -1,137 +0,0 @@
-<html>
-<head>
-
-<link rel="stylesheet" href="resources/styles-history.css">
-
-<script src="../../../http/tests/inspector/inspector-test.js"></script>
-<script src="../../../http/tests/inspector/elements-test.js"></script>
-<script src="../../../http/tests/inspector/resources-test.js"></script>
-<script src="styles-test.js"></script>
-<script>
-
-function test()
-{
- InspectorTest.runAfterCachedResourcesProcessed(runTestSuite);
-
- var uiSourceCode;
-
- function runTestSuite()
- {
- InspectorTest.runTestSuite([
- function testSetUp(next)
- {
- function visitUISourceCodes(currentUISourceCode)
- {
- if (currentUISourceCode.originURL().indexOf("styles-history.css") === -1)
- return;
- uiSourceCode = currentUISourceCode;
- next();
- }
- WebInspector.workspace.uiSourceCodes().forEach(visitUISourceCodes);
- },
-
- function testSetResourceContentMinor(next)
- {
- InspectorTest.addSniffer(WebInspector.StyleFile.prototype, "_styleContentSet", styleUpdatedMinor);
- uiSourceCode.setWorkingCopy("body {\n margin: 15px;\n padding: 10px;\n}");
-
- function styleUpdatedMinor()
- {
- dumpHistory(next)();
- }
- },
-
- function testSetResourceContentMajor(next)
- {
- InspectorTest.addSniffer(WebInspector.StyleFile.prototype, "_styleContentSet", styleUpdatedMinor);
- uiSourceCode.setWorkingCopy("body {\n margin: 20px;\n padding: 10px;\n}");
-
- function styleUpdatedMinor()
- {
- InspectorTest.addSniffer(WebInspector.StyleFile.prototype, "_styleContentSet", styleUpdatedMajor);
- uiSourceCode.commitWorkingCopy(function() { });
-
- function styleUpdatedMajor()
- {
- dumpHistory(next)();
- }
- }
- },
-
- function testSetContentViaModelMinor(next)
- {
- styleSheetForResource(step1);
-
- function step1(style)
- {
- var property = style.getLiveProperty("margin");
- property.setText("margin:25px;", false, true, dumpHistory(next));
- }
- },
-
- function testSetContentViaModelMajor(next)
- {
- styleSheetForResource(step1);
-
- function step1(style)
- {
- var property = style.getLiveProperty("margin");
- property.setText("margin:30px;", true, true);
- InspectorTest.runAfterPendingDispatches(dumpHistory(next));
- }
- }
- ]);
- }
-
- function styleSheetForResource(callback)
- {
- InspectorTest.nodeWithId("mainBody", onNodeSelected);
-
- function onNodeSelected(node)
- {
- InspectorTest.CSSAgent.getMatchedStylesForNode(node.id, true, true, onMatchedStylesForNode);
- }
-
- function onMatchedStylesForNode(error, matchedStyles)
- {
- if (error) {
- InspectorTest.addResult("error: " + error);
- InspectorTest.completeTest();
- return;
- }
- for (var i = 0; i < matchedStyles.length; ++i) {
- var rule = matchedStyles[i].rule;
- if (rule.origin !== "regular")
- continue;
- callback(WebInspector.CSSStyleDeclaration.parsePayload(InspectorTest.cssModel, rule.style));
- return;
- }
- InspectorTest.addResult("error: did not find any regular rule");
- InspectorTest.completeTest();
- }
- }
-
- function dumpHistory(next)
- {
- function result()
- {
- InspectorTest.addResult("History length: " + uiSourceCode.history.length);
- for (var i = 0; i < uiSourceCode.history.length; ++i) {
- InspectorTest.addResult("Item " + i + ":");
- InspectorTest.addResult(uiSourceCode.history[i].content);
- }
- next();
- }
- return result;
- }
-}
-
-</script>
-</head>
-
-<body id="mainBody" onload="runTest()">
-<p>
-Tests resources panel history.
-</p>
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698