| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>Old Powerful Features on an Insecure Origin</title> | 4 <title>Old Powerful Features on an Insecure Origin</title> |
| 5 </head> | 5 </head> |
| 6 <script src="/resources/testharness.js"></script> | 6 <script src="/resources/testharness.js"></script> |
| 7 <script src="/resources/testharnessreport.js"></script> | 7 <script src="/resources/testharnessreport.js"></script> |
| 8 <script src="/resources/get-host-info.js"></script> | 8 <script src="/resources/get-host-info.js"></script> |
| 9 | 9 |
| 10 <body> | 10 <body> |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 }, 'device orientation'); | 43 }, 'device orientation'); |
| 44 | 44 |
| 45 promise_test(function(test) { | 45 promise_test(function(test) { |
| 46 return navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}]); | 46 return navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}]); |
| 47 }, 'requestMediaKeySystemAccess'); | 47 }, 'requestMediaKeySystemAccess'); |
| 48 | 48 |
| 49 // Tests for APIs that have been turned off on insecure origins | 49 // Tests for APIs that have been turned off on insecure origins |
| 50 async_test(function() { | 50 async_test(function() { |
| 51 navigator.geolocation.getCurrentPosition( | 51 navigator.geolocation.getCurrentPosition( |
| 52 this.unreached_func('getCurrentPosition should fail, but succeeded.'
), | 52 this.unreached_func('getCurrentPosition should fail, but succeeded.'
), |
| 53 this.step_func_done()); | 53 this.step_func_done(function(error) { |
| 54 assert_equals(error.code, error.PERMISSION_DENIED); |
| 55 })); |
| 54 }, 'getCurrentPosition'); | 56 }, 'getCurrentPosition'); |
| 55 | 57 |
| 56 // Note that the deprecation message for watchPosition() will be suppressed | 58 // Note that the deprecation message for watchPosition() will be suppressed |
| 57 // because it is an exact duplicate of the getCurrentPosition() message. | 59 // because it is an exact duplicate of the getCurrentPosition() message. |
| 58 // Thus, this test is really to confirm that it still executes (and fails). | 60 // Thus, this test is really to confirm that it still executes (and fails). |
| 59 async_test(function() { | 61 async_test(function() { |
| 60 navigator.geolocation.watchPosition( | 62 navigator.geolocation.watchPosition( |
| 61 this.unreached_func('watchPosition should fail, but succeeded.'), | 63 this.unreached_func('watchPosition should fail, but succeeded.'), |
| 62 this.step_func_done()); | 64 this.step_func_done(function(error) { |
| 65 assert_equals(error.code, error.PERMISSION_DENIED); |
| 66 })); |
| 63 }, 'watchPosition'); | 67 }, 'watchPosition'); |
| 64 | 68 |
| 65 async_test(function() { | 69 async_test(function() { |
| 66 navigator.webkitGetUserMedia({ audio: true, video: true }, | 70 navigator.webkitGetUserMedia({ audio: true, video: true }, |
| 67 this.unreached_func('navigator.webkitGetUserMedia should call the er
ror callback, but called the success callback instead.'), | 71 this.unreached_func('navigator.webkitGetUserMedia should call the er
ror callback, but called the success callback instead.'), |
| 68 this.step_func_done()); | 72 this.step_func_done()); |
| 69 }, 'navigator.webkitGetUserMedia'); | 73 }, 'navigator.webkitGetUserMedia'); |
| 70 | 74 |
| 71 promise_test(function(test) { | 75 promise_test(function(test) { |
| 72 return navigator.mediaDevices.getUserMedia({audio: true, video: true}).t
hen( | 76 return navigator.mediaDevices.getUserMedia({audio: true, video: true}).t
hen( |
| 73 test.unreached_func("navigator.mediaDevices.getUserMedia should reje
ct the promise, but resolved instead."), | 77 test.unreached_func("navigator.mediaDevices.getUserMedia should reje
ct the promise, but resolved instead."), |
| 74 function(error) { | 78 function(error) { |
| 75 assert_equals(error.name, "NotSupportedError"); | 79 assert_equals(error.name, "NotSupportedError"); |
| 76 assert_equals(error.message, "Only secure origins are allowed (s
ee: https://goo.gl/Y0ZkNV)."); | 80 assert_equals(error.message, "Only secure origins are allowed (s
ee: https://goo.gl/Y0ZkNV)."); |
| 77 }); | 81 }); |
| 78 }, 'navigator.mediaDevices.getUserMedia'); | 82 }, 'navigator.mediaDevices.getUserMedia'); |
| 79 } | 83 } |
| 80 </script> | 84 </script> |
| 81 </body> | 85 </body> |
| 82 </html> | 86 </html> |
| OLD | NEW |