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

Unified Diff: chrome/browser/policy/policy_browsertest.cc

Issue 24733003: Update defaults for InstantExtended. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 7 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
Index: chrome/browser/policy/policy_browsertest.cc
diff --git a/chrome/browser/policy/policy_browsertest.cc b/chrome/browser/policy/policy_browsertest.cc
index df71d58d7f254af3bcba53f260ef73d490f6388a..963a5203558545cfff9e09d7080fb37c9ba6803e 100644
--- a/chrome/browser/policy/policy_browsertest.cc
+++ b/chrome/browser/policy/policy_browsertest.cc
@@ -786,7 +786,9 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, BookmarkBarEnabled) {
EXPECT_EQ(BookmarkBar::SHOW, browser()->bookmark_bar_state());
// The NTP has special handling of the bookmark bar.
- ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUINewTabURL));
+ ui_test_utils::NavigateToURLWithDisposition(
+ browser(), GURL(chrome::kChromeUINewTabURL), CURRENT_TAB,
+ ui_test_utils::BROWSER_TEST_NONE);
EXPECT_EQ(BookmarkBar::SHOW, browser()->bookmark_bar_state());
policies.Set(key::kBookmarkBarEnabled, POLICY_LEVEL_MANDATORY,
@@ -996,7 +998,7 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, ForceSafeSearch) {
IN_PROC_BROWSER_TEST_F(PolicyTest, ReplaceSearchTerms) {
MakeRequestFail make_request_fail("search.example");
- chrome::EnableInstantExtendedAPIForTesting();
+ chrome::EnableQueryExtractionForTesting();
// Verifies that a default search is made using the provider configured via
// policy. Also checks that default search can be completely disabled.
@@ -1329,7 +1331,8 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, DeveloperToolsDisabled) {
EXPECT_FALSE(DevToolsWindow::GetDockedInstanceForInspectedTab(contents));
}
-IN_PROC_BROWSER_TEST_F(PolicyTest, WebStoreIconHidden) {
+// TODO(samarth): remove along with the NTP4 code.
+IN_PROC_BROWSER_TEST_F(PolicyTest, DISABLED_WebStoreIconHidden) {
#if defined(OS_WIN) && defined(USE_ASH)
// Disable this test in Metro+Ash for now (http://crbug.com/262796).
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests))
@@ -1702,8 +1705,8 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, HomepageLocation) {
POLICY_SCOPE_USER, base::Value::CreateBooleanValue(true), NULL);
UpdateProviderPolicy(policies);
EXPECT_TRUE(chrome::ExecuteCommand(browser(), IDC_HOME));
- content::WaitForLoadStop(contents);
- EXPECT_TRUE(chrome::IsNTPURL(contents->GetURL(),browser()->profile()));
+ contents = browser()->tab_strip_model()->GetActiveWebContents();
+ EXPECT_TRUE(chrome::IsNTPURL(contents->GetURL(), browser()->profile()));
}
IN_PROC_BROWSER_TEST_F(PolicyTest, IncognitoEnabled) {
@@ -2404,7 +2407,12 @@ IN_PROC_BROWSER_TEST_P(RestoreOnStartupPolicyTest, RunTest) {
int size = static_cast<int>(expected_urls_.size());
EXPECT_EQ(size, model->count());
for (int i = 0; i < size && i < model->count(); ++i) {
- EXPECT_EQ(expected_urls_[i], model->GetWebContentsAt(i)->GetURL());
+ if (expected_urls_[i] == GURL(chrome::kChromeUINewTabURL)) {
+ EXPECT_TRUE(chrome::IsNTPURL(model->GetWebContentsAt(i)->GetURL(),
+ browser()->profile()));
+ } else {
+ EXPECT_EQ(expected_urls_[i], model->GetWebContentsAt(i)->GetURL());
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698