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

Issue 13712002: Fix Guest geolocation API, we were using |bridge_id| and |request_id| interchangeably which is wron… (Closed)

Created:
7 years, 8 months ago by lazyboy
Modified:
7 years, 8 months ago
Reviewers:
Fady Samuel
CC:
chromium-reviews, joi+watch-content_chromium.org, Aaron Boodman, darin-cc_chromium.org, jam, chromium-apps-reviews_chromium.org
Visibility:
Public.

Description

Fix Guest geolocation API, we were using |bridge_id| and |request_id| interchangeably which is wrong. A |bridge_id| is specific to geolocation request in chrome/browser/geolocation/* where request_id is BrowserPluginGuest's local id of all types of permission requests. Fix WebViewTest.GeolocationAPIEmbedderHasAccess* test flakiness, after frustrating hours, I found that ui_test_utils::OverrideGeolocation() is not set up to mock multiple geolocation requests reliably, made tests separate and use cached values for geolocation requests other than the first (/w maxiumAge + timeout = 0). BUG=225819, 223877 TEST=Added tests to cover bridge_id change, using iframe to trigger second geolocation request from different frame (testMultipleBridgeIdAllow). Fixed WebViewTest.GeolocationAPIEmbedderHasAccess flakiness due to mocking geolocation (ran them separately on each of win_rel, linux_chromeos, mac_rel and linux_rel trybots for 50/100 times). Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=193230

Patch Set 1 #

Patch Set 2 : Use correct base. #

Total comments: 4

Patch Set 3 : Test for CancelGeolocationPermission + remove wrong DCHECK. #

Total comments: 2

Patch Set 4 : Address comments from fsamuel@ #

Patch Set 5 : Sync. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+457 lines, -92 lines) Patch
M chrome/browser/extensions/web_view_browsertest.cc View 1 2 3 4 2 chunks +54 lines, -5 lines 0 comments Download
A + chrome/test/data/extensions/platform_apps/web_view/geolocation/cancel_request/embedder.html View 1 2 3 4 0 chunks +-1 lines, --1 lines 0 comments Download
A + chrome/test/data/extensions/platform_apps/web_view/geolocation/cancel_request/embedder.js View 1 2 3 chunks +33 lines, -37 lines 0 comments Download
A chrome/test/data/extensions/platform_apps/web_view/geolocation/cancel_request/manifest.json View 1 2 1 chunk +14 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/platform_apps/web_view/geolocation/cancel_request/pages/guest.html View 1 2 1 chunk +74 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/platform_apps/web_view/geolocation/cancel_request/pages/iframe.html View 1 2 1 chunk +22 lines, -0 lines 0 comments Download
A + chrome/test/data/extensions/platform_apps/web_view/geolocation/cancel_request/test.js View 1 2 3 4 0 chunks +-1 lines, --1 lines 0 comments Download
M chrome/test/data/extensions/platform_apps/web_view/geolocation/embedder_has_permission/embedder.js View 1 2 3 7 chunks +123 lines, -24 lines 0 comments Download
M chrome/test/data/extensions/platform_apps/web_view/geolocation/geolocation_access_guest.html View 1 2 1 chunk +74 lines, -15 lines 0 comments Download
A chrome/test/data/extensions/platform_apps/web_view/geolocation/geolocation_access_iframe.html View 1 1 chunk +38 lines, -0 lines 0 comments Download
M content/browser/browser_plugin/browser_plugin_geolocation_permission_context.cc View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M content/browser/browser_plugin/browser_plugin_guest.h View 1 2 3 4 1 chunk +7 lines, -2 lines 0 comments Download
M content/browser/browser_plugin/browser_plugin_guest.cc View 1 2 3 4 2 chunks +20 lines, -10 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
lazyboy
7 years, 8 months ago (2013-04-05 06:30:06 UTC) #1
Fady Samuel
LGTM but please add a better description of bridge ID v.s. request ID. https://chromiumcodereview.appspot.com/13712002/diff/2001/chrome/test/data/extensions/platform_apps/web_view/geolocation/embedder_has_permission/embedder.js File ...
7 years, 8 months ago (2013-04-05 15:07:21 UTC) #2
lazyboy
Couple updates done in the CL: 1. Added an explicit test to exercise BPGeolocationPermissionContext::CancelGeolocationPermission() code ...
7 years, 8 months ago (2013-04-05 18:30:07 UTC) #3
Fady Samuel
https://codereview.chromium.org/13712002/diff/7001/chrome/test/data/extensions/platform_apps/web_view/geolocation/embedder_has_permission/embedder.js File chrome/test/data/extensions/platform_apps/web_view/geolocation/embedder_has_permission/embedder.js (right): https://codereview.chromium.org/13712002/diff/7001/chrome/test/data/extensions/platform_apps/web_view/geolocation/embedder_has_permission/embedder.js#newcode73 chrome/test/data/extensions/platform_apps/web_view/geolocation/embedder_has_permission/embedder.js:73: embedder.test.assertEq = function(a, b, opt) { What's the point ...
7 years, 8 months ago (2013-04-05 20:03:45 UTC) #4
lazyboy
https://chromiumcodereview.appspot.com/13712002/diff/7001/chrome/test/data/extensions/platform_apps/web_view/geolocation/embedder_has_permission/embedder.js File chrome/test/data/extensions/platform_apps/web_view/geolocation/embedder_has_permission/embedder.js (right): https://chromiumcodereview.appspot.com/13712002/diff/7001/chrome/test/data/extensions/platform_apps/web_view/geolocation/embedder_has_permission/embedder.js#newcode73 chrome/test/data/extensions/platform_apps/web_view/geolocation/embedder_has_permission/embedder.js:73: embedder.test.assertEq = function(a, b, opt) { On 2013/04/05 20:03:46, ...
7 years, 8 months ago (2013-04-05 20:38:32 UTC) #5
mthiesse
Looking at the how geolocation requests work I think we should consider making some changes ...
7 years, 8 months ago (2013-04-09 15:25:39 UTC) #6
lazyboy
I've run the newly fixed and enabled tests in trybots for 50 - 100 times, ...
7 years, 8 months ago (2013-04-09 18:00:51 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/lazyboy@chromium.org/13712002/7005
7 years, 8 months ago (2013-04-09 18:19:20 UTC) #8
commit-bot: I haz the power
Failed to apply patch for chrome/browser/extensions/web_view_browsertest.cc: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
7 years, 8 months ago (2013-04-09 18:19:23 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/lazyboy@chromium.org/13712002/18002
7 years, 8 months ago (2013-04-09 19:42:58 UTC) #10
commit-bot: I haz the power
7 years, 8 months ago (2013-04-09 22:11:20 UTC) #11
Message was sent while issue was closed.
Change committed as 193230

Powered by Google App Engine
This is Rietveld 408576698