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

Side by Side Diff: chrome/test/data/extensions/platform_apps/web_view/geolocation/cancel_request/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.baseGuestURL = ''; 6 embedder.baseGuestURL = '';
7 embedder.guestURL = ''; 7 embedder.guestURL = '';
8 embedder.iframeURL = ''; 8 embedder.iframeURL = '';
9 9
10 /** @private */ 10 /** @private */
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 } 64 }
65 }; 65 };
66 window.addEventListener('message', onPostMessageReceived); 66 window.addEventListener('message', onPostMessageReceived);
67 }; 67 };
68 68
69 /** @private */ 69 /** @private */
70 embedder.assertCorrectEvent_ = function(e) { 70 embedder.assertCorrectEvent_ = function(e) {
71 chrome.test.assertEq('geolocation', e.permission); 71 chrome.test.assertEq('geolocation', e.permission);
72 chrome.test.assertTrue(!!e.url); 72 chrome.test.assertTrue(!!e.url);
73 chrome.test.assertTrue(e.url.indexOf(embedder.baseGuestURL) == 0); 73 chrome.test.assertTrue(e.url.indexOf(embedder.baseGuestURL) == 0);
74
75 // Check that unexpected properties (from other permissionrequest) do not show
76 // up in the event object.
77 chrome.test.assertFalse('userGesture' in e);
78 }; 74 };
79 75
80 var g_requestObject; 76 var g_requestObject;
81 77
82 // Tests begin. 78 // Tests begin.
83 79
84 // Tests CancelGeolocationPermission code path. 80 // Tests CancelGeolocationPermission code path.
85 function testCancelGeolocationInIFrame() { 81 function testCancelGeolocationInIFrame() {
86 var webview = embedder.setUpGuest_(); 82 var webview = embedder.setUpGuest_();
87 83
(...skipping 12 matching lines...) Expand all
100 } 96 }
101 97
102 onload = function() { 98 onload = function() {
103 chrome.test.getConfig(function(config) { 99 chrome.test.getConfig(function(config) {
104 embedder.setUp_(config); 100 embedder.setUp_(config);
105 chrome.test.runTests([ 101 chrome.test.runTests([
106 testCancelGeolocationInIFrame, 102 testCancelGeolocationInIFrame,
107 ]); 103 ]);
108 }); 104 });
109 }; 105 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698