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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/stringprintf.h" | 6 #include "base/stringprintf.h" |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/autocomplete/autocomplete_edit.h" | 8 #include "chrome/browser/autocomplete/autocomplete_edit.h" |
9 #include "chrome/browser/content_settings/host_content_settings_map.h" | 9 #include "chrome/browser/content_settings/host_content_settings_map.h" |
10 #include "chrome/browser/instant/instant_controller.h" | 10 #include "chrome/browser/instant/instant_controller.h" |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 | 600 |
601 // When the response comes back that the page doesn't support instant the tab | 601 // When the response comes back that the page doesn't support instant the tab |
602 // should be closed. | 602 // should be closed. |
603 ui_test_utils::WaitForNotification(content::NOTIFICATION_TAB_CLOSED); | 603 ui_test_utils::WaitForNotification(content::NOTIFICATION_TAB_CLOSED); |
604 EXPECT_FALSE(browser()->instant()->IsShowingInstant()); | 604 EXPECT_FALSE(browser()->instant()->IsShowingInstant()); |
605 EXPECT_FALSE(browser()->instant()->is_displayable()); | 605 EXPECT_FALSE(browser()->instant()->is_displayable()); |
606 EXPECT_TRUE(browser()->instant()->is_active()); | 606 EXPECT_TRUE(browser()->instant()->is_active()); |
607 EXPECT_FALSE(browser()->instant()->IsCurrent()); | 607 EXPECT_FALSE(browser()->instant()->IsCurrent()); |
608 } | 608 } |
609 | 609 |
| 610 // Verifies that Instant previews aren't shown for crash URLs. |
| 611 IN_PROC_BROWSER_TEST_F(InstantTest, CrashUrlCancelsInstant) { |
| 612 ASSERT_TRUE(test_server()->Start()); |
| 613 EnableInstant(); |
| 614 ASSERT_NO_FATAL_FAILURE(SetupInstantProvider("empty.html")); |
| 615 ASSERT_NO_FATAL_FAILURE(FindLocationBar()); |
| 616 location_bar_->location_entry()->SetUserText(ASCIIToUTF16("chrome://crash")); |
| 617 ASSERT_TRUE(browser()->instant()); |
| 618 EXPECT_FALSE(browser()->instant()->IsShowingInstant()); |
| 619 } |
| 620 |
610 // Verifies transitioning from loading a non-search string to a search string | 621 // Verifies transitioning from loading a non-search string to a search string |
611 // with the provider not supporting instant works (meaning we don't display | 622 // with the provider not supporting instant works (meaning we don't display |
612 // anything). | 623 // anything). |
613 #if defined(OS_MACOSX) || defined(OS_LINUX) | 624 #if defined(OS_MACOSX) || defined(OS_LINUX) |
614 // Showing as flaky on Mac and Linux/ChromeOS | 625 // Showing as flaky on Mac and Linux/ChromeOS |
615 // http://crbug.com/70810 | 626 // http://crbug.com/70810 |
616 #define MAYBE_NonSearchToSearchDoesntSupportInstant \ | 627 #define MAYBE_NonSearchToSearchDoesntSupportInstant \ |
617 DISABLED_NonSearchToSearchDoesntSupportInstant | 628 DISABLED_NonSearchToSearchDoesntSupportInstant |
618 #else | 629 #else |
619 #define MAYBE_NonSearchToSearchDoesntSupportInstant \ | 630 #define MAYBE_NonSearchToSearchDoesntSupportInstant \ |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
786 | 797 |
787 // Check that the value is reflected and oncancel is called. | 798 // Check that the value is reflected and oncancel is called. |
788 EXPECT_EQ("true 0 1 1 1 d false def false 3 3", | 799 EXPECT_EQ("true 0 1 1 1 d false def false 3 3", |
789 GetSearchStateAsString(preview_, true)); | 800 GetSearchStateAsString(preview_, true)); |
790 | 801 |
791 // Make sure the searchbox values were reset. | 802 // Make sure the searchbox values were reset. |
792 EXPECT_EQ("true 0 1 1 1 d false false 0 0", | 803 EXPECT_EQ("true 0 1 1 1 d false false 0 0", |
793 GetSearchStateAsString(preview_, false)); | 804 GetSearchStateAsString(preview_, false)); |
794 } | 805 } |
795 | 806 |
796 // Make sure about:crash is shown. | |
797 // DISABLED http://crbug.com/80118 | |
798 #if defined(OS_LINUX) | |
799 IN_PROC_BROWSER_TEST_F(InstantTest, DISABLED_ShowAboutCrash) { | |
800 #else | |
801 IN_PROC_BROWSER_TEST_F(InstantTest, ShowAboutCrash) { | |
802 #endif // OS_LINUX | |
803 ASSERT_TRUE(test_server()->Start()); | |
804 EnableInstant(); | |
805 | |
806 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); | |
807 | |
808 ASSERT_NO_FATAL_FAILURE(SetLocationBarText(chrome::kAboutCrashURL)); | |
809 | |
810 // If we get here it means the preview was shown. If we time out, it means the | |
811 // preview was never shown. | |
812 } | |
813 | |
814 // DISABLED http://crbug.com/80118 | 807 // DISABLED http://crbug.com/80118 |
815 #if defined(OS_LINUX) | 808 #if defined(OS_LINUX) |
816 IN_PROC_BROWSER_TEST_F(InstantTest, DISABLED_InstantCompleteNever) { | 809 IN_PROC_BROWSER_TEST_F(InstantTest, DISABLED_InstantCompleteNever) { |
817 #else | 810 #else |
818 IN_PROC_BROWSER_TEST_F(InstantTest, InstantCompleteNever) { | 811 IN_PROC_BROWSER_TEST_F(InstantTest, InstantCompleteNever) { |
819 #endif // OS_LINUX | 812 #endif // OS_LINUX |
820 ASSERT_TRUE(test_server()->Start()); | 813 ASSERT_TRUE(test_server()->Start()); |
821 EnableInstant(); | 814 EnableInstant(); |
822 ASSERT_NO_FATAL_FAILURE(SetupInstantProvider("search.html")); | 815 ASSERT_NO_FATAL_FAILURE(SetupInstantProvider("search.html")); |
823 ASSERT_NO_FATAL_FAILURE(SetupLocationBar()); | 816 ASSERT_NO_FATAL_FAILURE(SetupLocationBar()); |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
947 ui_test_utils::NavigateToURL( | 940 ui_test_utils::NavigateToURL( |
948 browser(), | 941 browser(), |
949 GURL(test_server()->GetURL("files/instant/empty.html"))); | 942 GURL(test_server()->GetURL("files/instant/empty.html"))); |
950 bool result; | 943 bool result; |
951 ASSERT_TRUE(GetBoolFromJavascript( | 944 ASSERT_TRUE(GetBoolFromJavascript( |
952 browser()->GetSelectedTabContents(), | 945 browser()->GetSelectedTabContents(), |
953 "window.chrome.searchBox.value.length == 0", | 946 "window.chrome.searchBox.value.length == 0", |
954 &result)); | 947 &result)); |
955 EXPECT_TRUE(result); | 948 EXPECT_TRUE(result); |
956 } | 949 } |
OLD | NEW |