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

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

Issue 2297873004: DevTools: Add bezier swatches to CSS Sources (Closed)
Patch Set: Extract dumpSwatchPositions and rename flag 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/sources/bezier-swatch-position.html
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/bezier-swatch-position.html b/third_party/WebKit/LayoutTests/inspector/sources/bezier-swatch-position.html
new file mode 100644
index 0000000000000000000000000000000000000000..e5598d996c6294ea56104e73b561f42fc93be418
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector/sources/bezier-swatch-position.html
@@ -0,0 +1,57 @@
+<html>
+<head>
+
+<link rel="stylesheet" href="resources/bezier.css">
+
+<script src="../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../http/tests/inspector/debugger-test.js"></script>
+<script src="../../http/tests/inspector/sources-test.js"></script>
+<script>
+function test()
+{
+ InspectorTest.showScriptSource("bezier.css", onSourceFrame);
+
+ function onSourceFrame(sourceFrame)
+ {
+ InspectorTest.addResult("Initial swatch positions:");
+ InspectorTest.dumpSwatchPositions(sourceFrame, WebInspector.CSSSourceFrame.SwatchBookmark);
+
+ InspectorTest.runTestSuite([
+ function testEditBezier(next)
+ {
+ var swatch = sourceFrame.textEditor._codeMirrorElement.querySelector("span[is=bezier-swatch]");
+ swatch.shadowRoot.querySelector(".bezier-swatch-icon").click();
+ sourceFrame._bezierEditor.setBezier(WebInspector.Geometry.CubicBezier.parse("linear"));
+ sourceFrame._bezierEditor._onchange();
+ sourceFrame._swatchPopoverHelper.hide(true)
+ InspectorTest.dumpSwatchPositions(sourceFrame, WebInspector.CSSSourceFrame.SwatchBookmark);
+ next();
+ },
+
+ function testAddBezier(next)
+ {
+ var bodyLineEnd = new WebInspector.TextRange(1, 37, 1, 37);
+ sourceFrame.textEditor.editRange(bodyLineEnd, " transition: height 1s cubic-bezier(0, 0.5, 1, 1);");
+ InspectorTest.dumpSwatchPositions(sourceFrame, WebInspector.CSSSourceFrame.SwatchBookmark);
+ next();
+ },
+
+ function testInvalidateBezier(next)
+ {
+ var startParenthesis = new WebInspector.TextRange(1, 67, 1, 68);
+ sourceFrame.textEditor.editRange(startParenthesis, "[");
+ InspectorTest.dumpSwatchPositions(sourceFrame, WebInspector.CSSSourceFrame.SwatchBookmark);
+ next();
+ }
+ ]);
+ }
+}
+</script>
+</head>
+
+<body onload="runTest()">
+<p>
+Tests that bezier swatches are updated properly in CSS Sources.
+</p>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698