diff options
Diffstat (limited to 'chrome/browser/ui')
34 files changed, 131 insertions, 119 deletions
diff --git a/chrome/browser/ui/ash/window_positioner_unittest.cc b/chrome/browser/ui/ash/window_positioner_unittest.cc index f3707b6..35d96bb 100644 --- a/chrome/browser/ui/ash/window_positioner_unittest.cc +++ b/chrome/browser/ui/ash/window_positioner_unittest.cc @@ -16,7 +16,6 @@ #include "chrome/test/base/testing_profile.h" #include "content/public/browser/browser_thread.h" #include "content/public/test/render_view_test.h" -#include "content/public/test/test_renderer_host.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/aura/env.h" #include "ui/aura/root_window.h" @@ -78,10 +77,6 @@ class WindowPositionerTest : public AshTestBase { private: WindowPositioner* window_positioner_; - // The existence of this object enables tests via - // RenderViewHostTester. - content::RenderViewHostTestEnabler rvh_test_enabler_; - // These two need to be deleted after everything else is gone. TestingProfile profile_; diff --git a/chrome/browser/ui/bookmarks/bookmark_unittest.cc b/chrome/browser/ui/bookmarks/bookmark_unittest.cc index e0b204e..e8ccb5c 100644 --- a/chrome/browser/ui/bookmarks/bookmark_unittest.cc +++ b/chrome/browser/ui/bookmarks/bookmark_unittest.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#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/tabs/tab_strip_model.h" @@ -41,6 +42,7 @@ TEST_F(BookmarkTest, DetachedBookmarkBarOnCustomNTP) { class BookmarkInstantExtendedTest : public BrowserWithTestWindowTest { public: BookmarkInstantExtendedTest() { + chrome::EnableInstantExtendedAPIForTesting(); } protected: diff --git a/chrome/browser/ui/browser_browsertest.cc b/chrome/browser/ui/browser_browsertest.cc index bbbf6bd..c4f0a0e 100644 --- a/chrome/browser/ui/browser_browsertest.cc +++ b/chrome/browser/ui/browser_browsertest.cc @@ -26,8 +26,6 @@ #include "chrome/browser/prefs/incognito_mode_prefs.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" -#include "chrome/browser/search/instant_service.h" -#include "chrome/browser/search/instant_service_factory.h" #include "chrome/browser/search/search.h" #include "chrome/browser/sessions/session_backend.h" #include "chrome/browser/sessions/session_service_factory.h" @@ -942,14 +940,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, RenderIdleTime) { base::FilePath(kTitle1File))); content::RenderProcessHost::iterator it( content::RenderProcessHost::AllHostsIterator()); - const InstantService* instant_service = - InstantServiceFactory::GetForProfile(browser()->profile()); for (; !it.IsAtEnd(); it.Advance()) { - // Ignore renderers in the Instant process (that may have been prerendered). - if (instant_service && instant_service->IsInstantProcess( - it.GetCurrentValue()->GetID())) { - continue; - } base::TimeDelta renderer_td = it.GetCurrentValue()->GetChildProcessIdleTime(); base::TimeDelta browser_td = base::TimeTicks::Now() - start; @@ -1020,8 +1011,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, CommandCreateAppShortcutInvalid) { // Urls that should not have shortcuts. GURL new_tab_url(chrome::kChromeUINewTabURL); - ui_test_utils::NavigateToURLWithDisposition( - browser(), new_tab_url, CURRENT_TAB, ui_test_utils::BROWSER_TEST_NONE); + ui_test_utils::NavigateToURL(browser(), new_tab_url); EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_CREATE_SHORTCUTS)); GURL history_url(chrome::kChromeUIHistoryURL); @@ -2433,7 +2423,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_GetSizeForNewRenderView) { ASSERT_TRUE(https_test_server.Start()); // Start with NTP. - ui_test_utils::NavigateToURL(browser(), GURL("chrome-internal://newtab")); + ui_test_utils::NavigateToURL(browser(), GURL("chrome://newtab")); ASSERT_EQ(BookmarkBar::DETACHED, browser()->bookmark_bar_state()); WebContents* web_contents = browser()->tab_strip_model()->GetActiveWebContents(); @@ -2490,7 +2480,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_GetSizeForNewRenderView) { // Navigate from NTP to a non-NTP page, resizing WebContentsView while // navigation entry is pending. - ui_test_utils::NavigateToURL(browser(), GURL("chrome-internal://newtab")); + ui_test_utils::NavigateToURL(browser(), GURL("chrome://newtab")); gfx::Size wcv_resize_insets(-34, -57); observer.set_wcv_resize_insets(wcv_resize_insets); ui_test_utils::NavigateToURL(browser(), diff --git a/chrome/browser/ui/browser_focus_uitest.cc b/chrome/browser/ui/browser_focus_uitest.cc index 9808868..869f43d 100644 --- a/chrome/browser/ui/browser_focus_uitest.cc +++ b/chrome/browser/ui/browser_focus_uitest.cc @@ -907,14 +907,11 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, EXPECT_FALSE(ui_test_utils::IsViewFocused(browser(), VIEW_ID_OMNIBOX)); } -// This functionality is currently broken. http://crbug.com/304865. -IN_PROC_BROWSER_TEST_F(BrowserFocusTest, DISABLED_FocusOnNavigate) { +IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FocusOnNavigate) { // Needed on Mac. ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); // Load the NTP. - ui_test_utils::NavigateToURLWithDisposition( - browser(), GURL(chrome::kChromeUINewTabURL), CURRENT_TAB, - ui_test_utils::BROWSER_TEST_NONE); + ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUINewTabURL)); EXPECT_TRUE(IsViewFocused(VIEW_ID_OMNIBOX)); // Navigate to another page. diff --git a/chrome/browser/ui/browser_instant_controller_unittest.cc b/chrome/browser/ui/browser_instant_controller_unittest.cc index 7227306..52540aa 100644 --- a/chrome/browser/ui/browser_instant_controller_unittest.cc +++ b/chrome/browser/ui/browser_instant_controller_unittest.cc @@ -97,7 +97,6 @@ class FakeWebContentsObserver : public content::WebContentsObserver { }; TEST_F(BrowserInstantControllerTest, DefaultSearchProviderChanged) { - chrome::EnableQueryExtractionForTesting(); size_t num_tests = arraysize(kTabReloadTestCases); ScopedVector<FakeWebContentsObserver> observers; for (size_t i = 0; i < num_tests; ++i) { @@ -136,7 +135,6 @@ TEST_F(BrowserInstantControllerTest, DefaultSearchProviderChanged) { } TEST_F(BrowserInstantControllerTest, GoogleBaseURLUpdated) { - chrome::EnableQueryExtractionForTesting(); const size_t num_tests = arraysize(kTabReloadTestCases); ScopedVector<FakeWebContentsObserver> observers; for (size_t i = 0; i < num_tests; ++i) { diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm index b06f3ea..892e5cc 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm @@ -340,6 +340,7 @@ class BookmarkBarControllerTest : public BookmarkBarControllerTestBase { virtual void SetUp() { BookmarkBarControllerTestBase::SetUp(); ASSERT_TRUE(browser()); + AddCommandLineSwitches(); bar_.reset( [[BookmarkBarControllerNoOpen alloc] @@ -351,6 +352,8 @@ class BookmarkBarControllerTest : public BookmarkBarControllerTestBase { InstallAndToggleBar(bar_.get()); } + virtual void AddCommandLineSwitches() {} + BookmarkBarControllerNoOpen* noOpenBar() { return (BookmarkBarControllerNoOpen*)bar_.get(); } @@ -1518,9 +1521,7 @@ TEST_F(BookmarkBarControllerTest, ShrinkOrHideView) { EXPECT_TRUE([view isHidden]); } -// TODO(samarth): fix for Instant Extended and re-enable. -// http://crbug.com/307205. -TEST_F(BookmarkBarControllerTest, DISABLED_LastBookmarkResizeBehavior) { +TEST_F(BookmarkBarControllerTest, LastBookmarkResizeBehavior) { BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile()); const BookmarkNode* root = model->bookmark_bar_node(); const std::string model_string("1b 2f:[ 2f1b 2f2b ] 3b "); @@ -1549,6 +1550,10 @@ TEST_F(BookmarkBarControllerTest, DISABLED_LastBookmarkResizeBehavior) { class BookmarkBarControllerWithInstantExtendedTest : public BookmarkBarControllerTest { public: + virtual void AddCommandLineSwitches() OVERRIDE { + CommandLine::ForCurrentProcess()->AppendSwitch( + switches::kEnableInstantExtendedAPI); + } }; TEST_F(BookmarkBarControllerWithInstantExtendedTest, @@ -1968,9 +1973,7 @@ TEST_F(BookmarkBarControllerDragDropTest, ControllerForNode) { EXPECT_EQ(expectedController, actualController); } -// TODO(samarth): fix for Instant Extended and re-enable. -// http://crbug.com/307205. -TEST_F(BookmarkBarControllerDragDropTest, DISABLED_DropPositionIndicator) { +TEST_F(BookmarkBarControllerDragDropTest, DropPositionIndicator) { BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile()); const BookmarkNode* root = model->bookmark_bar_node(); const std::string model_string("1b 2f:[ 2f1b 2f2b 2f3b ] 3b 4b "); diff --git a/chrome/browser/ui/cocoa/cocoa_profile_test.h b/chrome/browser/ui/cocoa/cocoa_profile_test.h index 0c6f1b3..93d681b 100644 --- a/chrome/browser/ui/cocoa/cocoa_profile_test.h +++ b/chrome/browser/ui/cocoa/cocoa_profile_test.h @@ -8,7 +8,6 @@ #include "base/memory/scoped_ptr.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #include "chrome/test/base/testing_profile_manager.h" -#include "content/public/test/test_renderer_host.h" namespace content { class TestBrowserThreadBundle; @@ -64,9 +63,6 @@ class CocoaProfileTest : public CocoaTest { TestingProfile* profile_; // Weak; owned by profile_manager_. scoped_ptr<Browser> browser_; - // The existence of this object enables tests via RenderViewHostTester. - content::RenderViewHostTestEnabler rvh_test_enabler_; - scoped_ptr<content::TestBrowserThreadBundle> thread_bundle_; }; diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac_unittest.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac_unittest.mm index 7def6f9..5e187b6 100644 --- a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac_unittest.mm +++ b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac_unittest.mm @@ -117,7 +117,7 @@ TEST_F(OmniboxViewMacTest, GetFieldFont) { } TEST_F(OmniboxViewMacTest, TabToAutocomplete) { - chrome::EnableQueryExtractionForTesting(); + chrome::EnableInstantExtendedAPIForTesting(); OmniboxViewMac view(NULL, profile(), NULL, NULL); // This is deleted by the omnibox view. diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_controller_unittest.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_controller_unittest.mm index d9b2dd6..3ffb531 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_strip_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/tabs/tab_strip_controller_unittest.mm @@ -160,9 +160,7 @@ class TabStripControllerTest : public CocoaProfileTest { // Test adding and removing tabs and making sure that views get added to // the tab strip. -// TODO(samarth): fix for Instant Extended and re-enable. -// http://crbug.com/307205. -TEST_F(TabStripControllerTest, DISABLED_AddRemoveTabs) { +TEST_F(TabStripControllerTest, AddRemoveTabs) { EXPECT_TRUE(model_->empty()); CreateTab(); EXPECT_EQ(model_->count(), 1); @@ -176,9 +174,7 @@ TEST_F(TabStripControllerTest, RearrangeTabs) { // TODO(pinkerton): Implement http://crbug.com/10899 } -// TODO(samarth): fix for Instant Extended and re-enable. -// http://crbug.com/307205. -TEST_F(TabStripControllerTest, DISABLED_CorrectToolTipText) { +TEST_F(TabStripControllerTest, CorrectToolTipText) { // Set tab 1 tooltip. TabView* tab1 = CreateTab(); [tab1 setToolTip:@"Tab1"]; @@ -255,9 +251,7 @@ TEST_F(TabStripControllerTest, TabCloseDuringDrag) { [[controller_ dragController] maybeStartDrag:event forTab:tab]; } -// TODO(samarth): fix for Instant Extended and re-enable. -// http://crbug.com/307205. -TEST_F(TabStripControllerTest, DISABLED_ViewAccessibility_Contents) { +TEST_F(TabStripControllerTest, ViewAccessibility_Contents) { NSArray* attrs = [tab_strip_ accessibilityAttributeNames]; ASSERT_TRUE([attrs containsObject:NSAccessibilityContentsAttribute]); @@ -272,9 +266,7 @@ TEST_F(TabStripControllerTest, DISABLED_ViewAccessibility_Contents) { ASSERT_TRUE([contentsArray containsObject:tab2]); } -// TODO(samarth): fix for Instant Extended and re-enable. -// http://crbug.com/307205. -TEST_F(TabStripControllerTest, DISABLED_ViewAccessibility_Value) { +TEST_F(TabStripControllerTest, ViewAccessibility_Value) { NSArray* attrs = [tab_strip_ accessibilityAttributeNames]; ASSERT_TRUE([attrs containsObject:NSAccessibilityValueAttribute]); diff --git a/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller_unittest.mm b/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller_unittest.mm index 99b25f6..19dd061 100644 --- a/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller_unittest.mm @@ -192,6 +192,7 @@ TEST_F(WrenchMenuControllerTest, RecentTabsElideTitle) { // Verify that |RecentTabsMenuModelDelegate| is deleted before the model // it's observing. TEST_F(WrenchMenuControllerTest, RecentTabDeleteOrder) { + chrome::EnableInstantExtendedAPIForTesting(); [controller_ menuNeedsUpdate:[controller_ menu]]; // If the delete order is wrong then the test will crash on exit. } diff --git a/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc b/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc index 25bae26..ec574a4 100644 --- a/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc +++ b/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc @@ -1287,10 +1287,8 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, PrepopulatePreserveLast) { FindBarController::kKeepResultsInFindBox); // Now create a second tab and load the same page. - ui_test_utils::NavigateToURLWithDisposition( - browser(), url, NEW_FOREGROUND_TAB, - ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB | - ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); + chrome::AddBlankTabAt(browser(), -1, true); + ui_test_utils::NavigateToURL(browser(), url); WebContents* web_contents_2 = browser()->tab_strip_model()->GetActiveWebContents(); EXPECT_NE(web_contents_1, web_contents_2); @@ -1523,10 +1521,8 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, EXPECT_EQ(ASCIIToUTF16("1 of 1"), GetMatchCountText()); // Next, do a search in a second tab. - ui_test_utils::NavigateToURLWithDisposition( - browser(), url, NEW_FOREGROUND_TAB, - ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB | - ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); + chrome::AddBlankTabAt(browser(), -1, true); + ui_test_utils::NavigateToURL(browser(), url); WebContents* web_contents_2 = browser()->tab_strip_model()->GetActiveWebContents(); FindInPageWchar(web_contents_2, L"text", kFwd, kIgnoreCase, &ordinal); diff --git a/chrome/browser/ui/fullscreen/fullscreen_controller_interactive_browsertest.cc b/chrome/browser/ui/fullscreen/fullscreen_controller_interactive_browsertest.cc index 5e246fe..6f57404 100644 --- a/chrome/browser/ui/fullscreen/fullscreen_controller_interactive_browsertest.cc +++ b/chrome/browser/ui/fullscreen/fullscreen_controller_interactive_browsertest.cc @@ -760,7 +760,7 @@ IN_PROC_BROWSER_TEST_F(FullscreenControllerInteractiveTest, AcceptCurrentFullscreenOrMouseLockRequest(); ASSERT_TRUE(IsMouseLocked()); - ui_test_utils::NavigateToURL(browser(), GURL("chrome://omnibox")); + ui_test_utils::NavigateToURL(browser(), GURL("chrome://newtab")); ASSERT_FALSE(IsMouseLocked()); } diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk_unittest.cc b/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk_unittest.cc index 92de253..742e9bb 100644 --- a/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk_unittest.cc +++ b/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk_unittest.cc @@ -15,7 +15,6 @@ #include "chrome/test/base/test_browser_window.h" #include "chrome/test/base/testing_profile.h" #include "content/public/test/test_browser_thread_bundle.h" -#include "content/public/test/test_renderer_host.h" #include "testing/gtest/include/gtest/gtest.h" // Dummy implementation that's good enough for the tests; we don't test @@ -57,9 +56,6 @@ class BookmarkBarGtkUnittest : public testing::Test { content::TestBrowserThreadBundle thread_bundle_; - // The existence of this object enables tests via RenderViewHostTester. - content::RenderViewHostTestEnabler rvh_test_enabler_; - scoped_ptr<TestingProfile> profile_; scoped_ptr<Browser> browser_; scoped_ptr<TabstripOriginProvider> origin_provider_; diff --git a/chrome/browser/ui/omnibox/omnibox_controller_unittest.cc b/chrome/browser/ui/omnibox/omnibox_controller_unittest.cc index 7a2e92c..4c855c3 100644 --- a/chrome/browser/ui/omnibox/omnibox_controller_unittest.cc +++ b/chrome/browser/ui/omnibox/omnibox_controller_unittest.cc @@ -73,6 +73,7 @@ TEST_F(OmniboxControllerTest, CheckDefaultAutocompleteProviders) { int providers_with_instant_extended = observed_providers; // TODO(beaudoin): remove TYPE_SEARCH once it's no longer needed to pass // the Instant suggestion through via FinalizeInstantQuery. + chrome::EnableInstantExtendedAPIForTesting(); CreateController(); AssertProviders(providers_with_instant_extended); } diff --git a/chrome/browser/ui/search/instant_extended_interactive_uitest.cc b/chrome/browser/ui/search/instant_extended_interactive_uitest.cc index 319d9e1..31aacb7 100644 --- a/chrome/browser/ui/search/instant_extended_interactive_uitest.cc +++ b/chrome/browser/ui/search/instant_extended_interactive_uitest.cc @@ -155,7 +155,7 @@ class InstantExtendedTest : public InProcessBrowserTest, } protected: virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { - chrome::EnableQueryExtractionForTesting(); + chrome::EnableInstantExtendedAPIForTesting(); ASSERT_TRUE(https_test_server().Start()); GURL instant_url = https_test_server().GetURL( "files/instant_extended.html?strk=1&"); @@ -281,7 +281,7 @@ class InstantExtendedPrefetchTest : public InstantExtendedTest { } virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { - chrome::EnableQueryExtractionForTesting(); + chrome::EnableInstantExtendedAPIForTesting(); ASSERT_TRUE(https_test_server().Start()); GURL instant_url = https_test_server().GetURL( "files/instant_extended.html?strk=1&"); @@ -332,6 +332,7 @@ class InstantPolicyTest : public ExtensionBrowserTest, public InstantTestBase { protected: virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { + chrome::EnableInstantExtendedAPIForTesting(); ASSERT_TRUE(https_test_server().Start()); GURL instant_url = https_test_server().GetURL( "files/instant_extended.html?strk=1&"); diff --git a/chrome/browser/ui/search/instant_extended_manual_interactive_uitest.cc b/chrome/browser/ui/search/instant_extended_manual_interactive_uitest.cc index a16e16e..0cc5290 100644 --- a/chrome/browser/ui/search/instant_extended_manual_interactive_uitest.cc +++ b/chrome/browser/ui/search/instant_extended_manual_interactive_uitest.cc @@ -72,7 +72,7 @@ class InstantExtendedManualTest : public InProcessBrowserTest, protected: virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { - chrome::EnableQueryExtractionForTesting(); + chrome::EnableInstantExtendedAPIForTesting(); } content::WebContents* active_tab() { diff --git a/chrome/browser/ui/search/instant_ntp_prerenderer.cc b/chrome/browser/ui/search/instant_ntp_prerenderer.cc index c2f4b86..a4300c0 100644 --- a/chrome/browser/ui/search/instant_ntp_prerenderer.cc +++ b/chrome/browser/ui/search/instant_ntp_prerenderer.cc @@ -75,10 +75,6 @@ InstantNTPPrerenderer::~InstantNTPPrerenderer() { } void InstantNTPPrerenderer::ReloadInstantNTP() { - // Stub out for unit tests that don't run on the UI message loop. - if (base::MessageLoop::current()->type() != base::MessageLoop::TYPE_UI) - return; - ResetNTP(GetInstantURL()); } diff --git a/chrome/browser/ui/search/instant_ntp_prerenderer_unittest.cc b/chrome/browser/ui/search/instant_ntp_prerenderer_unittest.cc index ba20cb5..c3899b7f 100644 --- a/chrome/browser/ui/search/instant_ntp_prerenderer_unittest.cc +++ b/chrome/browser/ui/search/instant_ntp_prerenderer_unittest.cc @@ -122,6 +122,7 @@ private: class InstantNTPPrerendererTest : public testing::Test { public: virtual void SetUp() OVERRIDE { + chrome::EnableInstantExtendedAPIForTesting(); instant_service_ = InstantServiceFactory::GetForProfile(&profile_); instant_ntp_prerenderer_.reset( new TestableInstantNTPPrerenderer(&profile_, instant_service_)); diff --git a/chrome/browser/ui/search/instant_page_unittest.cc b/chrome/browser/ui/search/instant_page_unittest.cc index ef21c49..eed68e8 100644 --- a/chrome/browser/ui/search/instant_page_unittest.cc +++ b/chrome/browser/ui/search/instant_page_unittest.cc @@ -64,6 +64,8 @@ class InstantPageTest : public ChromeRenderViewHostTestHarness { }; void InstantPageTest::SetUp() { + CommandLine::ForCurrentProcess()->AppendSwitch( + switches::kEnableInstantExtendedAPI); ChromeRenderViewHostTestHarness::SetUp(); SearchTabHelper::CreateForWebContents(web_contents()); } diff --git a/chrome/browser/ui/search/local_ntp_browsertest.cc b/chrome/browser/ui/search/local_ntp_browsertest.cc index cf18c74..19cf564 100644 --- a/chrome/browser/ui/search/local_ntp_browsertest.cc +++ b/chrome/browser/ui/search/local_ntp_browsertest.cc @@ -22,6 +22,7 @@ class LocalNTPTest : public InProcessBrowserTest, protected: virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { + chrome::EnableInstantExtendedAPIForTesting(); ASSERT_TRUE(https_test_server().Start()); GURL instant_url = https_test_server().GetURL( "files/local_ntp_browsertest.html?strk=1&"); diff --git a/chrome/browser/ui/search/search_delegate_unittest.cc b/chrome/browser/ui/search/search_delegate_unittest.cc index 713359e..c9fee29 100644 --- a/chrome/browser/ui/search/search_delegate_unittest.cc +++ b/chrome/browser/ui/search/search_delegate_unittest.cc @@ -14,6 +14,8 @@ typedef BrowserWithTestWindowTest SearchDelegateTest; // Test the propagation of search "mode" changes from the tab's search model to // the browser's search model. TEST_F(SearchDelegateTest, SearchModel) { + chrome::EnableInstantExtendedAPIForTesting(); + // Initial state. EXPECT_TRUE(browser()->search_model()->mode().is_default()); diff --git a/chrome/browser/ui/search/search_ipc_router_policy_unittest.cc b/chrome/browser/ui/search/search_ipc_router_policy_unittest.cc index 25f5d8a..1804007 100644 --- a/chrome/browser/ui/search/search_ipc_router_policy_unittest.cc +++ b/chrome/browser/ui/search/search_ipc_router_policy_unittest.cc @@ -16,6 +16,8 @@ class SearchIPCRouterPolicyTest : public ChromeRenderViewHostTestHarness { public: virtual void SetUp() { + CommandLine::ForCurrentProcess()->AppendSwitch( + switches::kEnableInstantExtendedAPI); ChromeRenderViewHostTestHarness::SetUp(); SearchTabHelper::CreateForWebContents(web_contents()); } diff --git a/chrome/browser/ui/search/search_ipc_router_unittest.cc b/chrome/browser/ui/search/search_ipc_router_unittest.cc index cc32e6e..1b53a39 100644 --- a/chrome/browser/ui/search/search_ipc_router_unittest.cc +++ b/chrome/browser/ui/search/search_ipc_router_unittest.cc @@ -66,6 +66,8 @@ class MockSearchIPCRouterPolicy : public SearchIPCRouter::Policy { class SearchIPCRouterTest : public ChromeRenderViewHostTestHarness { public: virtual void SetUp() { + CommandLine::ForCurrentProcess()->AppendSwitch( + switches::kEnableInstantExtendedAPI); ChromeRenderViewHostTestHarness::SetUp(); SearchTabHelper::CreateForWebContents(web_contents()); } diff --git a/chrome/browser/ui/search/search_model_unittest.cc b/chrome/browser/ui/search/search_model_unittest.cc index c8a5ee9..a1d0365 100644 --- a/chrome/browser/ui/search/search_model_unittest.cc +++ b/chrome/browser/ui/search/search_model_unittest.cc @@ -74,6 +74,8 @@ class SearchModelTest : public ChromeRenderViewHostTestHarness { }; void SearchModelTest::SetUp() { + CommandLine::ForCurrentProcess()->AppendSwitch( + switches::kEnableInstantExtendedAPI); ChromeRenderViewHostTestHarness::SetUp(); SearchTabHelper::CreateForWebContents(web_contents()); SearchTabHelper* search_tab_helper = diff --git a/chrome/browser/ui/search/search_tab_helper_unittest.cc b/chrome/browser/ui/search/search_tab_helper_unittest.cc index efe0239..7e8fc3a 100644 --- a/chrome/browser/ui/search/search_tab_helper_unittest.cc +++ b/chrome/browser/ui/search/search_tab_helper_unittest.cc @@ -43,6 +43,8 @@ class MockSearchIPCRouterDelegate : public SearchIPCRouter::Delegate { class SearchTabHelperTest : public ChromeRenderViewHostTestHarness { public: virtual void SetUp() { + CommandLine::ForCurrentProcess()->AppendSwitch( + switches::kEnableInstantExtendedAPI); ChromeRenderViewHostTestHarness::SetUp(); SearchTabHelper::CreateForWebContents(web_contents()); } diff --git a/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc b/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc index 74e4399..d76ca8d 100644 --- a/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc +++ b/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc @@ -22,7 +22,6 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_impl.h" #include "chrome/browser/profiles/profile_manager.h" -#include "chrome/browser/search/search.h" #include "chrome/browser/sessions/session_restore.h" #include "chrome/browser/signin/signin_promo.h" #include "chrome/browser/ui/browser.h" @@ -439,7 +438,8 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, AddCustomFirstRunTab) { EXPECT_EQ("title1.html", tab_strip->GetWebContentsAt(0)->GetURL().ExtractFileName()); - EXPECT_TRUE(chrome::IsInstantNTP(tab_strip->GetWebContentsAt(1))); + EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), + tab_strip->GetWebContentsAt(1)->GetURL()); EXPECT_EQ("title2.html", tab_strip->GetWebContentsAt(2)->GetURL().ExtractFileName()); EXPECT_EQ(internals::GetWelcomePageURL(), @@ -465,7 +465,8 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, SyncPromoNoWelcomePage) { EXPECT_EQ(signin::GetPromoURL(signin::SOURCE_START_PAGE, false), tab_strip->GetWebContentsAt(0)->GetURL()); } else { - EXPECT_TRUE(chrome::IsInstantNTP(tab_strip->GetWebContentsAt(0))); + EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), + tab_strip->GetWebContentsAt(0)->GetURL()); } } @@ -490,7 +491,8 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, SyncPromoWithWelcomePage) { EXPECT_EQ(signin::GetPromoURL(signin::SOURCE_START_PAGE, false), tab_strip->GetWebContentsAt(0)->GetURL()); } else { - EXPECT_TRUE(chrome::IsInstantNTP(tab_strip->GetWebContentsAt(0))); + EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), + tab_strip->GetWebContentsAt(0)->GetURL()); } EXPECT_EQ(internals::GetWelcomePageURL(), tab_strip->GetWebContentsAt(1)->GetURL()); @@ -822,8 +824,8 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, ASSERT_TRUE(new_browser); TabStripModel* tab_strip = new_browser->tab_strip_model(); ASSERT_EQ(1, tab_strip->count()); - EXPECT_TRUE(chrome::IsNTPURL(tab_strip->GetWebContentsAt(0)->GetURL(), - new_browser->profile())); + EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), + tab_strip->GetWebContentsAt(0)->GetURL()); // profile_urls opened the urls. ASSERT_EQ(1u, chrome::GetBrowserCount(profile_urls, original_desktop_type)); @@ -924,7 +926,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, ProfilesLaunchedAfterCrash) { TabStripModel* tab_strip = new_browser->tab_strip_model(); ASSERT_EQ(1, tab_strip->count()); content::WebContents* web_contents = tab_strip->GetWebContentsAt(0); - EXPECT_TRUE(chrome::IsNTPURL(web_contents->GetURL(), new_browser->profile())); + EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), web_contents->GetURL()); EXPECT_EQ(1U, InfoBarService::FromWebContents(web_contents)->infobar_count()); @@ -936,7 +938,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, ProfilesLaunchedAfterCrash) { tab_strip = new_browser->tab_strip_model(); ASSERT_EQ(1, tab_strip->count()); web_contents = tab_strip->GetWebContentsAt(0); - EXPECT_TRUE(chrome::IsNTPURL(web_contents->GetURL(), new_browser->profile())); + EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), web_contents->GetURL()); EXPECT_EQ(1U, InfoBarService::FromWebContents(web_contents)->infobar_count()); @@ -948,7 +950,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, ProfilesLaunchedAfterCrash) { tab_strip = new_browser->tab_strip_model(); ASSERT_EQ(1, tab_strip->count()); web_contents = tab_strip->GetWebContentsAt(0); - EXPECT_TRUE(chrome::IsNTPURL(web_contents->GetURL(), new_browser->profile())); + EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), web_contents->GetURL()); EXPECT_EQ(1U, InfoBarService::FromWebContents(web_contents)->infobar_count()); } @@ -1061,8 +1063,8 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorFirstRunTest, SyncPromoForbidden) { // Verify that the NTP and the welcome page are shown. TabStripModel* tab_strip = new_browser->tab_strip_model(); ASSERT_EQ(2, tab_strip->count()); - EXPECT_TRUE(chrome::IsNTPURL(tab_strip->GetWebContentsAt(0)->GetURL(), - new_browser->profile())); + EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), + tab_strip->GetWebContentsAt(0)->GetURL()); EXPECT_EQ(internals::GetWelcomePageURL(), tab_strip->GetWebContentsAt(1)->GetURL()); } @@ -1249,8 +1251,8 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorFirstRunTest, // not been replaced by the sync promo and no sync promo has been added. TabStripModel* tab_strip = new_browser->tab_strip_model(); ASSERT_EQ(2, tab_strip->count()); - EXPECT_TRUE(chrome::IsNTPURL(tab_strip->GetWebContentsAt(0)->GetURL(), - new_browser->profile())); + EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), + tab_strip->GetWebContentsAt(0)->GetURL()); EXPECT_EQ("title1.html", tab_strip->GetWebContentsAt(1)->GetURL().ExtractFileName()); } diff --git a/chrome/browser/ui/toolbar/toolbar_model_unittest.cc b/chrome/browser/ui/toolbar/toolbar_model_unittest.cc index 2e4168f..8680fe4 100644 --- a/chrome/browser/ui/toolbar/toolbar_model_unittest.cc +++ b/chrome/browser/ui/toolbar/toolbar_model_unittest.cc @@ -153,6 +153,7 @@ class ToolbarModelTest : public BrowserWithTestWindowTest { virtual void SetUp() OVERRIDE; protected: + void ResetDefaultTemplateURL(); void NavigateAndCheckText(const GURL& url, const string16& expected_text, const string16& expected_replace_text, @@ -160,6 +161,7 @@ class ToolbarModelTest : public BrowserWithTestWindowTest { bool should_display_url); private: + void ResetTemplateURLForInstant(const GURL& instant_url); void NavigateAndCheckTextImpl(const GURL& url, bool allow_search_term_replacement, const string16 expected_text, @@ -184,6 +186,10 @@ void ToolbarModelTest::SetUp() { UIThreadSearchTermsData::SetGoogleBaseURL("http://google.com/"); } +void ToolbarModelTest::ResetDefaultTemplateURL() { + ResetTemplateURLForInstant(GURL("http://does/not/exist")); +} + void ToolbarModelTest::NavigateAndCheckText( const GURL& url, const string16& expected_text, @@ -193,18 +199,36 @@ void ToolbarModelTest::NavigateAndCheckText( NavigateAndCheckTextImpl(url, false, expected_text, would_perform_search_term_replacement, should_display_url); - NavigateAndCheckTextImpl(url, true, - expected_replace_text, + NavigateAndCheckTextImpl(url, true, expected_replace_text, would_perform_search_term_replacement, should_display_url); } +void ToolbarModelTest::ResetTemplateURLForInstant(const GURL& instant_url) { + TemplateURLData data; + data.short_name = ASCIIToUTF16("Google"); + data.SetURL("{google:baseURL}search?q={searchTerms}"); + data.instant_url = instant_url.spec(); + data.search_terms_replacement_key = "{google:instantExtendedEnabledKey}"; + TemplateURL* search_template_url = new TemplateURL(profile(), data); + TemplateURLService* template_url_service = + TemplateURLServiceFactory::GetForProfile(profile()); + template_url_service->Add(search_template_url); + template_url_service->SetDefaultSearchProvider(search_template_url); + ASSERT_NE(0, search_template_url->id()); + template_url_service->Load(); +} + void ToolbarModelTest::NavigateAndCheckTextImpl( const GURL& url, bool allow_search_term_replacement, const string16 expected_text, bool would_perform_search_term_replacement, bool should_display_url) { + // The URL being navigated to should be treated as the Instant URL. Else + // there will be no search term extraction. + ResetTemplateURLForInstant(url); + // Check while loading. content::NavigationController* controller = &browser()->tab_strip_model()->GetWebContentsAt(0)->GetController(); @@ -254,19 +278,19 @@ TEST_F(ToolbarModelTest, ShouldDisplayURL) { AddTab(browser(), GURL(content::kAboutBlankURL)); for (size_t i = 0; i < arraysize(test_items); ++i) { const TestItem& test_item = test_items[i]; - NavigateAndCheckText(test_item.url, - test_item.expected_text, + NavigateAndCheckText(test_item.url, test_item.expected_text, test_item.expected_replace_text_inactive, false, test_item.should_display_url); } - chrome::EnableQueryExtractionForTesting(); + // Once we enable it, query extraction and search term replacement are + // enabled by default. + chrome::EnableInstantExtendedAPIForTesting(); EXPECT_TRUE(chrome::IsQueryExtractionEnabled()); EXPECT_TRUE(browser()->toolbar_model()->search_term_replacement_enabled()); for (size_t i = 0; i < arraysize(test_items); ++i) { const TestItem& test_item = test_items[i]; - NavigateAndCheckText(test_item.url, - test_item.expected_text, + NavigateAndCheckText(test_item.url, test_item.expected_text, test_item.expected_replace_text_active, test_item.would_perform_search_term_replacement, test_item.should_display_url); @@ -276,8 +300,7 @@ TEST_F(ToolbarModelTest, ShouldDisplayURL) { browser()->toolbar_model()->set_search_term_replacement_enabled(false); for (size_t i = 0; i < arraysize(test_items); ++i) { const TestItem& test_item = test_items[i]; - NavigateAndCheckText(test_item.url, - test_item.expected_text, + NavigateAndCheckText(test_item.url, test_item.expected_text, test_item.expected_replace_text_inactive, false, test_item.should_display_url); } @@ -285,7 +308,8 @@ TEST_F(ToolbarModelTest, ShouldDisplayURL) { // Verify that search terms are extracted while the page is loading. TEST_F(ToolbarModelTest, SearchTermsWhileLoading) { - chrome::EnableQueryExtractionForTesting(); + chrome::EnableInstantExtendedAPIForTesting(); + ResetDefaultTemplateURL(); AddTab(browser(), GURL(content::kAboutBlankURL)); // While loading, we should be willing to extract search terms. @@ -311,7 +335,7 @@ TEST_F(ToolbarModelTest, SearchTermsWhileLoading) { // search terms from URLs that start with that base URL even when they're not // secure. TEST_F(ToolbarModelTest, GoogleBaseURL) { - chrome::EnableQueryExtractionForTesting(); + chrome::EnableInstantExtendedAPIForTesting(); AddTab(browser(), GURL(content::kAboutBlankURL)); // If the Google base URL wasn't specified on the command line, then if it's diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc index 925f130..083e876 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc @@ -32,7 +32,6 @@ #include "content/public/browser/notification_service.h" #include "content/public/browser/page_navigator.h" #include "content/public/test/test_browser_thread.h" -#include "content/public/test/test_renderer_host.h" #include "grit/generated_resources.h" #include "ui/base/accessibility/accessibility_types.h" #include "ui/base/clipboard/clipboard.h" @@ -207,9 +206,6 @@ class BookmarkBarViewEventTestBase : public ViewEventTestBase { scoped_ptr<BookmarkBarView> bb_view_; TestingPageNavigator navigator_; - // The existence of this object enables tests via RenderViewHostTester. - content::RenderViewHostTestEnabler rvh_test_enabler_; - private: void AddTestData(bool big_menu) { const BookmarkNode* bb_node = model_->bookmark_bar_node(); diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_unittest.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_unittest.cc index af2d65a..6886d1d 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_unittest.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_unittest.cc @@ -8,6 +8,7 @@ #include "chrome/browser/apps/app_launcher_util.h" #include "chrome/browser/bookmarks/bookmark_test_helpers.h" #include "chrome/browser/profiles/profile.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/common/pref_names.h" @@ -17,9 +18,25 @@ #include "chrome/test/base/testing_browser_process.h" #include "ui/views/controls/button/text_button.h" +typedef BrowserWithTestWindowTest BookmarkBarViewTest; + +// Verify that the apps shortcut is never visible without instant extended. +TEST_F(BookmarkBarViewTest, NoAppsShortcutWithoutInstantExtended) { + ScopedTestingLocalState local_state(TestingBrowserProcess::GetGlobal()); + profile()->CreateBookmarkModel(true); + test::WaitForBookmarkModelToLoad(profile()); + BookmarkBarView bookmark_bar_view(browser(), NULL); + bookmark_bar_view.set_owned_by_client(); + EXPECT_FALSE(bookmark_bar_view.apps_page_shortcut_->visible()); + browser()->profile()->GetPrefs()->SetBoolean( + prefs::kShowAppsShortcutInBookmarkBar, true); + EXPECT_FALSE(bookmark_bar_view.apps_page_shortcut_->visible()); +} + class BookmarkBarViewInstantExtendedTest : public BrowserWithTestWindowTest { public: BookmarkBarViewInstantExtendedTest() { + chrome::EnableInstantExtendedAPIForTesting(); } protected: diff --git a/chrome/browser/ui/webui/chrome_url_data_manager_browsertest.cc b/chrome/browser/ui/webui/chrome_url_data_manager_browsertest.cc index 04f3589..7cbe0f6 100644 --- a/chrome/browser/ui/webui/chrome_url_data_manager_browsertest.cc +++ b/chrome/browser/ui/webui/chrome_url_data_manager_browsertest.cc @@ -47,11 +47,11 @@ class NavigationNotificationObserver : public content::NotificationObserver { typedef InProcessBrowserTest ChromeURLDataManagerTest; -// Makes sure navigating to the omnibox page results in a http status code +// Makes sure navigating to the new tab page results in a http status code // of 200. IN_PROC_BROWSER_TEST_F(ChromeURLDataManagerTest, 200) { NavigationNotificationObserver observer; - ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIOmniboxURL)); + ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUINewTabURL)); EXPECT_TRUE(observer.got_navigation()); EXPECT_EQ(200, observer.http_status_code()); } diff --git a/chrome/browser/ui/webui/ntp/most_visited_browsertest.cc b/chrome/browser/ui/webui/ntp/most_visited_browsertest.cc index 44ff651..4acb0c0 100644 --- a/chrome/browser/ui/webui/ntp/most_visited_browsertest.cc +++ b/chrome/browser/ui/webui/ntp/most_visited_browsertest.cc @@ -23,7 +23,6 @@ class MostVisitedWebUITest : public WebUIBrowserTest { } }; -// TODO(samarth): remove with the rest of the NTP4 code. -WEB_UI_UNITTEST_F(MostVisitedWebUITest, DISABLED_refreshDataBasic); -WEB_UI_UNITTEST_F(MostVisitedWebUITest, DISABLED_refreshDataOrdering); -WEB_UI_UNITTEST_F(MostVisitedWebUITest, DISABLED_refreshDataPinning); +WEB_UI_UNITTEST_F(MostVisitedWebUITest, refreshDataBasic); +WEB_UI_UNITTEST_F(MostVisitedWebUITest, refreshDataOrdering); +WEB_UI_UNITTEST_F(MostVisitedWebUITest, refreshDataPinning); diff --git a/chrome/browser/ui/webui/ntp/new_tab_page_sync_handler_browsertest.cc b/chrome/browser/ui/webui/ntp/new_tab_page_sync_handler_browsertest.cc index 03ae560..b64bdad 100644 --- a/chrome/browser/ui/webui/ntp/new_tab_page_sync_handler_browsertest.cc +++ b/chrome/browser/ui/webui/ntp/new_tab_page_sync_handler_browsertest.cc @@ -32,9 +32,8 @@ class MockNewTabPageSyncHandler : public NewTabPageSyncHandler { } }; -// TODO(samarth): remove with the rest of the NTP4 code. IN_PROC_BROWSER_TEST_F(NewTabPageSyncHandlerBrowserTest, - DISABLED_ChangeSigninAllowedToFalse) { + ChangeSigninAllowedToFalse) { ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUINewTabURL)); content::WebUI* web_ui = browser()->tab_strip_model()->GetActiveWebContents()->GetWebUI(); diff --git a/chrome/browser/ui/webui/ntp/new_tab_ui_browsertest.cc b/chrome/browser/ui/webui/ntp/new_tab_ui_browsertest.cc index 7e1eeb3..b64eace 100644 --- a/chrome/browser/ui/webui/ntp/new_tab_ui_browsertest.cc +++ b/chrome/browser/ui/webui/ntp/new_tab_ui_browsertest.cc @@ -40,10 +40,16 @@ IN_PROC_BROWSER_TEST_F(NewTabUIBrowserTest, ChromeInternalLoadsNTP) { ASSERT_FALSE(empty_inner_html); } +#if defined(OS_WIN) +// Flaky on Windows (http://crbug.com/174819) +#define MAYBE_LoadNTPInExistingProcess DISABLED_LoadNTPInExistingProcess +#else +#define MAYBE_LoadNTPInExistingProcess LoadNTPInExistingProcess +#endif + // Ensure loading a NTP with an existing SiteInstance in a reused process // doesn't cause us to kill the process. See http://crbug.com/104258. -// TODO(samarth): remove along with NTP4 code. -IN_PROC_BROWSER_TEST_F(NewTabUIBrowserTest, DISABLED_LoadNTPInExistingProcess) { +IN_PROC_BROWSER_TEST_F(NewTabUIBrowserTest, MAYBE_LoadNTPInExistingProcess) { // Set max renderers to 1 to force running out of processes. content::RenderProcessHost::SetMaxRendererProcessCount(1); @@ -106,8 +112,7 @@ IN_PROC_BROWSER_TEST_F(NewTabUIBrowserTest, DISABLED_LoadNTPInExistingProcess) { // Loads chrome://hang/ into two NTP tabs, ensuring we don't crash. // See http://crbug.com/59859. // If this flakes, use http://crbug.com/87200. -// TODO(samarth): remove along with NTP4 code. -IN_PROC_BROWSER_TEST_F(NewTabUIBrowserTest, DISABLED_ChromeHangInNTP) { +IN_PROC_BROWSER_TEST_F(NewTabUIBrowserTest, ChromeHangInNTP) { // Bring up a new tab page. ui_test_utils::NavigateToURLWithDisposition( browser(), GURL(chrome::kChromeUINewTabURL), NEW_FOREGROUND_TAB, @@ -138,9 +143,7 @@ class NewTabUIProcessPerTabTest : public NewTabUIBrowserTest { // Ensures that we don't load the normal page in the NTP process (and thus // crash), as in http://crbug.com/69224. // If this flakes, use http://crbug.com/87200 -// TODO(samarth): remove along with NTP4 code. -IN_PROC_BROWSER_TEST_F(NewTabUIProcessPerTabTest, - DISABLED_NavBeforeNTPCommits) { +IN_PROC_BROWSER_TEST_F(NewTabUIProcessPerTabTest, NavBeforeNTPCommits) { // Bring up a new tab page. ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUINewTabURL)); diff --git a/chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc b/chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc index 36ff9b9..7a37701 100644 --- a/chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc +++ b/chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc @@ -15,7 +15,6 @@ #include "chrome/common/chrome_switches.h" #include "chrome/test/base/testing_profile.h" #include "content/public/test/render_view_test.h" -#include "content/public/test/test_renderer_host.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/aura/client/activation_client.h" #include "ui/aura/client/aura_constants.h" @@ -23,6 +22,8 @@ #include "ui/aura/root_window.h" #include "ui/aura/test/test_windows.h" +typedef ash::test::AshTestBase WindowSizerAshTest; + namespace { // A browser window proxy which is able to associate an aura native window with @@ -88,13 +89,6 @@ scoped_ptr<TestBrowserWindowAura> CreateTestBrowserWindow( } // namespace -class WindowSizerAshTest : public ash::test::AshTestBase { - private: - // The existence of this object enables tests via - // RenderViewHostTester. - content::RenderViewHostTestEnabler rvh_test_enabler_; -}; - // Test that the window is sized appropriately for the first run experience // where the default window bounds calculation is invoked. TEST_F(WindowSizerAshTest, DefaultSizeCase) { |