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

Side by Side Diff: LayoutTests/screen_orientation/screenorientation-detached-notify-no-crash.html

Issue 1190293002: Have ScreenOrientationController use a timer for async event dispatch again (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add clarifying comment to test Created 5 years, 6 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
OLDNEW
(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 // Force the creation of a ScreenOrientation and register it
24 // with the controller, so that orientationchange events are sent.
25 var currentType = window.screen.orientation.type;
26 testIframe.src = "resources/iframe-listen-orientation-change-detach.html";
27 });
28 </script>
29 </body>
30 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698