Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(515)

Side by Side Diff: LayoutTests/screen_orientation/orientation-change-event.html

Issue 132113006: Add initial Blink-side support for the Screen Orientation API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update compile-time assertion for matching enum Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="../resources/js-test.js"></script>
5 <script>
6 description("Validates that the orientationchange event is fired.");
7 window.jsTestIsAsync = true;
8
9 var currentTestOrientation = 0;
10 var testOrientations = [
11 "portrait-secondary",
12 "landscape-primary",
13 "landscape-secondary",
14 "portrait-primary"
15 ];
16
17 var testEvent;
18 function onOrientationChangeEvent(ev) {
19 testEvent = ev;
20 shouldBeEqualToString("testEvent.type", "orientationchange");
21 shouldBeEqualToString("screen.orientation", "" + testOrientations[currentTes tOrientation]);
22 if (currentTestOrientation == testOrientations.length - 1) {
23 finishJSTest();
24 return;
25 }
26 internals.setScreenOrientation(document, testOrientations[++currentTestOrien tation]);
27 }
28
29 shouldBeEqualToString("screen.orientation", "portrait-primary");
30
31 internals.setScreenOrientationClientMock(document);
32 screen.addEventListener("orientationchange", onOrientationChangeEvent);
33 internals.setScreenOrientation(document, testOrientations[currentTestOrientation ]);
34 </script>
35 </body>
36 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698