summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chrome_content_browser_client_browsertest.cc
diff options
context:
space:
mode:
authorsamarth@chromium.org <samarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-15 22:04:07 +0000
committersamarth@chromium.org <samarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-15 22:04:07 +0000
commit14ac41ff40ef4eb1c9369ac2fe590f67336084fe (patch)
tree464d284b09b8ef3333e8818651ba383ba0d467e0 /chrome/browser/chrome_content_browser_client_browsertest.cc
parentf47062588876c7a4db0e99311f0fd9e1b8c12a0e (diff)
downloadchromium_src-14ac41ff40ef4eb1c9369ac2fe590f67336084fe.zip
chromium_src-14ac41ff40ef4eb1c9369ac2fe590f67336084fe.tar.gz
chromium_src-14ac41ff40ef4eb1c9369ac2fe590f67336084fe.tar.bz2
Update defaults for InstantExtended.
Flip the InstantExtended New Tab page to on by default and remove the flags. Add a separate flag to control query in the omnibox (which is still off by default). Also fixes a ton of tests that needed adjusting for Instant Extended. Mostly the changes stem from the fact that we're prerendering the Instant Extended New Tab page which changes assumptions in a bunch of tests. BUG=297915 Review URL: https://codereview.chromium.org/24733003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228779 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chrome_content_browser_client_browsertest.cc')
-rw-r--r--chrome/browser/chrome_content_browser_client_browsertest.cc66
1 files changed, 0 insertions, 66 deletions
diff --git a/chrome/browser/chrome_content_browser_client_browsertest.cc b/chrome/browser/chrome_content_browser_client_browsertest.cc
index 6dbd60c..31f0981 100644
--- a/chrome/browser/chrome_content_browser_client_browsertest.cc
+++ b/chrome/browser/chrome_content_browser_client_browsertest.cc
@@ -3,10 +3,6 @@
// found in the LICENSE file.
#include "base/command_line.h"
-#include "base/metrics/field_trial.h"
-#include "chrome/browser/search/search.h"
-#include "chrome/browser/search_engines/template_url_service.h"
-#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_switches.h"
@@ -28,20 +24,6 @@ class ChromeContentBrowserClientBrowserTest : public InProcessBrowserTest {
return browser()->tab_strip_model()->GetWebContentsAt(0)->
GetController().GetLastCommittedEntry();
}
-
- void InstallTemplateURLWithNewTabPage(GURL new_tab_page_url) {
- TemplateURLService* template_url_service =
- TemplateURLServiceFactory::GetForProfile(browser()->profile());
- ui_test_utils::WaitForTemplateURLServiceToLoad(template_url_service);
-
- TemplateURLData data;
- data.SetURL("http://foo.com/url?bar={searchTerms}");
- data.new_tab_url = new_tab_page_url.spec();
- TemplateURL* template_url = new TemplateURL(browser()->profile(), data);
- // Takes ownership.
- template_url_service->Add(template_url);
- template_url_service->SetDefaultSearchProvider(template_url);
- }
};
IN_PROC_BROWSER_TEST_F(ChromeContentBrowserClientBrowserTest,
@@ -94,54 +76,6 @@ IN_PROC_BROWSER_TEST_F(ChromeContentBrowserClientBrowserTest,
EXPECT_EQ(url, entry->GetVirtualURL());
}
-class InstantNTPURLRewriteTest : public ChromeContentBrowserClientBrowserTest {
- public:
- virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
- // browsertest initially spins up a non-Instant renderer for about:blank.
- // In a real browser, navigating this renderer to the Instant new tab page
- // forks a new privileged Instant render process, but that warps
- // browsertest's fragile little mind; it just never navigates. We aren't
- // trying to test the process model here, so turn it off.
- CommandLine::ForCurrentProcess()->AppendSwitch(switches::kSingleProcess);
- }
-};
-
-IN_PROC_BROWSER_TEST_F(InstantNTPURLRewriteTest,
- UberURLHandler_InstantExtendedNewTabPage) {
- const GURL url_original("chrome://newtab");
- const GURL url_rewritten("https://example.com/newtab");
- InstallTemplateURLWithNewTabPage(url_rewritten);
- ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial("InstantExtended",
- "Group1 use_cacheable_ntp:1"));
- chrome::EnableInstantExtendedAPIForTesting();
-
- ui_test_utils::NavigateToURL(browser(), url_original);
- NavigationEntry* entry = GetLastCommittedEntry();
-
- ASSERT_TRUE(entry != NULL);
- EXPECT_EQ(url_rewritten, entry->GetURL());
- EXPECT_EQ(url_original, entry->GetVirtualURL());
-}
-
-IN_PROC_BROWSER_TEST_F(ChromeContentBrowserClientBrowserTest,
- UberURLHandler_InstantExtendedNewTabPageDisabled) {
- // Don't do the kSingleProcess shenanigans here (see the dual test) because
- // otherwise RenderViewImpl crashes in a paranoid fit on startup.
- const GURL url_original("chrome://newtab");
- const GURL url_rewritten("https://example.com/newtab");
- InstallTemplateURLWithNewTabPage(url_rewritten);
- ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial("InstantExtended",
- "Group1 use_cacheable_ntp:1"));
- chrome::DisableInstantExtendedAPIForTesting();
-
- ui_test_utils::NavigateToURL(browser(), url_original);
- NavigationEntry* entry = GetLastCommittedEntry();
-
- ASSERT_TRUE(entry != NULL);
- EXPECT_EQ(url_original, entry->GetURL());
- EXPECT_EQ(url_original, entry->GetVirtualURL());
-}
-
// Test that a basic navigation works in --site-per-process mode. This prevents
// regressions when that mode calls out into the ChromeContentBrowserClient,
// such as http://crbug.com/164223.