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" |
11 #include "chrome/browser/autocomplete/autocomplete_match.h" | 11 #include "chrome/browser/autocomplete/autocomplete_match.h" |
12 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" | 12 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" |
13 #include "chrome/browser/extensions/extension_browsertest.h" | 13 #include "chrome/browser/extensions/extension_browsertest.h" |
14 #include "chrome/browser/extensions/extension_service.h" | 14 #include "chrome/browser/extensions/extension_service.h" |
15 #include "chrome/browser/history/history.h" | 15 #include "chrome/browser/history/history.h" |
16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
17 #include "chrome/browser/tabs/tab_strip_model.h" | 17 #include "chrome/browser/tabs/tab_strip_model.h" |
18 #include "chrome/browser/ui/browser.h" | 18 #include "chrome/browser/ui/browser.h" |
19 #include "chrome/browser/ui/browser_window.h" | 19 #include "chrome/browser/ui/browser_window.h" |
20 #include "chrome/browser/ui/omnibox/location_bar.h" | 20 #include "chrome/browser/ui/omnibox/location_bar.h" |
21 #include "chrome/browser/ui/omnibox/omnibox_view.h" | 21 #include "chrome/browser/ui/omnibox/omnibox_view.h" |
22 #include "chrome/common/chrome_paths.h" | 22 #include "chrome/common/chrome_paths.h" |
23 #include "chrome/common/url_constants.h" | 23 #include "chrome/common/url_constants.h" |
24 #include "chrome/test/in_process_browser_test.h" | 24 #include "chrome/test/in_process_browser_test.h" |
25 #include "chrome/test/ui_test_utils.h" | 25 #include "chrome/test/ui_test_utils.h" |
26 #include "content/browser/tab_contents/tab_contents.h" | 26 #include "content/browser/tab_contents/tab_contents.h" |
27 #include "content/common/notification_type.h" | 27 #include "content/common/content_notification_types.h" |
28 #include "testing/gtest/include/gtest/gtest.h" | 28 #include "testing/gtest/include/gtest/gtest.h" |
29 | 29 |
30 // Autocomplete test is flaky on ChromeOS. | 30 // Autocomplete test is flaky on ChromeOS. |
31 // http://crbug.com/52928 | 31 // http://crbug.com/52928 |
32 #if defined(OS_CHROMEOS) | 32 #if defined(OS_CHROMEOS) |
33 #define MAYBE_Autocomplete FLAKY_Autocomplete | 33 #define MAYBE_Autocomplete FLAKY_Autocomplete |
34 #else | 34 #else |
35 #define MAYBE_Autocomplete Autocomplete | 35 #define MAYBE_Autocomplete Autocomplete |
36 #endif | 36 #endif |
37 | 37 |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 const AutocompleteResult& result = autocomplete_controller->result(); | 311 const AutocompleteResult& result = autocomplete_controller->result(); |
312 // 'App test' is also a substring of extension 'Packaged App Test'. | 312 // 'App test' is also a substring of extension 'Packaged App Test'. |
313 EXPECT_GT(result.size(), 2U) << AutocompleteResultAsString(result); | 313 EXPECT_GT(result.size(), 2U) << AutocompleteResultAsString(result); |
314 AutocompleteMatch match = result.match_at(0); | 314 AutocompleteMatch match = result.match_at(0); |
315 EXPECT_EQ(ASCIIToUTF16("App Test"), match.contents); | 315 EXPECT_EQ(ASCIIToUTF16("App Test"), match.contents); |
316 EXPECT_EQ(AutocompleteMatch::EXTENSION_APP, match.type); | 316 EXPECT_EQ(AutocompleteMatch::EXTENSION_APP, match.type); |
317 EXPECT_FALSE(match.deletable); | 317 EXPECT_FALSE(match.deletable); |
318 location_bar->AcceptInput(); | 318 location_bar->AcceptInput(); |
319 } | 319 } |
320 } | 320 } |
OLD | NEW |