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

Unified Diff: chrome/browser/search/instant_service_unittest.cc

Issue 930853005: [Instant] Default Search Provider change redirects to local NTP in some cases (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: includes Created 5 years, 10 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/search/instant_service_observer.cc ('k') | chrome/browser/ui/browser_instant_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/search/instant_service_unittest.cc
diff --git a/chrome/browser/search/instant_service_unittest.cc b/chrome/browser/search/instant_service_unittest.cc
index 0d488df25d938c207a77ac891f72df6cb90f06c7..7d22a543b0f0047fa6e3ea4ff72f87dd560d2838 100644
--- a/chrome/browser/search/instant_service_unittest.cc
+++ b/chrome/browser/search/instant_service_unittest.cc
@@ -28,7 +28,7 @@
class MockInstantServiceObserver : public InstantServiceObserver {
public:
- MOCK_METHOD0(DefaultSearchProviderChanged, void());
+ MOCK_METHOD1(DefaultSearchProviderChanged, void(bool));
MOCK_METHOD1(OmniboxStartMarginChanged, void(int));
};
@@ -67,29 +67,29 @@ class InstantServiceEnabledTest : public InstantServiceTest {
};
TEST_F(InstantServiceEnabledTest, DispatchDefaultSearchProviderChanged) {
- EXPECT_CALL(*instant_service_observer_.get(), DefaultSearchProviderChanged())
- .Times(1);
+ EXPECT_CALL(*instant_service_observer_.get(),
+ DefaultSearchProviderChanged(false)).Times(1);
const std::string new_base_url = "https://bar.com/";
SetUserSelectedDefaultSearchProvider(new_base_url);
}
TEST_F(InstantServiceTest, DontDispatchGoogleURLUpdatedForNonGoogleURLs) {
- EXPECT_CALL(*instant_service_observer_.get(), DefaultSearchProviderChanged())
- .Times(1);
+ EXPECT_CALL(*instant_service_observer_.get(),
+ DefaultSearchProviderChanged(false)).Times(1);
const std::string new_dsp_url = "https://bar.com/";
SetUserSelectedDefaultSearchProvider(new_dsp_url);
testing::Mock::VerifyAndClearExpectations(instant_service_observer_.get());
- EXPECT_CALL(*instant_service_observer_.get(), DefaultSearchProviderChanged())
- .Times(0);
+ EXPECT_CALL(*instant_service_observer_.get(),
+ DefaultSearchProviderChanged(false)).Times(0);
const std::string new_base_url = "https://www.google.es/";
NotifyGoogleBaseURLUpdate(new_base_url);
}
TEST_F(InstantServiceTest, DispatchGoogleURLUpdated) {
- EXPECT_CALL(*instant_service_observer_.get(), DefaultSearchProviderChanged())
- .Times(1);
+ EXPECT_CALL(*instant_service_observer_.get(),
+ DefaultSearchProviderChanged(true)).Times(1);
const std::string new_base_url = "https://www.google.es/";
NotifyGoogleBaseURLUpdate(new_base_url);
@@ -123,8 +123,8 @@ TEST_F(InstantServiceTest, InstantSearchEnabled) {
TEST_F(InstantServiceEnabledTest,
ResetInstantSearchPrerenderer_DefaultProviderChanged) {
- EXPECT_CALL(*instant_service_observer_.get(), DefaultSearchProviderChanged())
- .Times(2);
+ EXPECT_CALL(*instant_service_observer_.get(),
+ DefaultSearchProviderChanged(false)).Times(2);
// Set a default search provider that doesn't support Instant.
TemplateURLData data;
@@ -146,8 +146,8 @@ TEST_F(InstantServiceEnabledTest,
TEST_F(InstantServiceEnabledTest,
ResetInstantSearchPrerenderer_GoogleBaseURLUpdated) {
- EXPECT_CALL(*instant_service_observer_.get(), DefaultSearchProviderChanged())
- .Times(1);
+ EXPECT_CALL(*instant_service_observer_.get(),
+ DefaultSearchProviderChanged(true)).Times(1);
InstantSearchPrerenderer* old_prerenderer = GetInstantSearchPrerenderer();
EXPECT_TRUE(old_prerenderer != NULL);
« no previous file with comments | « chrome/browser/search/instant_service_observer.cc ('k') | chrome/browser/ui/browser_instant_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698