OLD | NEW |
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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 if (!history) | 63 if (!history) |
64 return; | 64 return; |
65 | 65 |
66 BrowserThread::PostTask( | 66 BrowserThread::PostTask( |
67 BrowserThread::UI, | 67 BrowserThread::UI, |
68 FROM_HERE, | 68 FROM_HERE, |
69 base::Bind(&HistoryService::IterateURLs, history, this)); | 69 base::Bind(&HistoryService::IterateURLs, history, this)); |
70 content::RunMessageLoop(); | 70 content::RunMessageLoop(); |
71 } | 71 } |
72 | 72 |
73 virtual void OnURL(const GURL& url) { | 73 virtual void OnURL(const history::URLRow& url_row) { |
74 urls_.push_back(url); | 74 urls_.push_back(url_row.url()); |
75 } | 75 } |
76 | 76 |
77 virtual void OnComplete(bool success) { | 77 virtual void OnComplete(bool success) { |
78 BrowserThread::PostTask( | 78 BrowserThread::PostTask( |
79 BrowserThread::UI, | 79 BrowserThread::UI, |
80 FROM_HERE, | 80 FROM_HERE, |
81 MessageLoop::QuitClosure()); | 81 MessageLoop::QuitClosure()); |
82 } | 82 } |
83 | 83 |
84 std::vector<GURL>& urls() { return urls_; } | 84 std::vector<GURL>& urls() { return urls_; } |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 // Mainly, this is to ensure we send a synchronous message to the renderer | 307 // Mainly, this is to ensure we send a synchronous message to the renderer |
308 // so that we're not susceptible (less susceptible?) to a race condition. | 308 // so that we're not susceptible (less susceptible?) to a race condition. |
309 // Should a race condition ever trigger, it won't result in flakiness. | 309 // Should a race condition ever trigger, it won't result in flakiness. |
310 int num = ui_test_utils::FindInPage( | 310 int num = ui_test_utils::FindInPage( |
311 chrome::GetActiveTabContents(browser()), ASCIIToUTF16("<img"), true, | 311 chrome::GetActiveTabContents(browser()), ASCIIToUTF16("<img"), true, |
312 true, NULL); | 312 true, NULL); |
313 EXPECT_GT(num, 0); | 313 EXPECT_GT(num, 0); |
314 EXPECT_EQ(ASCIIToUTF16("History"), | 314 EXPECT_EQ(ASCIIToUTF16("History"), |
315 chrome::GetActiveWebContents(browser())->GetTitle()); | 315 chrome::GetActiveWebContents(browser())->GetTitle()); |
316 } | 316 } |
OLD | NEW |