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

Unified Diff: chrome/browser/geolocation/geolocation_browsertest.cc

Issue 2478803003: Remove DOMAutomationController::automation_id_ (Closed)
Patch Set: Rebasing... Created 3 years, 5 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 | « chrome/browser/extensions/browsertest_util.cc ('k') | chrome/test/data/geolocation/basic_geolocation.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/geolocation/geolocation_browsertest.cc
diff --git a/chrome/browser/geolocation/geolocation_browsertest.cc b/chrome/browser/geolocation/geolocation_browsertest.cc
index 34efb8e671fe8d162512833cd0a26095a0ef6987..5c40e9e438bbf0b2fec0fefed2d7435fd7f07d44 100644
--- a/chrome/browser/geolocation/geolocation_browsertest.cc
+++ b/chrome/browser/geolocation/geolocation_browsertest.cc
@@ -413,19 +413,16 @@ void GeolocationBrowserTest::ExpectValueFromScript(
bool GeolocationBrowserTest::SetPositionAndWaitUntilUpdated(double latitude,
double longitude) {
+ content::DOMMessageQueue dom_message_queue;
+
fake_latitude_ = latitude;
fake_longitude_ = longitude;
ui_test_utils::OverrideGeolocation(latitude, longitude);
- // Now wait until the new position gets to the script.
- // Control will return (a) if the update has already been received, or (b)
- // when the update is received. This will hang if the position is never
- // updated. Currently this expects the position to be updated once; if your
- // test updates it repeatedly, |position_updated| (JS) needs to change to an
- // int to count how often it's been updated.
- std::string result =
- RunScript(render_frame_host_, "checkIfGeopositionUpdated()");
- return result == "geoposition-updated";
+ std::string result;
+ if (!dom_message_queue.WaitForMessage(&result))
+ return false;
+ return result == "\"geoposition-updated\"";
}
int GeolocationBrowserTest::GetRequestQueueSize(
« no previous file with comments | « chrome/browser/extensions/browsertest_util.cc ('k') | chrome/test/data/geolocation/basic_geolocation.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698