OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <body> | 3 <body> |
4 <script src="../resources/testharness.js"></script> | 4 <script src="../resources/testharness.js"></script> |
5 <script src="../resources/testharnessreport.js"></script> | 5 <script src="../resources/testharnessreport.js"></script> |
6 <script> | 6 <script> |
7 | 7 |
8 test(function() { | 8 test(function() { |
9 assert_true('presentation' in navigator); | 9 assert_true('presentation' in navigator); |
10 assert_true('defaultRequest' in navigator.presentation); | 10 assert_true('defaultRequest' in navigator.presentation); |
11 assert_true('session' in navigator.presentation); | 11 assert_true('session' in navigator.presentation); |
12 | 12 |
13 assert_true('PresentationRequest' in window); | 13 assert_true('PresentationRequest' in window); |
14 }, "Test that the Presentation API is present.") | 14 }, "Test that the Presentation API is present.") |
15 | 15 |
16 test(function() { | 16 test(function() { |
17 assert_equals(typeof(navigator.presentation), "object"); | 17 assert_equals(typeof(navigator.presentation), "object"); |
18 assert_equals(typeof(navigator.presentation.defaultRequest), "object"); | 18 assert_equals(typeof(navigator.presentation.defaultRequest), "object"); |
19 assert_equals(typeof(navigator.presentation.session), "object"); | 19 assert_equals(typeof(navigator.presentation.session), "object"); |
20 }, "Test the Presentation API property types."); | 20 }, "Test the Presentation API property types."); |
21 | 21 |
22 test(function() { | 22 test(function() { |
23 assert_true(navigator.presentation instanceof EventTarget); | 23 assert_true(navigator.presentation instanceof EventTarget); |
24 }, "Test that navigator.presentation is an EventTarget."); | 24 }, "Test that navigator.presentation is an EventTarget."); |
25 | 25 |
26 test(function() { | 26 test(function() { |
27 var request = new PresentationRequest('foo.html'); | 27 var request = new PresentationRequest('foo.html'); |
28 assert_equals(typeof(request.start), "function"); | 28 assert_equals(typeof(request.start), "function"); |
29 assert_equals(typeof(request.join), "function"); | 29 assert_equals(typeof(request.reconnect), "function"); |
30 assert_equals(typeof(request.getAvailability), "function"); | 30 assert_equals(typeof(request.getAvailability), "function"); |
31 assert_equals(typeof(request.onsessionconnect), "object"); | 31 assert_equals(typeof(request.onsessionconnect), "object"); |
32 | 32 |
33 assert_true(request instanceof EventTarget); | 33 assert_true(request instanceof EventTarget); |
34 }, "Test PresentationRequest API types."); | 34 }, "Test PresentationRequest API types."); |
35 | 35 |
36 </script> | 36 </script> |
37 </body> | 37 </body> |
38 </html> | 38 </html> |
OLD | NEW |