Index: LayoutTests/inspector-protocol/css/css-visited-link-matched-styles.html |
diff --git a/LayoutTests/inspector-protocol/css/css-visited-link-matched-styles.html b/LayoutTests/inspector-protocol/css/css-visited-link-matched-styles.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9bf3786da68298470fd4d9861fd91aa79d6ac197 |
--- /dev/null |
+++ b/LayoutTests/inspector-protocol/css/css-visited-link-matched-styles.html |
@@ -0,0 +1,52 @@ |
+<html> |
+<head> |
+<script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script> |
+<script type="text/javascript" src="css-protocol-test.js"></script> |
+<script type="text/javascript"> |
+function test() |
apavlov
2014/04/08 14:19:46
we might want to check this stuff for shadow DOM a
lushnikov
2014/04/08 15:28:32
Done.
|
+{ |
+ InspectorTest.sendCommandOrDie("CSS.enable", {}, onCSSEnabled); |
+ |
+ function onCSSEnabled() |
+ { |
+ InspectorTest.log("==== Styles for unvisited link ===="); |
+ InspectorTest.loadAndDumpMatchingRules("#redlink", onUnvisitedLinkDumped); |
+ } |
+ |
+ function onUnvisitedLinkDumped() |
+ { |
+ InspectorTest.requestNodeId("#redlink", onNodeReceived); |
+ } |
+ |
+ function onNodeReceived(nodeId) |
+ { |
+ InspectorTest.sendCommandOrDie("CSS.forcePseudoState", { |
+ nodeId: nodeId, |
+ forcedPseudoClasses: [ "visited" ] |
+ }, onVisitedForced.bind(null, nodeId)); |
+ } |
+ |
+ function onVisitedForced(nodeId) |
+ { |
+ InspectorTest.log("==== Styles for visited link ===="); |
+ InspectorTest.loadAndDumpMatchingRulesForNode(nodeId, InspectorTest.completeTest.bind(InspectorTest)); |
+ } |
+} |
+</script> |
+<style> |
+a:visited { |
+ color: red; |
+} |
+a:link { |
+ color: blue; |
+} |
+ |
+a { |
+ color: gray; |
+} |
+</style> |
+</head> |
+<body onload="runTest();"> |
+ <a id="redlink" href="definitely-unvisited-link-address-1989-42.html">This is visited link</a> |
+</body> |
+</html> |