Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1322)

Unified Diff: chrome/browser/instant/instant_browsertest.cc

Issue 8369012: Add a test for Instant not treating intranet paths as searches. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/instant/instant_browsertest.cc
diff --git a/chrome/browser/instant/instant_browsertest.cc b/chrome/browser/instant/instant_browsertest.cc
index 9d7cc671acce0abb987728717c7f0cf903523905..5ee9c4f462d1adebdf96b96df15ee86f8507e785 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:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698