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

Unified Diff: third_party/WebKit/LayoutTests/inspector-protocol/dom/dom-collect-class-names.html

Issue 2296323002: DevTools: Add features to collect classnames from Stylesheets and DOM (Closed)
Patch Set: DevTools: Add features to collect classnames from Stylesheets and DOM Created 4 years, 3 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: third_party/WebKit/LayoutTests/inspector-protocol/dom/dom-collect-class-names.html
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/dom/dom-collect-class-names.html b/third_party/WebKit/LayoutTests/inspector-protocol/dom/dom-collect-class-names.html
new file mode 100644
index 0000000000000000000000000000000000000000..5af0d6253d80489d393638adbd463bc486892a3c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/dom/dom-collect-class-names.html
@@ -0,0 +1,46 @@
+<html>
+<head>
+<script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
+<script>
+
+function test()
+{
+ InspectorTest.sendCommand("DOM.getDocument", {}, onGotDocument);
+ InspectorTest.sendCommand("DOM.enable", {});
+ function onGotDocument(msg)
+ {
+ rootNodeId = msg.result.root.nodeId;
+ InspectorTest.sendCommandOrDie("DOM.collectClassNames", { nodeId: rootNodeId }, onClassNamesCollected);
lushnikov 2016/09/06 17:51:38 could you please also add a test that verifies tha
ahmetemirercin 2016/09/07 00:02:28 Done.
+ }
+
+ function onClassNamesCollected(response)
+ {
+ var classNames = response.classNames;
+ classNames.sort();
+ for(var i=0; i < classNames.length; i++)
+ InspectorTest.log(classNames[i]);
+
+ InspectorTest.completeTest();
+ }
+}
+
+</script>
+</head>
+<body class="body-class">
+<div class="class1"></div>
+<div class="class2">
+ <ul class="class3">
+ <li class="class4"></li>
+ </ul>
+</div>
+<div class="class5 class6"></div>
+<div id="shadow-host"></div>
+<script type="text/javascript">
+ var host = document.querySelector("#shadow-host");
+ var root = host.createShadowRoot();
+ root.innerHTML = "<div class=\"shadow-class\"></div>";
+ runTest();
+</script>
+
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698