Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / Orientation / script-tests / create-event-orientationchange.js
blob59b356ae7e8635b7d288607bd3cb18d78b7d991c
1 description('Tests that document.createEvent() works with orientationChange if enabled')
3 function handleTestResult()
5 document.getElementById('result').innerHTML = "PASS";
8 if (window.internals && internals.runtimeFlags.orientationEventEnabled) {
9 window.addEventListener('orientationchange', handleTestResult, false);
11 try {
12 var event = document.createEvent("OrientationEvent");
13 event.initEvent("orientationchange", false, false);
14 window.dispatchEvent(event);
15 } catch(e) {
16 document.getElementById('result').innerHTML = "FAIL... orientationChange event doesn't appear to be enabled or implemented.";
18 } else {
19 handleTestResult();