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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 // Check that the value is reflected and onsubmit is called. | 320 // Check that the value is reflected and onsubmit is called. |
321 EXPECT_EQ("true 1 0 1 true d false defghi true 3 3", | 321 EXPECT_EQ("true 1 0 1 true d false defghi true 3 3", |
322 GetSearchStateAsString(preview_tab, true)); | 322 GetSearchStateAsString(preview_tab, true)); |
323 | 323 |
324 // Make sure the searchbox values were reset. | 324 // Make sure the searchbox values were reset. |
325 EXPECT_EQ("true 1 0 1 true d false false 0 0", | 325 EXPECT_EQ("true 1 0 1 true d false false 0 0", |
326 GetSearchStateAsString(preview_tab, false)); | 326 GetSearchStateAsString(preview_tab, false)); |
327 } | 327 } |
328 | 328 |
329 // Verify that the oncancel event is dispatched upon losing focus. | 329 // Verify that the oncancel event is dispatched upon losing focus. |
330 IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE(OnCancelEvent)) { | 330 IN_PROC_BROWSER_TEST_F(InstantTest, DISABLED_OnCancelEvent) { |
331 ASSERT_TRUE(test_server()->Start()); | 331 ASSERT_TRUE(test_server()->Start()); |
332 EnableInstant(); | 332 EnableInstant(); |
333 SetupInstantProvider("instant.html"); | 333 SetupInstantProvider("instant.html"); |
334 DetermineInstantSupport(); | 334 DetermineInstantSupport(); |
335 SearchAndWaitForPreviewToShow(); | 335 SearchAndWaitForPreviewToShow(); |
336 | 336 |
337 EXPECT_TRUE(preview()); | 337 EXPECT_TRUE(preview()); |
338 EXPECT_TRUE(instant()->is_displayable()); | 338 EXPECT_TRUE(instant()->is_displayable()); |
339 EXPECT_TRUE(instant()->IsCurrent()); | 339 EXPECT_TRUE(instant()->IsCurrent()); |
340 EXPECT_EQ("defghi", UTF16ToUTF8(omnibox()->GetText())); | 340 EXPECT_EQ("defghi", UTF16ToUTF8(omnibox()->GetText())); |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 browser(), test_server()->GetURL("files/empty.html")); | 721 browser(), test_server()->GetURL("files/empty.html")); |
722 | 722 |
723 ASSERT_TRUE(GetStringFromJavascript(browser()->GetSelectedWebContents(), | 723 ASSERT_TRUE(GetStringFromJavascript(browser()->GetSelectedWebContents(), |
724 "window.chrome.searchBox.value", &value)); | 724 "window.chrome.searchBox.value", &value)); |
725 EXPECT_EQ("", value); | 725 EXPECT_EQ("", value); |
726 } | 726 } |
727 | 727 |
728 // Tests that instant search is preloaded whenever the omnibox gets focus. | 728 // Tests that instant search is preloaded whenever the omnibox gets focus. |
729 // PreloadsInstant fails on linux_chromeos trybots all the time, possibly | 729 // PreloadsInstant fails on linux_chromeos trybots all the time, possibly |
730 // because of http://crbug.com/80118. | 730 // because of http://crbug.com/80118. |
731 #if defined(OS_CHROMEOS) | 731 #if defined(OS_CHROMEOS) || defined(OS_MACOSX) |
732 IN_PROC_BROWSER_TEST_F(InstantTest, DISABLED_PreloadsInstant) { | 732 IN_PROC_BROWSER_TEST_F(InstantTest, DISABLED_PreloadsInstant) { |
733 #else | 733 #else |
734 IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE(PreloadsInstant)) { | 734 IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE(PreloadsInstant)) { |
735 #endif | 735 #endif |
736 ASSERT_TRUE(test_server()->Start()); | 736 ASSERT_TRUE(test_server()->Start()); |
737 EnableInstant(); | 737 EnableInstant(); |
738 SetupInstantProvider("instant.html"); | 738 SetupInstantProvider("instant.html"); |
739 | 739 |
740 // The omnibox gets focus before the test begins. At that time, there was no | 740 // The omnibox gets focus before the test begins. At that time, there was no |
741 // instant controller (which was only created after EnableInstant()), so no | 741 // instant controller (which was only created after EnableInstant()), so no |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1003 // Press <Enter> in the omnibox, causing the preview to be committed. | 1003 // Press <Enter> in the omnibox, causing the preview to be committed. |
1004 WebContents* preview_tab = preview()->web_contents(); | 1004 WebContents* preview_tab = preview()->web_contents(); |
1005 ASSERT_TRUE(PressEnter()); | 1005 ASSERT_TRUE(PressEnter()); |
1006 | 1006 |
1007 // The preview contents should now be the active tab contents. | 1007 // The preview contents should now be the active tab contents. |
1008 EXPECT_FALSE(preview()); | 1008 EXPECT_FALSE(preview()); |
1009 EXPECT_FALSE(instant()->is_displayable()); | 1009 EXPECT_FALSE(instant()->is_displayable()); |
1010 EXPECT_FALSE(instant()->IsCurrent()); | 1010 EXPECT_FALSE(instant()->IsCurrent()); |
1011 EXPECT_EQ(preview_tab, browser()->GetSelectedWebContents()); | 1011 EXPECT_EQ(preview_tab, browser()->GetSelectedWebContents()); |
1012 } | 1012 } |
OLD | NEW |