OLD | NEW |
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 #include "chrome/browser/search/instant_unittest_base.h" | 5 #include "chrome/browser/search/instant_unittest_base.h" |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
10 #include "chrome/browser/google/google_url_tracker.h" | 10 #include "chrome/browser/google/google_url_tracker.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 new metrics::SHA1EntropyProvider("42"))); | 30 new metrics::SHA1EntropyProvider("42"))); |
31 } | 31 } |
32 | 32 |
33 InstantUnitTestBase::~InstantUnitTestBase() { | 33 InstantUnitTestBase::~InstantUnitTestBase() { |
34 } | 34 } |
35 | 35 |
36 void InstantUnitTestBase::SetUp() { | 36 void InstantUnitTestBase::SetUp() { |
37 SetUpHelper(); | 37 SetUpHelper(); |
38 } | 38 } |
39 | 39 |
40 void InstantUnitTestBase::SetUpWithoutCacheableNTP() { | |
41 ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial( | |
42 "InstantExtended", "Group1 use_cacheable_ntp:0")); | |
43 SetUpHelper(); | |
44 } | |
45 | |
46 void InstantUnitTestBase::SetUpHelper() { | 40 void InstantUnitTestBase::SetUpHelper() { |
47 chrome::EnableQueryExtractionForTesting(); | 41 chrome::EnableQueryExtractionForTesting(); |
48 BrowserWithTestWindowTest::SetUp(); | 42 BrowserWithTestWindowTest::SetUp(); |
49 | 43 |
50 TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse( | 44 TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse( |
51 profile(), &TemplateURLServiceFactory::BuildInstanceFor); | 45 profile(), &TemplateURLServiceFactory::BuildInstanceFor); |
52 template_url_service_ = TemplateURLServiceFactory::GetForProfile(profile()); | 46 template_url_service_ = TemplateURLServiceFactory::GetForProfile(profile()); |
53 ui_test_utils::WaitForTemplateURLServiceToLoad(template_url_service_); | 47 ui_test_utils::WaitForTemplateURLServiceToLoad(template_url_service_); |
54 | 48 |
55 UIThreadSearchTermsData::SetGoogleBaseURL("https://www.google.com/"); | 49 UIThreadSearchTermsData::SetGoogleBaseURL("https://www.google.com/"); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 content::Source<Profile>(profile()->GetOriginalProfile()), | 91 content::Source<Profile>(profile()->GetOriginalProfile()), |
98 content::Details<GoogleURLTracker::UpdatedDetails>(&details)); | 92 content::Details<GoogleURLTracker::UpdatedDetails>(&details)); |
99 } | 93 } |
100 | 94 |
101 | 95 |
102 bool InstantUnitTestBase::IsInstantServiceObserver( | 96 bool InstantUnitTestBase::IsInstantServiceObserver( |
103 InstantServiceObserver* observer) { | 97 InstantServiceObserver* observer) { |
104 return instant_service_->observers_.HasObserver(observer); | 98 return instant_service_->observers_.HasObserver(observer); |
105 } | 99 } |
106 | 100 |
OLD | NEW |