| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/autocomplete/autocomplete.h" | 5 #include "chrome/browser/autocomplete/autocomplete.h" |
| 6 #include "chrome/browser/autocomplete/autocomplete_edit.h" | 6 #include "chrome/browser/autocomplete/autocomplete_edit.h" |
| 7 #include "chrome/browser/autocomplete/autocomplete_edit_view.h" | 7 #include "chrome/browser/autocomplete/autocomplete_edit_view.h" |
| 8 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" | 8 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" |
| 9 #include "chrome/browser/browser.h" | 9 #include "chrome/browser/browser.h" |
| 10 #include "chrome/browser/browser_window.h" | 10 #include "chrome/browser/browser_window.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 ui_test_utils::RunMessageLoop(); | 57 ui_test_utils::RunMessageLoop(); |
| 58 } | 58 } |
| 59 } | 59 } |
| 60 | 60 |
| 61 virtual void Observe(NotificationType type, | 61 virtual void Observe(NotificationType type, |
| 62 const NotificationSource& source, | 62 const NotificationSource& source, |
| 63 const NotificationDetails& details) { | 63 const NotificationDetails& details) { |
| 64 DCHECK(type == NotificationType::HISTORY_LOADED); | 64 DCHECK(type == NotificationType::HISTORY_LOADED); |
| 65 MessageLoop::current()->Quit(); | 65 MessageLoop::current()->Quit(); |
| 66 } | 66 } |
| 67 | |
| 68 }; | 67 }; |
| 69 | 68 |
| 70 IN_PROC_BROWSER_TEST_F(AutocompleteBrowserTest, Basic) { | 69 IN_PROC_BROWSER_TEST_F(AutocompleteBrowserTest, Basic) { |
| 71 LocationBar* location_bar = GetLocationBar(); | 70 LocationBar* location_bar = GetLocationBar(); |
| 72 | 71 |
| 73 EXPECT_EQ(std::wstring(), location_bar->GetInputString()); | 72 EXPECT_EQ(std::wstring(), location_bar->GetInputString()); |
| 74 EXPECT_EQ(UTF8ToWide(chrome::kAboutBlankURL), | 73 EXPECT_EQ(UTF8ToWide(chrome::kAboutBlankURL), |
| 75 location_bar->location_entry()->GetText()); | 74 location_bar->location_entry()->GetText()); |
| 76 // TODO(phajdan.jr): check state of IsSelectAll when it's consistent across | 75 // TODO(phajdan.jr): check state of IsSelectAll when it's consistent across |
| 77 // platforms. | 76 // platforms. |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 location_bar->Revert(); | 131 location_bar->Revert(); |
| 133 | 132 |
| 134 EXPECT_EQ(std::wstring(), location_bar->GetInputString()); | 133 EXPECT_EQ(std::wstring(), location_bar->GetInputString()); |
| 135 EXPECT_EQ(UTF8ToWide(chrome::kAboutBlankURL), | 134 EXPECT_EQ(UTF8ToWide(chrome::kAboutBlankURL), |
| 136 location_bar->location_entry()->GetText()); | 135 location_bar->location_entry()->GetText()); |
| 137 EXPECT_FALSE(location_bar->location_entry()->IsSelectAll()); | 136 EXPECT_FALSE(location_bar->location_entry()->IsSelectAll()); |
| 138 const AutocompleteResult& result = autocomplete_controller->result(); | 137 const AutocompleteResult& result = autocomplete_controller->result(); |
| 139 EXPECT_TRUE(result.empty()) << AutocompleteResultAsString(result); | 138 EXPECT_TRUE(result.empty()) << AutocompleteResultAsString(result); |
| 140 } | 139 } |
| 141 } | 140 } |
| OLD | NEW |