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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/string_util.h" | 6 #include "base/string_util.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_edit.h" | 9 #include "chrome/browser/autocomplete/autocomplete_edit.h" |
10 #include "chrome/browser/content_settings/host_content_settings_map.h" | 10 #include "chrome/browser/content_settings/host_content_settings_map.h" |
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 // Navigate to a new URL. The searchBox values should stay cleared. | 718 // Navigate to a new URL. The searchBox values should stay cleared. |
719 ui_test_utils::NavigateToURL( | 719 ui_test_utils::NavigateToURL( |
720 browser(), test_server()->GetURL("files/empty.html")); | 720 browser(), test_server()->GetURL("files/empty.html")); |
721 | 721 |
722 ASSERT_TRUE(GetStringFromJavascript(browser()->GetSelectedWebContents(), | 722 ASSERT_TRUE(GetStringFromJavascript(browser()->GetSelectedWebContents(), |
723 "window.chrome.searchBox.value", &value)); | 723 "window.chrome.searchBox.value", &value)); |
724 EXPECT_EQ("", value); | 724 EXPECT_EQ("", value); |
725 } | 725 } |
726 | 726 |
727 // Tests that instant search is preloaded whenever the omnibox gets focus. | 727 // Tests that instant search is preloaded whenever the omnibox gets focus. |
| 728 // PreloadsInstant fails on linux_chromeos trybots all the time, possibly |
| 729 // because of http://crbug.com/80118. |
| 730 #if defined(OS_CHROMEOS) |
| 731 IN_PROC_BROWSER_TEST_F(InstantTest, DISABLED_PreloadsInstant) { |
| 732 #else |
728 IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE(PreloadsInstant)) { | 733 IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE(PreloadsInstant)) { |
| 734 #endif |
729 CommandLine::ForCurrentProcess()->AppendSwitch( | 735 CommandLine::ForCurrentProcess()->AppendSwitch( |
730 switches::kPreloadInstantSearch); | 736 switches::kPreloadInstantSearch); |
731 ASSERT_TRUE(test_server()->Start()); | 737 ASSERT_TRUE(test_server()->Start()); |
732 EnableInstant(); | 738 EnableInstant(); |
733 SetupInstantProvider("instant.html"); | 739 SetupInstantProvider("instant.html"); |
734 | 740 |
735 // The omnibox gets focus before the test begins. At that time, there was no | 741 // The omnibox gets focus before the test begins. At that time, there was no |
736 // instant controller (which was only created after EnableInstant()), so no | 742 // instant controller (which was only created after EnableInstant()), so no |
737 // preloading happened. Unfocus the omnibox with ClickOnView(), so that when | 743 // preloading happened. Unfocus the omnibox with ClickOnView(), so that when |
738 // we focus it again, the controller will preload instant search. | 744 // we focus it again, the controller will preload instant search. |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
998 // Press <Enter> in the omnibox, causing the preview to be committed. | 1004 // Press <Enter> in the omnibox, causing the preview to be committed. |
999 WebContents* preview_tab = preview()->web_contents(); | 1005 WebContents* preview_tab = preview()->web_contents(); |
1000 ASSERT_TRUE(PressEnter()); | 1006 ASSERT_TRUE(PressEnter()); |
1001 | 1007 |
1002 // The preview contents should now be the active tab contents. | 1008 // The preview contents should now be the active tab contents. |
1003 EXPECT_FALSE(preview()); | 1009 EXPECT_FALSE(preview()); |
1004 EXPECT_FALSE(instant()->is_displayable()); | 1010 EXPECT_FALSE(instant()->is_displayable()); |
1005 EXPECT_FALSE(instant()->IsCurrent()); | 1011 EXPECT_FALSE(instant()->IsCurrent()); |
1006 EXPECT_EQ(preview_tab, browser()->GetSelectedWebContents()); | 1012 EXPECT_EQ(preview_tab, browser()->GetSelectedWebContents()); |
1007 } | 1013 } |
OLD | NEW |