Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <html> | |
| 2 <head> | |
| 3 <title>DeviceOrientationEnableSwitchTest</title> | |
| 4 <script type="text/javascript"> | |
| 5 var failed = false; | |
| 6 function pass() { | |
| 7 if (failed) | |
| 8 return; | |
| 9 document.getElementById('status').innerHTML = 'PASS'; | |
| 10 document.location = '#pass'; | |
|
bulach
2010/07/20 14:38:56
nice trick!
| |
| 11 } | |
| 12 function fail() { | |
| 13 document.getElementById('status').innerHTML = 'FAIL'; | |
| 14 document.location = '#fail'; | |
| 15 failed = true; | |
| 16 } | |
| 17 function run() { | |
| 18 for (var property in window) { | |
| 19 if (property == "DeviceOrientationEvent") | |
| 20 fail(); | |
| 21 if (property == "ondeviceorientation") | |
| 22 fail(); | |
| 23 } | |
| 24 | |
| 25 pass(); | |
| 26 } | |
| 27 </script> | |
| 28 </head> | |
| 29 <body onload="run()"> | |
| 30 <div id="status">Running...</div> | |
| 31 </body> | |
| 32 </html> | |
| OLD | NEW |