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

Side by Side Diff: chrome/browser/geolocation/geolocation_browsertest.cc

Issue 1409163006: Migrating tests to use EmbeddedTestServer (/chrome/browser misc) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 1 month 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include <string> 5 #include <string>
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 287
288 void GeolocationBrowserTest::SetUpOnMainThread() { 288 void GeolocationBrowserTest::SetUpOnMainThread() {
289 ui_test_utils::OverrideGeolocation(fake_latitude_, fake_longitude_); 289 ui_test_utils::OverrideGeolocation(fake_latitude_, fake_longitude_);
290 } 290 }
291 291
292 void GeolocationBrowserTest::TearDownInProcessBrowserTestFixture() { 292 void GeolocationBrowserTest::TearDownInProcessBrowserTestFixture() {
293 LOG(WARNING) << "TearDownInProcessBrowserTestFixture. Test Finished."; 293 LOG(WARNING) << "TearDownInProcessBrowserTestFixture. Test Finished.";
294 } 294 }
295 295
296 void GeolocationBrowserTest::Initialize(InitializationOptions options) { 296 void GeolocationBrowserTest::Initialize(InitializationOptions options) {
297 if (!embedded_test_server()->Started() && 297 if (!embedded_test_server()->Started() && !embedded_test_server()->Start()) {
298 !embedded_test_server()->InitializeAndWaitUntilReady()) {
299 ADD_FAILURE() << "Test server failed to start."; 298 ADD_FAILURE() << "Test server failed to start.";
300 return; 299 return;
301 } 300 }
302 301
303 current_url_ = embedded_test_server()->GetURL(html_for_tests_); 302 current_url_ = embedded_test_server()->GetURL(html_for_tests_);
304 if (options == INITIALIZATION_OFFTHERECORD) { 303 if (options == INITIALIZATION_OFFTHERECORD) {
305 current_browser_ = OpenURLOffTheRecord(browser()->profile(), current_url_); 304 current_browser_ = OpenURLOffTheRecord(browser()->profile(), current_url_);
306 } else { 305 } else {
307 current_browser_ = browser(); 306 current_browser_ = browser();
308 if (options == INITIALIZATION_NEWTAB) 307 if (options == INITIALIZATION_NEWTAB)
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 // Calling watchPosition should trigger the last usage update. 760 // Calling watchPosition should trigger the last usage update.
762 WatchPositionAndObservePermissionBubble(false); 761 WatchPositionAndObservePermissionBubble(false);
763 ExpectPosition(fake_latitude(), fake_longitude()); 762 ExpectPosition(fake_latitude(), fake_longitude());
764 763
765 // Last usage has been updated. 764 // Last usage has been updated.
766 EXPECT_EQ(GetHostContentSettingsMap()->GetLastUsage( 765 EXPECT_EQ(GetHostContentSettingsMap()->GetLastUsage(
767 current_url().GetOrigin(), 766 current_url().GetOrigin(),
768 current_url().GetOrigin(), 767 current_url().GetOrigin(),
769 CONTENT_SETTINGS_TYPE_GEOLOCATION).ToDoubleT(), 13); 768 CONTENT_SETTINGS_TYPE_GEOLOCATION).ToDoubleT(), 13);
770 } 769 }
OLDNEW
« no previous file with comments | « chrome/browser/favicon/content_favicon_driver_browsertest.cc ('k') | chrome/browser/history/history_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698