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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 } // namespace | 48 } // namespace |
49 | 49 |
50 class AutocompleteBrowserTest : public ExtensionBrowserTest { | 50 class AutocompleteBrowserTest : public ExtensionBrowserTest { |
51 protected: | 51 protected: |
52 LocationBar* GetLocationBar() const { | 52 LocationBar* GetLocationBar() const { |
53 return browser()->window()->GetLocationBar(); | 53 return browser()->window()->GetLocationBar(); |
54 } | 54 } |
55 | 55 |
56 AutocompleteController* GetAutocompleteController() const { | 56 AutocompleteController* GetAutocompleteController() const { |
57 return GetLocationBar()->GetLocationEntry()->model()->popup_model()-> | 57 return GetLocationBar()->GetLocationEntry()->GetModel()->popup_model()-> |
58 autocomplete_controller(); | 58 autocomplete_controller(); |
59 } | 59 } |
60 }; | 60 }; |
61 | 61 |
62 IN_PROC_BROWSER_TEST_F(AutocompleteBrowserTest, Basic) { | 62 IN_PROC_BROWSER_TEST_F(AutocompleteBrowserTest, Basic) { |
63 LocationBar* location_bar = GetLocationBar(); | 63 LocationBar* location_bar = GetLocationBar(); |
64 OmniboxView* location_entry = location_bar->GetLocationEntry(); | 64 OmniboxView* location_entry = location_bar->GetLocationEntry(); |
65 | 65 |
66 EXPECT_TRUE(location_bar->GetInputString().empty()); | 66 EXPECT_TRUE(location_bar->GetInputString().empty()); |
67 EXPECT_EQ(UTF8ToUTF16(chrome::kAboutBlankURL), location_entry->GetText()); | 67 EXPECT_EQ(UTF8ToUTF16(chrome::kAboutBlankURL), location_entry->GetText()); |
(...skipping 233 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 |