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> |