Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <script src="../../resources/js-test.js"></script> | 3 <script src="../../resources/js-test.js"></script> |
| 4 <body> | 4 <body> |
| 5 | 5 |
| 6 <script type="text/javascript"> | 6 <script type="text/javascript"> |
| 7 if (window.testRunner) | 7 if (window.testRunner) |
| 8 testRunner.setCanOpenWindows(); | 8 testRunner.setCanOpenWindows(); |
| 9 | 9 |
| 10 description('Tests that requestAnimationFrame callbacks are not invoked while mo dal dialogs are displayed.'); | 10 description('Tests that requestAnimationFrame callbacks are not invoked while mo dal dialogs are displayed.'); |
| 11 | 11 |
| 12 onload = function() | 12 onload = function() |
| 13 { | 13 { |
| 14 debug('Setting callback'); | 14 debug('Setting callback'); |
| 15 window.requestAnimationFrame(function() { debug('Callback fired'); }, docume nt.body); | 15 window.requestAnimationFrame(function() { debug('Callback fired'); }, docume nt.body); |
| 16 debug('Showing modal dialog'); | 16 debug('Showing modal dialog'); |
| 17 var src = 'if (window.testRunner) {' + | 17 var src = 'window.setTimeout(window.close, 100);'; |
|
ojan
2014/03/27 20:31:49
Why 100ms? This seems fragile and likely to be fla
enne (OOO)
2014/03/27 20:51:05
Yeah, it's a magic number. Since raf can't be inv
ojan
2014/03/27 21:58:45
Can you requestAnimationFrame inside the showModal
enne (OOO)
2014/03/27 22:03:05
There's a rAF right before it. Since showModalDia
| |
| 18 ' testRunner.display();' + | |
| 19 ' window.close();' + | |
| 20 '} else {'+ | |
| 21 ' window.setTimeout(window.close, 10);'+ | |
| 22 '}'; | |
| 23 showModalDialog('data:text/html,<script>' + src + '</' + 'script>'); | 18 showModalDialog('data:text/html,<script>' + src + '</' + 'script>'); |
| 24 debug('Returned from modal dialog'); | 19 debug('Returned from modal dialog'); |
| 25 if (window.testRunner) {; | |
| 26 testRunner.display(); | |
| 27 } | |
| 28 | 20 |
| 29 window.requestAnimationFrame(function() { | 21 window.requestAnimationFrame(function() { |
| 30 isSuccessfullyParsed(); | 22 isSuccessfullyParsed(); |
| 31 if (window.testRunner) | 23 if (window.testRunner) |
| 32 testRunner.notifyDone(); | 24 testRunner.notifyDone(); |
| 33 }); | 25 }); |
| 34 } | 26 } |
| 35 | 27 |
| 36 if (window.testRunner) | 28 if (window.testRunner) |
| 37 testRunner.waitUntilDone(); | 29 testRunner.waitUntilDone(); |
| 38 | 30 |
| 39 </script> | 31 </script> |
| 40 </body> | 32 </body> |
| 41 </html> | 33 </html> |
| 42 | 34 |
| OLD | NEW |