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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 LocationBar* GetLocationBar() const { | 59 LocationBar* GetLocationBar() const { |
60 return browser()->window()->GetLocationBar(); | 60 return browser()->window()->GetLocationBar(); |
61 } | 61 } |
62 | 62 |
63 AutocompleteController* GetAutocompleteController() const { | 63 AutocompleteController* GetAutocompleteController() const { |
64 return GetLocationBar()->location_entry()->model()->popup_model()-> | 64 return GetLocationBar()->location_entry()->model()->popup_model()-> |
65 autocomplete_controller(); | 65 autocomplete_controller(); |
66 } | 66 } |
67 }; | 67 }; |
68 | 68 |
69 #if defined(OS_WIN) || defined(OS_LINUX) | 69 IN_PROC_BROWSER_TEST_F(AutocompleteBrowserTest, Basic) { |
70 #define MAYBE_Basic FLAKY_Basic | |
71 #else | |
72 #define MAYBE_Basic Basic | |
73 #endif | |
74 IN_PROC_BROWSER_TEST_F(AutocompleteBrowserTest, MAYBE_Basic) { | |
75 LocationBar* location_bar = GetLocationBar(); | 70 LocationBar* location_bar = GetLocationBar(); |
76 | 71 |
77 EXPECT_TRUE(location_bar->GetInputString().empty()); | 72 EXPECT_TRUE(location_bar->GetInputString().empty()); |
78 EXPECT_EQ(UTF8ToUTF16(chrome::kAboutBlankURL), | 73 EXPECT_EQ(UTF8ToUTF16(chrome::kAboutBlankURL), |
79 location_bar->location_entry()->GetText()); | 74 location_bar->location_entry()->GetText()); |
80 // 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 |
81 // platforms. | 76 // platforms. |
82 | 77 |
83 location_bar->FocusLocation(true); | 78 location_bar->FocusLocation(true); |
84 | 79 |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 const AutocompleteResult& result = autocomplete_controller->result(); | 315 const AutocompleteResult& result = autocomplete_controller->result(); |
321 // 'App test' is also a substring of extension 'Packaged App Test'. | 316 // 'App test' is also a substring of extension 'Packaged App Test'. |
322 EXPECT_GT(result.size(), 2U) << AutocompleteResultAsString(result); | 317 EXPECT_GT(result.size(), 2U) << AutocompleteResultAsString(result); |
323 AutocompleteMatch match = result.match_at(0); | 318 AutocompleteMatch match = result.match_at(0); |
324 EXPECT_EQ(ASCIIToUTF16("App Test"), match.contents); | 319 EXPECT_EQ(ASCIIToUTF16("App Test"), match.contents); |
325 EXPECT_EQ(AutocompleteMatch::EXTENSION_APP, match.type); | 320 EXPECT_EQ(AutocompleteMatch::EXTENSION_APP, match.type); |
326 EXPECT_FALSE(match.deletable); | 321 EXPECT_FALSE(match.deletable); |
327 location_bar->AcceptInput(); | 322 location_bar->AcceptInput(); |
328 } | 323 } |
329 } | 324 } |
OLD | NEW |