Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / draggable-region-parser.html
blobb477b7c597f21abd67a85f4446e89a2b0407bd6b
1 <html>
2 <head>
3 <script src="../../resources/js-test.js"></script>
4 </head>
5 <body>
6 <p id="description"></p>
7 <div id="console"></div>
8 <script>
10 description("This tests the parser and serializer for draggable region values.");
12 var style = document.getElementById('description').style;
14 function parseDraggableRegion(string)
16 try {
17 style.removeProperty("-webkit-app-region");
18 style.setProperty("-webkit-app-region", string, "");
19 var result = style.getPropertyValue("-webkit-app-region");
20 style.removeProperty("-webkit-app-region");
21 return result;
22 } catch (e) {
23 return "" + e;
27 debug('');
29 shouldBe("parseDraggableRegion('drag')", "'drag'");
30 shouldBe("parseDraggableRegion('no-drag')", "'no-drag'");
32 debug('');
33 debug('Tests for variations in whitespace that are allowed.');
34 debug('');
36 shouldBe("parseDraggableRegion(' drag ')", "'drag'");
37 shouldBe("parseDraggableRegion(' no-drag ')", "'no-drag'");
39 debug('');
40 debug('Tests for case insensitivity.');
41 debug('');
43 shouldBe("parseDraggableRegion('Drag')", "'drag'");
44 shouldBe("parseDraggableRegion('DrAG')", "'drag'");
45 shouldBe("parseDraggableRegion('NO-DrAG')", "'no-drag'");
46 shouldBe("parseDraggableRegion('NO-DRAG')", "'no-drag'");
48 debug('');
49 debug('Some expected failures.');
50 debug('');
52 shouldBeEqualToString("parseDraggableRegion('')", "");
53 shouldBeEqualToString("parseDraggableRegion(' ')", "");
54 shouldBeEqualToString("parseDraggableRegion('x')", "");
55 shouldBeEqualToString("parseDraggableRegion('x-')", "");
56 shouldBeEqualToString("parseDraggableRegion('x()')", "");
57 shouldBeEqualToString("parseDraggableRegion('x(a)')", "");
58 shouldBeEqualToString("parseDraggableRegion('none x')", "");
59 shouldBeEqualToString("parseDraggableRegion('none x()')", "");
60 shouldBeEqualToString("parseDraggableRegion('none x(a)')", "");
62 debug('');
65 </script>
66 </body>
67 </html>