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 "base/format_macros.h" | 5 #include "base/format_macros.h" |
6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
7 #include "base/stringprintf.h" | 7 #include "base/stringprintf.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/autocomplete/autocomplete.h" | 9 #include "chrome/browser/autocomplete/autocomplete.h" |
10 #include "chrome/browser/autocomplete/autocomplete_edit.h" | 10 #include "chrome/browser/autocomplete/autocomplete_edit.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 // http://code.google.com/p/chromium/issues/detail?id=38385 | 145 // http://code.google.com/p/chromium/issues/detail?id=38385 |
146 // Make sure that tabbing away from an empty omnibar causes a revert | 146 // Make sure that tabbing away from an empty omnibar causes a revert |
147 // and select all. | 147 // and select all. |
148 LocationBar* location_bar = GetLocationBar(); | 148 LocationBar* location_bar = GetLocationBar(); |
149 EXPECT_EQ(UTF8ToUTF16(chrome::kAboutBlankURL), | 149 EXPECT_EQ(UTF8ToUTF16(chrome::kAboutBlankURL), |
150 location_bar->location_entry()->GetText()); | 150 location_bar->location_entry()->GetText()); |
151 location_bar->location_entry()->SetUserText(string16()); | 151 location_bar->location_entry()->SetUserText(string16()); |
152 ui_test_utils::WindowedNotificationObserver observer( | 152 ui_test_utils::WindowedNotificationObserver observer( |
153 content::NOTIFICATION_LOAD_STOP, NotificationService::AllSources()); | 153 content::NOTIFICATION_LOAD_STOP, NotificationService::AllSources()); |
154 browser()->AddSelectedTabWithURL(GURL(chrome::kAboutBlankURL), | 154 browser()->AddSelectedTabWithURL(GURL(chrome::kAboutBlankURL), |
155 PageTransition::START_PAGE); | 155 content::PAGE_TRANSITION_START_PAGE); |
156 observer.Wait(); | 156 observer.Wait(); |
157 EXPECT_EQ(UTF8ToUTF16(chrome::kAboutBlankURL), | 157 EXPECT_EQ(UTF8ToUTF16(chrome::kAboutBlankURL), |
158 location_bar->location_entry()->GetText()); | 158 location_bar->location_entry()->GetText()); |
159 browser()->CloseTab(); | 159 browser()->CloseTab(); |
160 EXPECT_EQ(UTF8ToUTF16(chrome::kAboutBlankURL), | 160 EXPECT_EQ(UTF8ToUTF16(chrome::kAboutBlankURL), |
161 location_bar->location_entry()->GetText()); | 161 location_bar->location_entry()->GetText()); |
162 EXPECT_TRUE(location_bar->location_entry()->IsSelectAll()); | 162 EXPECT_TRUE(location_bar->location_entry()->IsSelectAll()); |
163 } | 163 } |
164 | 164 |
165 IN_PROC_BROWSER_TEST_F(AutocompleteBrowserTest, FocusSearch) { | 165 IN_PROC_BROWSER_TEST_F(AutocompleteBrowserTest, FocusSearch) { |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 const AutocompleteResult& result = autocomplete_controller->result(); | 312 const AutocompleteResult& result = autocomplete_controller->result(); |
313 // 'App test' is also a substring of extension 'Packaged App Test'. | 313 // 'App test' is also a substring of extension 'Packaged App Test'. |
314 EXPECT_GT(result.size(), 2U) << AutocompleteResultAsString(result); | 314 EXPECT_GT(result.size(), 2U) << AutocompleteResultAsString(result); |
315 AutocompleteMatch match = result.match_at(0); | 315 AutocompleteMatch match = result.match_at(0); |
316 EXPECT_EQ(ASCIIToUTF16("App Test"), match.contents); | 316 EXPECT_EQ(ASCIIToUTF16("App Test"), match.contents); |
317 EXPECT_EQ(AutocompleteMatch::EXTENSION_APP, match.type); | 317 EXPECT_EQ(AutocompleteMatch::EXTENSION_APP, match.type); |
318 EXPECT_FALSE(match.deletable); | 318 EXPECT_FALSE(match.deletable); |
319 location_bar->AcceptInput(); | 319 location_bar->AcceptInput(); |
320 } | 320 } |
321 } | 321 } |
OLD | NEW |