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

Unified Diff: third_party/WebKit/LayoutTests/inspector/sources/color-swatch.html

Issue 2173913002: DevTools: Optimize source color picker to analyze changed lines (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@escSpectrum
Patch Set: Added tests Created 4 years, 5 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/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>

Powered by Google App Engine
This is Rietveld 408576698