OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 |
| 4 <link rel="stylesheet" href="resources/bezier.css"> |
| 5 |
| 6 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 7 <script src="../../http/tests/inspector/debugger-test.js"></script> |
| 8 <script> |
| 9 function test() |
| 10 { |
| 11 InspectorTest.showScriptSource("bezier.css", onSourceFrame); |
| 12 |
| 13 function onSourceFrame(sourceFrame) |
| 14 { |
| 15 var range = new WebInspector.TextRange(0, 0, 6, 0); |
| 16 InspectorTest.addResult("Initial swatch positions:"); |
| 17 dumpSwatchPositions(); |
| 18 |
| 19 InspectorTest.runTestSuite([ |
| 20 function testEditBezier(next) |
| 21 { |
| 22 var swatch = sourceFrame.textEditor._codeMirrorElement.querySele
ctor("span[is=bezier-swatch]"); |
| 23 swatch.shadowRoot.querySelector(".bezier-swatch-icon").click(); |
| 24 sourceFrame._bezierEditor.setBezier(WebInspector.Geometry.CubicB
ezier.parse("linear")); |
| 25 sourceFrame._bezierEditor._onchange(); |
| 26 sourceFrame._swatchPopoverHelper.hide(true) |
| 27 dumpSwatchPositions(); |
| 28 next(); |
| 29 }, |
| 30 |
| 31 function testAddBezier(next) |
| 32 { |
| 33 var bodyLineEnd = new WebInspector.TextRange(1, 37, 1, 37); |
| 34 sourceFrame.textEditor.editRange(bodyLineEnd, " transition: heig
ht 1s cubic-bezier(0, 0.5, 1, 1);"); |
| 35 dumpSwatchPositions(); |
| 36 next(); |
| 37 }, |
| 38 |
| 39 function testInvalidateBezier(next) |
| 40 { |
| 41 var startParenthesis = new WebInspector.TextRange(1, 67, 1, 68); |
| 42 sourceFrame.textEditor.editRange(startParenthesis, "["); |
| 43 dumpSwatchPositions(); |
| 44 next(); |
| 45 } |
| 46 ]); |
| 47 |
| 48 function dumpSwatchPositions() |
| 49 { |
| 50 var markers = sourceFrame.textEditor.bookmarks(range, WebInspector.C
SSSourceFrame.SwatchBookmark); |
| 51 for (var i = 0; i < markers.length; i++) { |
| 52 var position = markers[i].position(); |
| 53 var bezierText = markers[i]._marker.widgetNode.firstChild.textCo
ntent; |
| 54 InspectorTest.addResult("Line " + position.startLine + ", Column
" + position.startColumn + ": " + bezierText); |
| 55 } |
| 56 } |
| 57 } |
| 58 } |
| 59 </script> |
| 60 </head> |
| 61 |
| 62 <body onload="runTest()"> |
| 63 <p> |
| 64 Tests that bezier swatches are updated properly in CSS Sources. |
| 65 </p> |
| 66 </body> |
| 67 </html> |
OLD | NEW |