OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/message_loop.h" | 8 #include "base/message_loop.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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 } | 62 } |
63 | 63 |
64 virtual void OnURL(const GURL& url) { | 64 virtual void OnURL(const GURL& url) { |
65 urls_.push_back(url); | 65 urls_.push_back(url); |
66 } | 66 } |
67 | 67 |
68 virtual void OnComplete(bool success) { | 68 virtual void OnComplete(bool success) { |
69 BrowserThread::PostTask( | 69 BrowserThread::PostTask( |
70 BrowserThread::UI, | 70 BrowserThread::UI, |
71 FROM_HERE, | 71 FROM_HERE, |
72 new MessageLoop::QuitTask()); | 72 MessageLoop::QuitClosure()); |
73 } | 73 } |
74 | 74 |
75 std::vector<GURL>& urls() { return urls_; } | 75 std::vector<GURL>& urls() { return urls_; } |
76 | 76 |
77 private: | 77 private: |
78 std::vector<GURL> urls_; | 78 std::vector<GURL> urls_; |
79 | 79 |
80 DISALLOW_COPY_AND_ASSIGN(HistoryEnumerator); | 80 DISALLOW_COPY_AND_ASSIGN(HistoryEnumerator); |
81 }; | 81 }; |
82 | 82 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 WaitForHistoryBackendToRun(); | 204 WaitForHistoryBackendToRun(); |
205 | 205 |
206 { | 206 { |
207 std::vector<GURL> urls(GetHistoryContents()); | 207 std::vector<GURL> urls(GetHistoryContents()); |
208 ASSERT_EQ(1U, urls.size()); | 208 ASSERT_EQ(1U, urls.size()); |
209 EXPECT_EQ(GetTestUrl().spec(), urls[0].spec()); | 209 EXPECT_EQ(GetTestUrl().spec(), urls[0].spec()); |
210 } | 210 } |
211 } | 211 } |
212 | 212 |
213 } // namespace | 213 } // namespace |
OLD | NEW |