Index: third_party/WebKit/LayoutTests/inspector/sources/color-swatch.html |
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/color-swatch.html b/third_party/WebKit/LayoutTests/inspector/sources/color-swatch.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f2121a188c2ed827ca2bf741f1a01a71d0551185 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/inspector/sources/color-swatch.html |
@@ -0,0 +1,33 @@ |
+<html> |
+<head> |
+ |
lushnikov
2016/07/25 23:15:36
I'd kill this test - it doesn't test much and if f
flandy
2016/07/26 01:16:46
Done.
|
+<link rel="stylesheet" href="resources/color.css"> |
+ |
+<script src="../../http/tests/inspector/inspector-test.js"></script> |
+<script src="../../http/tests/inspector/debugger-test.js"></script> |
+<script> |
+function test() |
+{ |
+ InspectorTest.showScriptSource("color.css", onSourceFrame); |
+ |
+ function onSourceFrame(sourceFrame) |
+ { |
+ sourceFrame._updateColorSwatches(0, 6); |
+ var swatch = sourceFrame.textEditor._codeMirrorElement.querySelector("span[is=color-swatch]"); |
+ InspectorTest.addResult("First swatch color: " + swatch.color().asString(WebInspector.Color.Format.Original)); |
+ var swatchIcon = swatch.shadowRoot.querySelector(".color-swatch-inner"); |
+ InspectorTest.addResult("Has popover before click: " + !!document.querySelector("body > .popover-container")); |
+ swatchIcon.click(); |
+ InspectorTest.addResult("Has popover after click: " + !!document.querySelector("body > .popover-container")); |
+ InspectorTest.completeTest(); |
+ } |
+} |
+</script> |
+</head> |
+ |
+<body onload="runTest()"> |
+<p> |
+Tests that color swatches are rendered for colors in the sources panel. |
+</p> |
+</body> |
+</html> |