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

Side by Side Diff: chrome/test/data/extensions/platform_apps/web_view/geolocation/embedder_has_no_permission/embedder.js

Issue 235633002: <webview>: Move Geolocation permission to chrome layer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed tests in Debug mode Created 6 years, 8 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var embedder = {}; 5 var embedder = {};
6 embedder.test = {}; 6 embedder.test = {};
7 embedder.baseGuestURL = ''; 7 embedder.baseGuestURL = '';
8 embedder.guestURL = ''; 8 embedder.guestURL = '';
9 9
10 window.runTest = function(testName) { 10 window.runTest = function(testName) {
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 } 92 }
93 }; 93 };
94 window.addEventListener('message', onPostMessageReceived); 94 window.addEventListener('message', onPostMessageReceived);
95 }; 95 };
96 96
97 /** @private */ 97 /** @private */
98 embedder.assertCorrectEvent_ = function(e) { 98 embedder.assertCorrectEvent_ = function(e) {
99 embedder.test.assertEq('geolocation', e.permission); 99 embedder.test.assertEq('geolocation', e.permission);
100 embedder.test.assertTrue(!!e.url); 100 embedder.test.assertTrue(!!e.url);
101 embedder.test.assertTrue(e.url.indexOf(embedder.baseGuestURL) == 0); 101 embedder.test.assertTrue(e.url.indexOf(embedder.baseGuestURL) == 0);
102
103 // Check that unexpected properties (from other permissionrequest) do not show
104 // up in the event object.
105 embedder.test.assertFalse('userGesture' in e);
106 }; 102 };
107 103
108 // Tests begin. 104 // Tests begin.
109 105
110 // Embedder does not have geolocation permission, so geolocation access is 106 // Embedder does not have geolocation permission, so geolocation access is
111 // always denied for these tests. 107 // always denied for these tests.
112 108
113 // Calling deny() results in deny. 109 // Calling deny() results in deny.
114 function testDenyDenies() { 110 function testDenyDenies() {
115 var webview = embedder.setUpGuest_(); 111 var webview = embedder.setUpGuest_();
(...skipping 28 matching lines...) Expand all
144 'testDenyDenies': testDenyDenies, 140 'testDenyDenies': testDenyDenies,
145 'testAllowDenies': testAllowDenies 141 'testAllowDenies': testAllowDenies
146 }; 142 };
147 143
148 onload = function() { 144 onload = function() {
149 chrome.test.getConfig(function(config) { 145 chrome.test.getConfig(function(config) {
150 embedder.setUp(config); 146 embedder.setUp(config);
151 chrome.test.sendMessage('Launched'); 147 chrome.test.sendMessage('Launched');
152 }); 148 });
153 }; 149 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698