OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <html> | |
3 <body> | |
4 <script src="../resources/testharness.js"></script> | |
5 <script src="../resources/testharnessreport.js"></script> | |
6 <iframe id=testIframe></iframe> | |
7 <script> | |
8 var notifyTest = async_test("Test that async event dispatch to detached frame is gracefully handled."); | |
9 | |
10 function changeOrientationAndDetach() { | |
11 // Dispatch an orientationchange event; this is handled asynchronously, | |
12 // queueing a task/timer to do the actual dispatch. | |
13 window.testRunner.setMockScreenOrientation('portrait-secondary'); | |
14 | |
15 // Detach the iframe while the event dispatch is in-flight. If | |
16 // the screen orientation controller is finalized during the | |
17 // detach, the async event dispatch just after will be treated | |
18 // like a no-op -- there's no controller to handle the dispatch. | |
19 document.body.removeChild(testIframe); | |
20 setTimeout(function () { notifyTest.done(); }, 0); | |
21 } | |
22 notifyTest.step(function () { | |
23 var currentType = window.screen.orientation.type; | |
mlamouri (slow - plz ping)
2015/06/19 09:54:26
Could you explain the purpose of that line?
sof
2015/06/19 10:57:17
A bit magic looking; isActiveAndVisible() will onl
sof
2015/06/19 10:59:58
Added a comment.
| |
24 testIframe.src = "resources/iframe-listen-orientation-change-detach.html"; | |
25 }); | |
26 </script> | |
27 </body> | |
28 </html> | |
OLD | NEW |