Chromium Code Reviews| 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 <script> | |
| 7 | |
| 8 test(function() { | |
| 9 assert_true('presentation' in navigator); | |
| 10 assert_true('displayAvailable' in navigator.presentation); | |
| 11 assert_true('onavailablechange' in navigator.presentation); | |
| 12 }, "Test that the Presentation API is present.") | |
| 13 | |
| 14 test(function() { | |
| 15 assert_equals(typeof(navigator.presentation), "object"); | |
| 16 assert_equals(typeof(navigator.presentation.displayAvailable), "boolean"); | |
| 17 assert_equals(typeof(navigator.presentation.onavailablechange), "object"); | |
| 18 }, "Test the Presentation API property types."); | |
| 19 | |
| 20 test(function() { | |
| 21 assert_true(navigator.presentation.displayAvailable); | |
| 22 }, "Test the value of navigator.presentation.displayAvailable."); | |
| 23 | |
| 24 test(function() { | |
| 25 assert_true('addEventListener' in navigator.presentation); | |
| 26 assert_true('removeEventListener' in navigator.presentation); | |
| 27 assert_true('dispatchEvent' in navigator.presentation); | |
|
Peter Beverloo
2014/07/25 18:01:17
nit [25-27]: no need to test EventTarget or the in
whywhat
2014/08/19 18:07:34
I'm testing that navigator.presentation is EventTa
| |
| 28 assert_true(navigator.presentation instanceof EventTarget) | |
| 29 }, "Test that navigator.presentation is an EventTarget."); | |
| 30 | |
| 31 </script> | |
| 32 </body> | |
| 33 </html> | |
| 34 | |
| OLD | NEW |