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

Side by Side Diff: trunk/src/chrome/browser/autocomplete/history_quick_provider_unittest.cc

Issue 19714004: Revert 213148 "Add asserts to TestingProfile::CreateHistoryServi..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
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 "chrome/browser/autocomplete/history_quick_provider.h" 5 #include "chrome/browser/autocomplete/history_quick_provider.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 scoped_ptr<TestingProfile> profile_; 144 scoped_ptr<TestingProfile> profile_;
145 HistoryService* history_service_; 145 HistoryService* history_service_;
146 146
147 ACMatches ac_matches_; // The resulting matches after running RunTest. 147 ACMatches ac_matches_; // The resulting matches after running RunTest.
148 148
149 scoped_refptr<HistoryQuickProvider> provider_; 149 scoped_refptr<HistoryQuickProvider> provider_;
150 }; 150 };
151 151
152 void HistoryQuickProviderTest::SetUp() { 152 void HistoryQuickProviderTest::SetUp() {
153 profile_.reset(new TestingProfile()); 153 profile_.reset(new TestingProfile());
154 ASSERT_TRUE(profile_->CreateHistoryService(true, false)); 154 profile_->CreateHistoryService(true, false);
155 profile_->CreateBookmarkModel(true); 155 profile_->CreateBookmarkModel(true);
156 ui_test_utils::WaitForBookmarkModelToLoad(profile_.get()); 156 ui_test_utils::WaitForBookmarkModelToLoad(profile_.get());
157 profile_->BlockUntilHistoryIndexIsRefreshed(); 157 profile_->BlockUntilHistoryIndexIsRefreshed();
158 history_service_ = 158 history_service_ =
159 HistoryServiceFactory::GetForProfile(profile_.get(), 159 HistoryServiceFactory::GetForProfile(profile_.get(),
160 Profile::EXPLICIT_ACCESS); 160 Profile::EXPLICIT_ACCESS);
161 EXPECT_TRUE(history_service_); 161 EXPECT_TRUE(history_service_);
162 provider_ = new HistoryQuickProvider(this, profile_.get()); 162 provider_ = new HistoryQuickProvider(this, profile_.get());
163 TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse( 163 TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse(
164 profile_.get(), &HistoryQuickProviderTest::CreateTemplateURLService); 164 profile_.get(), &HistoryQuickProviderTest::CreateTemplateURLService);
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 } 621 }
622 622
623 TEST_F(HQPOrderingTest, TEAMatch) { 623 TEST_F(HQPOrderingTest, TEAMatch) {
624 std::vector<std::string> expected_urls; 624 std::vector<std::string> expected_urls;
625 expected_urls.push_back("http://www.teamliquid.net/"); 625 expected_urls.push_back("http://www.teamliquid.net/");
626 expected_urls.push_back("http://www.teamliquid.net/tlpd"); 626 expected_urls.push_back("http://www.teamliquid.net/tlpd");
627 expected_urls.push_back("http://www.teamliquid.net/tlpd/korean/players"); 627 expected_urls.push_back("http://www.teamliquid.net/tlpd/korean/players");
628 RunTest(ASCIIToUTF16("tea"), expected_urls, true, 628 RunTest(ASCIIToUTF16("tea"), expected_urls, true,
629 ASCIIToUTF16("www.teamliquid.net")); 629 ASCIIToUTF16("www.teamliquid.net"));
630 } 630 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698