OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/message_loop.h" | 5 #include "base/message_loop.h" |
6 #include "base/string_util.h" | 6 #include "base/string_util.h" |
7 #include "chrome/browser/autocomplete/autocomplete.h" | 7 #include "chrome/browser/autocomplete/autocomplete.h" |
8 #include "chrome/common/notification_registrar.h" | 8 #include "chrome/common/notification_registrar.h" |
9 #include "chrome/common/notification_service.h" | 9 #include "chrome/common/notification_service.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 155 |
156 // The message loop will terminate when all autocomplete input has been | 156 // The message loop will terminate when all autocomplete input has been |
157 // collected. | 157 // collected. |
158 MessageLoop::current()->Run(); | 158 MessageLoop::current()->Run(); |
159 } | 159 } |
160 | 160 |
161 void AutocompleteProviderTest::Observe(NotificationType type, | 161 void AutocompleteProviderTest::Observe(NotificationType type, |
162 const NotificationSource& source, | 162 const NotificationSource& source, |
163 const NotificationDetails& details) { | 163 const NotificationDetails& details) { |
164 if (controller_->done()) { | 164 if (controller_->done()) { |
165 result_.CopyFrom(controller_->result()); | 165 result_.CopyFrom(*(Details<const AutocompleteResult>(details).ptr())); |
166 MessageLoop::current()->Quit(); | 166 MessageLoop::current()->Quit(); |
167 } | 167 } |
168 } | 168 } |
169 | 169 |
170 std::ostream& operator<<(std::ostream& os, | 170 std::ostream& operator<<(std::ostream& os, |
171 const AutocompleteResult::const_iterator& iter) { | 171 const AutocompleteResult::const_iterator& iter) { |
172 return os << static_cast<const AutocompleteMatch*>(&(*iter)); | 172 return os << static_cast<const AutocompleteMatch*>(&(*iter)); |
173 } | 173 } |
174 | 174 |
175 // Tests that the default selection is set properly when updating results. | 175 // Tests that the default selection is set properly when updating results. |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 EXPECT_EQ(input_cases[i].scheme.len, scheme.len) << "Input: " << | 321 EXPECT_EQ(input_cases[i].scheme.len, scheme.len) << "Input: " << |
322 input_cases[i].input; | 322 input_cases[i].input; |
323 EXPECT_EQ(input_cases[i].host.begin, host.begin) << "Input: " << | 323 EXPECT_EQ(input_cases[i].host.begin, host.begin) << "Input: " << |
324 input_cases[i].input; | 324 input_cases[i].input; |
325 EXPECT_EQ(input_cases[i].host.len, host.len) << "Input: " << | 325 EXPECT_EQ(input_cases[i].host.len, host.len) << "Input: " << |
326 input_cases[i].input; | 326 input_cases[i].input; |
327 } | 327 } |
328 } | 328 } |
329 | 329 |
330 } // namespace | 330 } // namespace |
OLD | NEW |