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

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: Add test for correct error code 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(function(error) {
Mike West 2016/02/01 06:34:12 This can still be step_func_done, and that will au
jww 2016/02/01 23:28:57 Ah, I had no idea that you could pass a function t
54 assert_equals(error.code, error.PERMISSION_DENIED);
55 this.done();
Mike West 2016/02/01 06:34:12 Which means you can drop this line.
jww 2016/02/01 23:28:56 Done.
56 }));
54 }, 'getCurrentPosition'); 57 }, 'getCurrentPosition');
55 58
56 // Note that the deprecation message for watchPosition() will be suppressed 59 // Note that the deprecation message for watchPosition() will be suppressed
57 // because it is an exact duplicate of the getCurrentPosition() message. 60 // because it is an exact duplicate of the getCurrentPosition() message.
58 // Thus, this test is really to confirm that it still executes (and fails). 61 // Thus, this test is really to confirm that it still executes (and fails).
59 async_test(function() { 62 async_test(function() {
60 navigator.geolocation.watchPosition( 63 navigator.geolocation.watchPosition(
61 this.unreached_func('watchPosition should fail, but succeeded.'), 64 this.unreached_func('watchPosition should fail, but succeeded.'),
62 this.step_func_done()); 65 this.step_func(function(error) {
Mike West 2016/02/01 06:34:12 Ditto.
jww 2016/02/01 23:28:56 Done.
66 assert_equals(error.code, error.PERMISSION_DENIED);
67 this.done();
68 }));
63 }, 'watchPosition'); 69 }, 'watchPosition');
64 70
65 async_test(function() { 71 async_test(function() {
66 navigator.webkitGetUserMedia({ audio: true, video: true }, 72 navigator.webkitGetUserMedia({ audio: true, video: true },
67 this.unreached_func('navigator.webkitGetUserMedia should call the er ror callback, but called the success callback instead.'), 73 this.unreached_func('navigator.webkitGetUserMedia should call the er ror callback, but called the success callback instead.'),
68 this.step_func_done()); 74 this.step_func_done());
69 }, 'navigator.webkitGetUserMedia'); 75 }, 'navigator.webkitGetUserMedia');
70 76
71 promise_test(function(test) { 77 promise_test(function(test) {
72 return navigator.mediaDevices.getUserMedia({audio: true, video: true}).t hen( 78 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."), 79 test.unreached_func("navigator.mediaDevices.getUserMedia should reje ct the promise, but resolved instead."),
74 function(error) { 80 function(error) {
75 assert_equals(error.name, "NotSupportedError"); 81 assert_equals(error.name, "NotSupportedError");
76 assert_equals(error.message, "Only secure origins are allowed (s ee: https://goo.gl/Y0ZkNV)."); 82 assert_equals(error.message, "Only secure origins are allowed (s ee: https://goo.gl/Y0ZkNV).");
77 }); 83 });
78 }, 'navigator.mediaDevices.getUserMedia'); 84 }, 'navigator.mediaDevices.getUserMedia');
79 } 85 }
80 </script> 86 </script>
81 </body> 87 </body>
82 </html> 88 </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