4 <script src=
"../resources/testharness.js"></script>
5 <script src=
"../resources/testharnessreport.js"></script>
9 assert_true('type' in screen
.orientation
);
10 assert_true('angle' in screen
.orientation
);
11 }, "Test screen.orientation properties");
14 assert_equals(screen
.orientation
.type
, "portrait-primary");
15 assert_equals(screen
.orientation
.angle
, 0);
16 }, "Test screen.orientation default values.");
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");
30 assert_equals(screen
.orientation
, screen
.orientation
);
31 }, "Test that screen.orientation is always the same object");
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");