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

Side by Side Diff: chrome/browser/ui/search/instant_extended_interactive_uitest.cc

Issue 14307023: chrome: Use base::MessageLoop. (Part 2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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 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 <sstream> 5 #include <sstream>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/field_trial.h" 8 #include "base/metrics/field_trial.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 class QuittingHistoryDBTask : public history::HistoryDBTask { 86 class QuittingHistoryDBTask : public history::HistoryDBTask {
87 public: 87 public:
88 QuittingHistoryDBTask() {} 88 QuittingHistoryDBTask() {}
89 89
90 virtual bool RunOnDBThread(history::HistoryBackend* backend, 90 virtual bool RunOnDBThread(history::HistoryBackend* backend,
91 history::HistoryDatabase* db) OVERRIDE { 91 history::HistoryDatabase* db) OVERRIDE {
92 return true; 92 return true;
93 } 93 }
94 94
95 virtual void DoneRunOnMainThread() OVERRIDE { 95 virtual void DoneRunOnMainThread() OVERRIDE {
96 MessageLoop::current()->Quit(); 96 base::MessageLoop::current()->Quit();
97 } 97 }
98 98
99 private: 99 private:
100 virtual ~QuittingHistoryDBTask() {} 100 virtual ~QuittingHistoryDBTask() {}
101 101
102 DISALLOW_COPY_AND_ASSIGN(QuittingHistoryDBTask); 102 DISALLOW_COPY_AND_ASSIGN(QuittingHistoryDBTask);
103 }; 103 };
104 104
105 } // namespace 105 } // namespace
106 106
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 base::Time::Now(), false, history::SOURCE_BROWSED); 192 base::Time::Now(), false, history::SOURCE_BROWSED);
193 history->SetKeywordSearchTermsForURL( 193 history->SetKeywordSearchTermsForURL(
194 search, template_url->id(), term); 194 search, template_url->id(), term);
195 return true; 195 return true;
196 } 196 }
197 197
198 void BlockUntilHistoryProcessesPendingRequests() { 198 void BlockUntilHistoryProcessesPendingRequests() {
199 HistoryService* history = HistoryServiceFactory::GetForProfile( 199 HistoryService* history = HistoryServiceFactory::GetForProfile(
200 browser()->profile(), Profile::EXPLICIT_ACCESS); 200 browser()->profile(), Profile::EXPLICIT_ACCESS);
201 DCHECK(history); 201 DCHECK(history);
202 DCHECK(MessageLoop::current()); 202 DCHECK(base::MessageLoop::current());
203 203
204 CancelableRequestConsumer consumer; 204 CancelableRequestConsumer consumer;
205 history->ScheduleDBTask(new QuittingHistoryDBTask(), &consumer); 205 history->ScheduleDBTask(new QuittingHistoryDBTask(), &consumer);
206 MessageLoop::current()->Run(); 206 base::MessageLoop::current()->Run();
207 } 207 }
208 208
209 int CountSearchProviderSuggestions() { 209 int CountSearchProviderSuggestions() {
210 return omnibox()->model()->autocomplete_controller()->search_provider()-> 210 return omnibox()->model()->autocomplete_controller()->search_provider()->
211 matches().size(); 211 matches().size();
212 } 212 }
213 213
214 int on_most_visited_change_calls_; 214 int on_most_visited_change_calls_;
215 int most_visited_items_count_; 215 int most_visited_items_count_;
216 int first_most_visited_item_id_; 216 int first_most_visited_item_id_;
(...skipping 2196 matching lines...) Expand 10 before | Expand all | Expand 10 after
2413 EXPECT_TRUE(instant()->ntp()->IsLocal()); 2413 EXPECT_TRUE(instant()->ntp()->IsLocal());
2414 2414
2415 // Overlay contents should be preloaded. 2415 // Overlay contents should be preloaded.
2416 ASSERT_NE(static_cast<InstantOverlay*>(NULL), instant()->overlay()); 2416 ASSERT_NE(static_cast<InstantOverlay*>(NULL), instant()->overlay());
2417 EXPECT_TRUE(instant()->overlay()->IsLocal()); 2417 EXPECT_TRUE(instant()->overlay()->IsLocal());
2418 2418
2419 // Instant tab contents should be preloaded. 2419 // Instant tab contents should be preloaded.
2420 ASSERT_NE(static_cast<InstantTab*>(NULL), instant()->instant_tab()); 2420 ASSERT_NE(static_cast<InstantTab*>(NULL), instant()->instant_tab());
2421 EXPECT_TRUE(instant()->instant_tab()->IsLocal()); 2421 EXPECT_TRUE(instant()->instant_tab()->IsLocal());
2422 } 2422 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/search/instant_controller.cc ('k') | chrome/browser/ui/search/instant_unload_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698