| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "chrome/browser/browser_thread.h" | 8 #include "chrome/browser/browser_thread.h" |
| 9 #include "chrome/browser/history/history.h" | 9 #include "chrome/browser/history/history.h" |
| 10 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 } | 103 } |
| 104 | 104 |
| 105 void WaitForHistoryBackendToRun() { | 105 void WaitForHistoryBackendToRun() { |
| 106 CancelableRequestConsumerTSimple<int> request_consumer; | 106 CancelableRequestConsumerTSimple<int> request_consumer; |
| 107 scoped_refptr<HistoryDBTask> task(new WaitForHistoryTask()); | 107 scoped_refptr<HistoryDBTask> task(new WaitForHistoryTask()); |
| 108 HistoryService* history = GetHistoryService(); | 108 HistoryService* history = GetHistoryService(); |
| 109 BrowserThread::PostTask(BrowserThread::UI, | 109 BrowserThread::PostTask(BrowserThread::UI, |
| 110 FROM_HERE, | 110 FROM_HERE, |
| 111 NewRunnableMethod(history, | 111 NewRunnableMethod(history, |
| 112 &HistoryService::ScheduleDBTask, | 112 &HistoryService::ScheduleDBTask, |
| 113 task.get(), | 113 task, |
| 114 &request_consumer)); | 114 &request_consumer)); |
| 115 ui_test_utils::RunMessageLoop(); | 115 ui_test_utils::RunMessageLoop(); |
| 116 } | 116 } |
| 117 | 117 |
| 118 void ExpectEmptyHistory() { | 118 void ExpectEmptyHistory() { |
| 119 std::vector<GURL> urls(GetHistoryContents()); | 119 std::vector<GURL> urls(GetHistoryContents()); |
| 120 EXPECT_EQ(0U, urls.size()); | 120 EXPECT_EQ(0U, urls.size()); |
| 121 } | 121 } |
| 122 }; | 122 }; |
| 123 | 123 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 WaitForHistoryBackendToRun(); | 219 WaitForHistoryBackendToRun(); |
| 220 | 220 |
| 221 { | 221 { |
| 222 std::vector<GURL> urls(GetHistoryContents()); | 222 std::vector<GURL> urls(GetHistoryContents()); |
| 223 ASSERT_EQ(1U, urls.size()); | 223 ASSERT_EQ(1U, urls.size()); |
| 224 EXPECT_EQ(GetTestUrl().spec(), urls[0].spec()); | 224 EXPECT_EQ(GetTestUrl().spec(), urls[0].spec()); |
| 225 } | 225 } |
| 226 } | 226 } |
| 227 | 227 |
| 228 } // namespace | 228 } // namespace |
| OLD | NEW |