| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_input.h" | 9 #include "chrome/browser/autocomplete/autocomplete_input.h" |
| 10 #include "chrome/browser/autocomplete/autocomplete_match.h" | 10 #include "chrome/browser/autocomplete/autocomplete_match.h" |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 // Make sure that tabbing away from an empty omnibar causes a revert | 150 // Make sure that tabbing away from an empty omnibar causes a revert |
| 151 // and select all. | 151 // and select all. |
| 152 LocationBar* location_bar = GetLocationBar(); | 152 LocationBar* location_bar = GetLocationBar(); |
| 153 OmniboxView* location_entry = location_bar->GetLocationEntry(); | 153 OmniboxView* location_entry = location_bar->GetLocationEntry(); |
| 154 EXPECT_EQ(UTF8ToUTF16(chrome::kAboutBlankURL), location_entry->GetText()); | 154 EXPECT_EQ(UTF8ToUTF16(chrome::kAboutBlankURL), location_entry->GetText()); |
| 155 location_entry->SetUserText(string16()); | 155 location_entry->SetUserText(string16()); |
| 156 content::WindowedNotificationObserver observer( | 156 content::WindowedNotificationObserver observer( |
| 157 content::NOTIFICATION_LOAD_STOP, | 157 content::NOTIFICATION_LOAD_STOP, |
| 158 content::NotificationService::AllSources()); | 158 content::NotificationService::AllSources()); |
| 159 chrome::AddSelectedTabWithURL(browser(), GURL(chrome::kAboutBlankURL), | 159 chrome::AddSelectedTabWithURL(browser(), GURL(chrome::kAboutBlankURL), |
| 160 content::PAGE_TRANSITION_START_PAGE); | 160 content::PAGE_TRANSITION_AUTO_TOPLEVEL); |
| 161 observer.Wait(); | 161 observer.Wait(); |
| 162 EXPECT_EQ(UTF8ToUTF16(chrome::kAboutBlankURL), location_entry->GetText()); | 162 EXPECT_EQ(UTF8ToUTF16(chrome::kAboutBlankURL), location_entry->GetText()); |
| 163 chrome::CloseTab(browser()); | 163 chrome::CloseTab(browser()); |
| 164 EXPECT_EQ(UTF8ToUTF16(chrome::kAboutBlankURL), location_entry->GetText()); | 164 EXPECT_EQ(UTF8ToUTF16(chrome::kAboutBlankURL), location_entry->GetText()); |
| 165 EXPECT_TRUE(location_entry->IsSelectAll()); | 165 EXPECT_TRUE(location_entry->IsSelectAll()); |
| 166 } | 166 } |
| 167 | 167 |
| 168 IN_PROC_BROWSER_TEST_F(AutocompleteBrowserTest, FocusSearch) { | 168 IN_PROC_BROWSER_TEST_F(AutocompleteBrowserTest, FocusSearch) { |
| 169 LocationBar* location_bar = GetLocationBar(); | 169 LocationBar* location_bar = GetLocationBar(); |
| 170 OmniboxView* location_entry = location_bar->GetLocationEntry(); | 170 OmniboxView* location_entry = location_bar->GetLocationEntry(); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 EXPECT_TRUE(autocomplete_controller->done()); | 301 EXPECT_TRUE(autocomplete_controller->done()); |
| 302 const AutocompleteResult& result = autocomplete_controller->result(); | 302 const AutocompleteResult& result = autocomplete_controller->result(); |
| 303 // 'App test' is also a substring of extension 'Packaged App Test'. | 303 // 'App test' is also a substring of extension 'Packaged App Test'. |
| 304 EXPECT_GT(result.size(), 2U) << AutocompleteResultAsString(result); | 304 EXPECT_GT(result.size(), 2U) << AutocompleteResultAsString(result); |
| 305 AutocompleteMatch match = result.match_at(0); | 305 AutocompleteMatch match = result.match_at(0); |
| 306 EXPECT_EQ(ASCIIToUTF16("App Test"), match.contents); | 306 EXPECT_EQ(ASCIIToUTF16("App Test"), match.contents); |
| 307 EXPECT_EQ(AutocompleteMatch::EXTENSION_APP, match.type); | 307 EXPECT_EQ(AutocompleteMatch::EXTENSION_APP, match.type); |
| 308 EXPECT_FALSE(match.deletable); | 308 EXPECT_FALSE(match.deletable); |
| 309 } | 309 } |
| 310 } | 310 } |
| OLD | NEW |