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

Unified Diff: LayoutTests/inspector/styles/styles-test.js

Issue 148523012: DevTools: [CSS] remove getAllStylesheets method from protocol (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix testcase extension Created 6 years, 11 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
« no previous file with comments | « LayoutTests/inspector/styles/styles-new-API-expected.txt ('k') | Source/core/inspector/InspectorCSSAgent.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/inspector/styles/styles-test.js
diff --git a/LayoutTests/inspector/styles/styles-test.js b/LayoutTests/inspector/styles/styles-test.js
new file mode 100644
index 0000000000000000000000000000000000000000..4483c6cf721f3770a7a126023243976ecf87119c
--- /dev/null
+++ b/LayoutTests/inspector/styles/styles-test.js
@@ -0,0 +1,36 @@
+function initialize_StylesTests()
+{
+
+InspectorTest.waitForStylesheetsOnFrontend = function(styleSheetsCount, callback)
+{
+ function styleSheetComparator(a, b)
+ {
+ if (a.sourceURL < b.sourceURL)
+ return -1;
+ else if (a.sourceURL > b.sourceURL)
+ return 1;
+ return a.startLine - b.startLine || a.startColumn - b.startColumn;
+ }
+
+ var styleSheets = WebInspector.cssModel.allStyleSheets();
+ if (styleSheets.length >= styleSheetsCount) {
+ styleSheets.sort(styleSheetComparator);
+ callback(styleSheets);
+ return;
+ }
+
+ function onStyleSheetAdded()
+ {
+ var styleSheets = WebInspector.cssModel.allStyleSheets();
+ if (styleSheets.length < styleSheetsCount)
+ return;
+
+ WebInspector.cssModel.removeEventListener(WebInspector.CSSStyleModel.Events.StyleSheetAdded, onStyleSheetAdded, this);
+ styleSheets.sort(styleSheetComparator);
+ callback(null, styleSheets);
+ }
+
+ WebInspector.cssModel.addEventListener(WebInspector.CSSStyleModel.Events.StyleSheetAdded, onStyleSheetAdded, this);
+}
+
+}
« no previous file with comments | « LayoutTests/inspector/styles/styles-new-API-expected.txt ('k') | Source/core/inspector/InspectorCSSAgent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698