diff options
author | sreeram@chromium.org <sreeram@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-22 20:30:12 +0000 |
---|---|---|
committer | sreeram@chromium.org <sreeram@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-22 20:30:12 +0000 |
commit | 379b7bd0fda4578b99e9bd44326ecbae96871c9b (patch) | |
tree | d52cf63b49c80a6aa82bfcfb92eac54f5a755297 /chrome/browser/instant | |
parent | b58c28b8dbcb8782380d9021dab4dc1624a19028 (diff) | |
download | chromium_src-379b7bd0fda4578b99e9bd44326ecbae96871c9b.zip chromium_src-379b7bd0fda4578b99e9bd44326ecbae96871c9b.tar.gz chromium_src-379b7bd0fda4578b99e9bd44326ecbae96871c9b.tar.bz2 |
Add a test for Instant not treating intranet paths as searches.
I've verified that the test fails without the bugfix in r105126.
BUG=99836
TEST=interactive_ui_tests InstantTest.IntranetPathLooksLikeSearch
Review URL: http://codereview.chromium.org/8369012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106860 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/instant')
-rw-r--r-- | chrome/browser/instant/instant_browsertest.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/chrome/browser/instant/instant_browsertest.cc b/chrome/browser/instant/instant_browsertest.cc index 9d7cc67..5ee9c4f 100644 --- a/chrome/browser/instant/instant_browsertest.cc +++ b/chrome/browser/instant/instant_browsertest.cc @@ -60,6 +60,7 @@ #define MAYBE_DontPersistSearchbox DISABLED_DontPersistSearchbox #define MAYBE_PreloadsInstant DISABLED_PreloadsInstant #define MAYBE_ExperimentEnabled DISABLED_ExperimentEnabled +#define MAYBE_IntranetPathLooksLikeSearch DISABLED_IntranetPathLooksLikeSearch #else #define MAYBE_OnChangeEvent OnChangeEvent #define MAYBE_SetSuggestionsArrayOfStrings SetSuggestionsArrayOfStrings @@ -81,6 +82,7 @@ #define MAYBE_DontPersistSearchbox DontPersistSearchbox #define MAYBE_PreloadsInstant PreloadsInstant #define MAYBE_ExperimentEnabled ExperimentEnabled +#define MAYBE_IntranetPathLooksLikeSearch IntranetPathLooksLikeSearch #endif #if defined(OS_MACOSX) || defined(OS_LINUX) @@ -903,6 +905,28 @@ IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE_PreloadsInstant) { EXPECT_TRUE(browser()->instant()->IsCurrent()); } +// Tests that instant doesn't fire for intranet paths that look like searches. +IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE_IntranetPathLooksLikeSearch) { + ASSERT_TRUE(test_server()->Start()); + EnableInstant(); + SetupInstantProvider("search.html"); + + // Unfocus the omnibox. This should delete any existing preview contents. + ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); + ui_test_utils::ClickOnView(browser(), VIEW_ID_TAB_CONTAINER); + + EXPECT_TRUE(browser()->instant()); + EXPECT_FALSE(HasPreview()); + + // Navigate to a URL that looks like a search (when the scheme is stripped). + // It's okay if the host is bogus or the navigation fails, since we only care + // that instant doesn't act on it. + ui_test_utils::NavigateToURL(browser(), GURL("http://baby/beluga")); + + // Instant should not have tried to load a preview for this "search". + EXPECT_FALSE(HasPreview()); +} + // Tests the INSTANT experiment of the field trial. class InstantFieldTrialInstantTest : public InstantTest { public: |