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

Unified Diff: LayoutTests/inspector/elements/styles/dynamic-style-tag.html

Issue 201363002: DevTools: defer styles delta calculation to until the end of the task. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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/dynamic-style-tag.html
diff --git a/LayoutTests/inspector/elements/styles/dynamic-style-tag.html b/LayoutTests/inspector/elements/styles/dynamic-style-tag.html
index e893ea052177c6d34faf734b893db2d738476d95..0b858edbfb50dda93b47f1f604b7358379410e14 100644
--- a/LayoutTests/inspector/elements/styles/dynamic-style-tag.html
+++ b/LayoutTests/inspector/elements/styles/dynamic-style-tag.html
@@ -30,6 +30,7 @@ var test = function()
{
WebInspector.cssModel.addEventListener(WebInspector.CSSStyleModel.Events.StyleSheetAdded, styleSheetAdded);
InspectorTest.reloadPage(step1);
+ var styleSheets = [];
function pathToFileName(path)
{
@@ -40,30 +41,30 @@ var test = function()
{
InspectorTest.selectNodeAndWaitForStyles("inspected", step2);
}
-
+
function step2()
{
+ styleSheets.sort();
+ for (var i = 0; i < styleSheets.length; ++i)
+ InspectorTest.addResult(styleSheets[i]);
InspectorTest.dumpSelectedElementStyles(true, false, true);
InspectorTest.completeTest();
}
- function dumpStyleSheetHeader(header, text)
- {
- InspectorTest.addResult("Stylesheet added:");
- InspectorTest.addResult(" - isInline: " + header.isInline);
- InspectorTest.addResult(" - sourceURL: " + pathToFileName(header.sourceURL));
- InspectorTest.addResult(" - hasSourceURL: " + header.hasSourceURL);
- InspectorTest.addResult(" - contents: " + text);
- }
-
function styleSheetAdded(event)
{
var header = event.data;
+ var text = ["Stylesheet added:"];
+ text.push(" - isInline: " + header.isInline);
+ text.push(" - sourceURL: " + pathToFileName(header.sourceURL));
+ text.push(" - hasSourceURL: " + header.hasSourceURL);
+
CSSAgent.getStyleSheetText(header.id, contentLoaded.bind(this));
- function contentLoaded(error, text)
+ function contentLoaded(error, content)
{
- dumpStyleSheetHeader(header, text);
+ text.push(" - contents: " + content);
+ styleSheets.push(text.join("\n"));
}
}
}

Powered by Google App Engine
This is Rietveld 408576698