Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / screen_orientation / orientation-reading.html
blob79bffed7d4d5b34a351e56d6f03d7d67ea40e4cb
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="../resources/testharness.js"></script>
5 <script src="../resources/testharnessreport.js"></script>
6 <script>
8 test(function() {
9 assert_true('type' in screen.orientation);
10 assert_true('angle' in screen.orientation);
11 }, "Test screen.orientation properties");
13 test(function() {
14 assert_equals(screen.orientation.type, "portrait-primary");
15 assert_equals(screen.orientation.angle, 0);
16 }, "Test screen.orientation default values.");
18 test(function() {
19 var type = screen.orientation.type;
20 var angle = screen.orientation.angle;
22 screen.orientation.type = 'foo';
23 screen.orientation.angle = 42;
25 assert_equals(screen.orientation.type, type);
26 assert_equals(screen.orientation.angle, angle);
27 }, "Test that screen.orientation properties are not writable");
29 test(function() {
30 assert_equals(screen.orientation, screen.orientation);
31 }, "Test that screen.orientation is always the same object");
33 test(function() {
34 var orientation = screen.orientation;
35 var orientationType = screen.orientation.type;
36 var orientationAngle = screen.orientation.angle;
38 if (window.testRunner)
39 window.testRunner.setMockScreenOrientation('landscape-primary');
41 assert_equals(screen.orientation, orientation);
42 assert_equals(screen.orientation.type, orientation.type);
43 assert_equals(screen.orientation.angle, orientation.angle);
44 assert_not_equals(screen.orientation.type, orientationType);
45 assert_not_equals(screen.orientation.angle, orientationAngle);
46 }, "Test that screen.orientation values change if the orientation changes");
48 </script>
49 </body>
50 </html>