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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 content::PAGE_TRANSITION_START_PAGE); | 163 content::PAGE_TRANSITION_START_PAGE); |
164 observer.Wait(); | 164 observer.Wait(); |
165 EXPECT_EQ(UTF8ToUTF16(chrome::kAboutBlankURL), | 165 EXPECT_EQ(UTF8ToUTF16(chrome::kAboutBlankURL), |
166 location_bar->location_entry()->GetText()); | 166 location_bar->location_entry()->GetText()); |
167 browser()->CloseTab(); | 167 browser()->CloseTab(); |
168 EXPECT_EQ(UTF8ToUTF16(chrome::kAboutBlankURL), | 168 EXPECT_EQ(UTF8ToUTF16(chrome::kAboutBlankURL), |
169 location_bar->location_entry()->GetText()); | 169 location_bar->location_entry()->GetText()); |
170 EXPECT_TRUE(location_bar->location_entry()->IsSelectAll()); | 170 EXPECT_TRUE(location_bar->location_entry()->IsSelectAll()); |
171 } | 171 } |
172 | 172 |
173 #if defined(OS_WINDOWS) || defined(OS_LINUX) | |
174 // http://crbug.com/104307 | |
175 #define FocusSearch FLAKY_FocusSearch | |
176 #endif | |
177 IN_PROC_BROWSER_TEST_F(AutocompleteBrowserTest, FocusSearch) { | 173 IN_PROC_BROWSER_TEST_F(AutocompleteBrowserTest, FocusSearch) { |
178 LocationBar* location_bar = GetLocationBar(); | 174 LocationBar* location_bar = GetLocationBar(); |
179 | 175 |
180 // Focus search when omnibox is blank | 176 // Focus search when omnibox is blank |
181 { | 177 { |
182 EXPECT_TRUE(location_bar->GetInputString().empty()); | 178 EXPECT_TRUE(location_bar->GetInputString().empty()); |
183 EXPECT_EQ(UTF8ToUTF16(chrome::kAboutBlankURL), | 179 EXPECT_EQ(UTF8ToUTF16(chrome::kAboutBlankURL), |
184 location_bar->location_entry()->GetText()); | 180 location_bar->location_entry()->GetText()); |
185 | 181 |
186 location_bar->FocusSearch(); | 182 location_bar->FocusSearch(); |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 const AutocompleteResult& result = autocomplete_controller->result(); | 320 const AutocompleteResult& result = autocomplete_controller->result(); |
325 // 'App test' is also a substring of extension 'Packaged App Test'. | 321 // 'App test' is also a substring of extension 'Packaged App Test'. |
326 EXPECT_GT(result.size(), 2U) << AutocompleteResultAsString(result); | 322 EXPECT_GT(result.size(), 2U) << AutocompleteResultAsString(result); |
327 AutocompleteMatch match = result.match_at(0); | 323 AutocompleteMatch match = result.match_at(0); |
328 EXPECT_EQ(ASCIIToUTF16("App Test"), match.contents); | 324 EXPECT_EQ(ASCIIToUTF16("App Test"), match.contents); |
329 EXPECT_EQ(AutocompleteMatch::EXTENSION_APP, match.type); | 325 EXPECT_EQ(AutocompleteMatch::EXTENSION_APP, match.type); |
330 EXPECT_FALSE(match.deletable); | 326 EXPECT_FALSE(match.deletable); |
331 location_bar->AcceptInput(); | 327 location_bar->AcceptInput(); |
332 } | 328 } |
333 } | 329 } |
OLD | NEW |