Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(576)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/powerfulFeatureRestrictions/old-powerful-features-on-insecure-origin.html

Issue 1642903005: Update geolocation over HTTP error to use PERMISSION_DENIED (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Address nits Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/geolocation/Geolocation.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/geolocation/Geolocation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698