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

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: Fix test exclusion. 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..d26099e24297ed23916b4021bb94f9a855ce8bed 100644
--- a/chrome/browser/policy/policy_browsertest.cc
+++ b/chrome/browser/policy/policy_browsertest.cc
@@ -599,6 +599,11 @@ class PolicyTest : public InProcessBrowserTest {
}
virtual void SetUpOnMainThread() OVERRIDE {
+ // Wait for the InstantNTP prerendered contents to load.
+ content::WindowedNotificationObserver observer(
+ content::NOTIFICATION_LOAD_STOP,
+ content::NotificationService::AllSources());
+ observer.Wait();
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
base::Bind(chrome_browser_net::SetUrlRequestMocksEnabled, true));
@@ -786,7 +791,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 +1003,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 +1336,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))
@@ -2404,7 +2412,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