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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/permissions/chromium/resources/test-request.js

Issue 1352863002: permissions: rework tests for requesting (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove at the end of requesting Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/permissions/chromium/test-request-sharedworker.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/permissions/chromium/resources/test-request.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/permissions/chromium/resources/test-request.js b/third_party/WebKit/LayoutTests/http/tests/permissions/chromium/resources/test-request.js
index 95f452065a5a7927c0959e07d799e29a0a722b0f..c85da9f92c76d074c3c0307a7cbc5d9893706c53 100644
--- a/third_party/WebKit/LayoutTests/http/tests/permissions/chromium/resources/test-request.js
+++ b/third_party/WebKit/LayoutTests/http/tests/permissions/chromium/resources/test-request.js
@@ -41,23 +41,15 @@ var tests = [
navigator.permissions.request({name:'geolocation'}).then(function(result) {
assert_true(result instanceof PermissionStatus);
assert_equals(result.state, 'denied');
-
- result.onchange = function() {
- assert_equals(result.state, 'granted');
-
- navigator.permissions.request({name:'geolocation'}).then(function() {
- assert_true(result instanceof PermissionStatus);
- assert_equals(result.state, 'granted');
- callback();
- }).catch(function() {
- assert_unreached('requesting geolocation permission should not fail.')
- callback();
- });
- };
-
- setPermission('geolocation', 'granted', location.origin, location.origin)
- }).catch(function() {
- assert_unreached('requesting geolocation permission should not fail.')
+ return setPermission('geolocation', 'granted', location.origin, location.origin);
+ }).then(function() {
+ return navigator.permissions.request({name:'geolocation'});
+ }).then(function(result) {
+ assert_true(result instanceof PermissionStatus);
+ assert_equals(result.state, 'granted');
+ navigator.permissions.revoke({name:'geolocation'}).then(callback);
+ }).catch(function(error) {
+ assert_unreached(error);
callback();
});
}
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/permissions/chromium/test-request-sharedworker.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698