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 <sstream> | 5 #include <sstream> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/metrics/histogram_base.h" | 8 #include "base/metrics/histogram_base.h" |
9 #include "base/metrics/histogram_samples.h" | 9 #include "base/metrics/histogram_samples.h" |
10 #include "base/metrics/statistics_recorder.h" | 10 #include "base/metrics/statistics_recorder.h" |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 return true; | 220 return true; |
221 } | 221 } |
222 | 222 |
223 void BlockUntilHistoryProcessesPendingRequests() { | 223 void BlockUntilHistoryProcessesPendingRequests() { |
224 HistoryService* history = HistoryServiceFactory::GetForProfile( | 224 HistoryService* history = HistoryServiceFactory::GetForProfile( |
225 browser()->profile(), Profile::EXPLICIT_ACCESS); | 225 browser()->profile(), Profile::EXPLICIT_ACCESS); |
226 DCHECK(history); | 226 DCHECK(history); |
227 DCHECK(base::MessageLoop::current()); | 227 DCHECK(base::MessageLoop::current()); |
228 | 228 |
229 base::CancelableTaskTracker tracker; | 229 base::CancelableTaskTracker tracker; |
230 history->ScheduleDBTask(new QuittingHistoryDBTask(), &tracker); | 230 history->ScheduleDBTask( |
| 231 scoped_ptr<history::HistoryDBTask>( |
| 232 new QuittingHistoryDBTask()), |
| 233 &tracker); |
231 base::MessageLoop::current()->Run(); | 234 base::MessageLoop::current()->Run(); |
232 } | 235 } |
233 | 236 |
234 int CountSearchProviderSuggestions() { | 237 int CountSearchProviderSuggestions() { |
235 return omnibox()->model()->autocomplete_controller()->search_provider()-> | 238 return omnibox()->model()->autocomplete_controller()->search_provider()-> |
236 matches().size(); | 239 matches().size(); |
237 } | 240 } |
238 | 241 |
239 int on_most_visited_change_calls_; | 242 int on_most_visited_change_calls_; |
240 int most_visited_items_count_; | 243 int most_visited_items_count_; |
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
974 stream << "link.href = \"" << result_url.spec() << "\";"; | 977 stream << "link.href = \"" << result_url.spec() << "\";"; |
975 stream << "document.body.appendChild(link);"; | 978 stream << "document.body.appendChild(link);"; |
976 stream << "link.click();"; | 979 stream << "link.click();"; |
977 EXPECT_TRUE(content::ExecuteScript(contents, stream.str())); | 980 EXPECT_TRUE(content::ExecuteScript(contents, stream.str())); |
978 | 981 |
979 content::WaitForLoadStop(contents); | 982 content::WaitForLoadStop(contents); |
980 std::string expected_title = | 983 std::string expected_title = |
981 "Referrer is " + instant_url().GetWithEmptyPath().spec(); | 984 "Referrer is " + instant_url().GetWithEmptyPath().spec(); |
982 EXPECT_EQ(ASCIIToUTF16(expected_title), contents->GetTitle()); | 985 EXPECT_EQ(ASCIIToUTF16(expected_title), contents->GetTitle()); |
983 } | 986 } |
OLD | NEW |