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

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

Issue 2319763004: DevTools: (DO NOT COMMIT) Add shadow swatches to Sources, work in progress (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/sources/bezier-swatch-position-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5d37dc1103cc6c2230e89c6d5080d33b3d240a99
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector/sources/bezier-swatch-position.html
@@ -0,0 +1,67 @@
+<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>
+function test()
+{
+ InspectorTest.showScriptSource("bezier.css", onSourceFrame);
+
+ function onSourceFrame(sourceFrame)
+ {
+ var range = new WebInspector.TextRange(0, 0, 6, 0);
+ InspectorTest.addResult("Initial swatch positions:");
+ dumpSwatchPositions();
+
+ 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)
+ dumpSwatchPositions();
+ 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);");
+ dumpSwatchPositions();
+ next();
+ },
+
+ function testInvalidateBezier(next)
+ {
+ var startParenthesis = new WebInspector.TextRange(1, 67, 1, 68);
+ sourceFrame.textEditor.editRange(startParenthesis, "[");
+ dumpSwatchPositions();
+ next();
+ }
+ ]);
+
+ function dumpSwatchPositions()
+ {
+ var markers = sourceFrame.textEditor.bookmarks(range, WebInspector.CSSSourceFrame.SwatchBookmark);
+ for (var i = 0; i < markers.length; i++) {
+ var position = markers[i].position();
+ var bezierText = markers[i]._marker.widgetNode.firstChild.textContent;
+ InspectorTest.addResult("Line " + position.startLine + ", Column " + position.startColumn + ": " + bezierText);
+ }
+ }
+ }
+}
+</script>
+</head>
+
+<body onload="runTest()">
+<p>
+Tests that bezier swatches are updated properly in CSS Sources.
+</p>
+</body>
+</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/sources/bezier-swatch-position-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698