3 <script src=
"../../resources/js-test.js"></script>
6 <p id=
"description"></p>
7 <div id=
"console"></div>
10 description("This tests the parser and serializer for draggable region values.");
12 var style
= document
.getElementById('description').style
;
14 function parseDraggableRegion(string
)
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");
29 shouldBe("parseDraggableRegion('drag')", "'drag'");
30 shouldBe("parseDraggableRegion('no-drag')", "'no-drag'");
33 debug('Tests for variations in whitespace that are allowed.');
36 shouldBe("parseDraggableRegion(' drag ')", "'drag'");
37 shouldBe("parseDraggableRegion(' no-drag ')", "'no-drag'");
40 debug('Tests for case insensitivity.');
43 shouldBe("parseDraggableRegion('Drag')", "'drag'");
44 shouldBe("parseDraggableRegion('DrAG')", "'drag'");
45 shouldBe("parseDraggableRegion('NO-DrAG')", "'no-drag'");
46 shouldBe("parseDraggableRegion('NO-DRAG')", "'no-drag'");
49 debug('Some expected failures.');
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)')", "");