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> |
11 <div id="target"></div> | 11 <div id="target"></div> |
12 <script> | 12 <script> |
13 if (window.location.origin != get_host_info().UNAUTHENTICATED_ORIGIN) { | 13 if (window.location.origin != get_host_info().UNAUTHENTICATED_ORIGIN) { |
14 window.location = get_host_info().UNAUTHENTICATED_ORIGIN + window.location.p
athname; | 14 window.location = get_host_info().UNAUTHENTICATED_ORIGIN + window.location.p
athname; |
15 } else { | 15 } else { |
16 if (!window.internals) | 16 if (!window.internals) |
17 assert_unreached('window.internals is required for this test'); | 17 assert_unreached('window.internals is required for this test'); |
18 | 18 |
19 var mockLatitude = 51.478; | 19 var mockLatitude = 51.478; |
20 var mockLongitude = -0.166; | 20 var mockLongitude = -0.166; |
21 var mockAccuracy = 100.0; | 21 var mockAccuracy = 100.0; |
22 | 22 |
23 internals.setGeolocationClientMock(document); | 23 internals.setGeolocationClientMock(document); |
24 internals.setGeolocationPermission(document, true); | 24 internals.setGeolocationPermission(document, true); |
25 internals.setGeolocationPosition(document, | 25 internals.setGeolocationPosition(document, |
26 mockLatitude, | 26 mockLatitude, |
27 mockLongitude, | 27 mockLongitude, |
28 mockAccuracy); | 28 mockAccuracy); |
29 | 29 |
| 30 // Tests for APIs that are deprecated, but still allowed, on |
| 31 // insecure origins |
30 async_test(function() { | 32 async_test(function() { |
31 navigator.geolocation.getCurrentPosition( | 33 navigator.geolocation.getCurrentPosition( |
32 this.step_func(function() { | 34 this.step_func(function() { |
33 this.done(); | 35 this.done(); |
34 }), | 36 }), |
35 this.step_func(function(error) { | 37 this.step_func(function(error) { |
36 assert_unreached('getCurrentPosition should succeed, but failed.
'); | 38 assert_unreached('getCurrentPosition should succeed, but failed.
'); |
37 this.done(); | 39 this.done(); |
38 })); | 40 })); |
39 }, 'getCurrentPosition'); | 41 }, 'getCurrentPosition'); |
(...skipping 23 matching lines...) Expand all Loading... |
63 })); | 65 })); |
64 | 66 |
65 var request = element.requestFullscreen.bind(element); | 67 var request = element.requestFullscreen.bind(element); |
66 document.addEventListener("click", request); | 68 document.addEventListener("click", request); |
67 eventSender.mouseDown(); | 69 eventSender.mouseDown(); |
68 eventSender.mouseUp(); | 70 eventSender.mouseUp(); |
69 document.removeEventListener("click", request); | 71 document.removeEventListener("click", request); |
70 }, 'fullscreen'); | 72 }, 'fullscreen'); |
71 | 73 |
72 async_test(function() { | 74 async_test(function() { |
73 navigator.webkitGetUserMedia({ audio: true, video: true }, | |
74 this.step_func(function() { | |
75 this.done(); | |
76 }), | |
77 this.step_func(function() { | |
78 assert_unreached('getUserMedia should succeed, but failed.')
; | |
79 this.done(); | |
80 })); | |
81 }, 'getUserMedia'); | |
82 | |
83 async_test(function() { | |
84 testRunner.setMockDeviceMotion(true, 0, true, 0, true, 0, | 75 testRunner.setMockDeviceMotion(true, 0, true, 0, true, 0, |
85 true, 0, true, 0, true, 0, | 76 true, 0, true, 0, true, 0, |
86 true, 0, true, 0, true, 0, | 77 true, 0, true, 0, true, 0, |
87 0); | 78 0); |
88 | 79 |
89 window.addEventListener('devicemotion', this.step_func(function() { | 80 window.addEventListener('devicemotion', this.step_func(function() { |
90 this.done(); | 81 this.done(); |
91 })); | 82 })); |
92 }, 'device motion'); | 83 }, 'device motion'); |
93 | 84 |
94 async_test(function() { | 85 async_test(function() { |
95 testRunner.setMockDeviceOrientation(11.1, 22.2, 33.3, true); | 86 testRunner.setMockDeviceOrientation(11.1, 22.2, 33.3, true); |
96 | 87 |
97 window.addEventListener('deviceorientation', this.step_func(function() { | 88 window.addEventListener('deviceorientation', this.step_func(function() { |
98 this.done(); | 89 this.done(); |
99 })); | 90 })); |
100 }, 'device orientation'); | 91 }, 'device orientation'); |
101 | 92 |
102 promise_test(function(test) { | 93 promise_test(function(test) { |
103 return navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}]); | 94 return navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}]); |
104 }, 'requestMediaKeySystemAccess'); | 95 }, 'requestMediaKeySystemAccess'); |
| 96 |
| 97 // Tests for APIs that have been turned off on insecure origins |
| 98 async_test(function() { |
| 99 navigator.webkitGetUserMedia({ audio: true, video: true }, |
| 100 this.unreached_func('getUserMedia should call the error callback, bu
t called the success callback instead.'), |
| 101 this.step_func_done()); |
| 102 }, 'getUserMedia'); |
105 } | 103 } |
106 </script> | 104 </script> |
107 </body> | 105 </body> |
108 </html> | 106 </html> |
OLD | NEW |