| Index: chrome/browser/ui/browser_browsertest.cc
|
| diff --git a/chrome/browser/ui/browser_browsertest.cc b/chrome/browser/ui/browser_browsertest.cc
|
| index ad3ebe09ee937bfcfdbecd0dcbc0504f073ad8e3..e9f356edd3d51fc35cea9b8a2465e9b45f0209c8 100644
|
| --- a/chrome/browser/ui/browser_browsertest.cc
|
| +++ b/chrome/browser/ui/browser_browsertest.cc
|
| @@ -520,7 +520,8 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, ClearPendingOnFailUnlessNTP) {
|
| content::NOTIFICATION_LOAD_STOP,
|
| content::Source<NavigationController>(
|
| &web_contents->GetController()));
|
| - browser()->OpenURL(OpenURLParams(abort_url, Referrer(), CURRENT_TAB,
|
| + browser()->OpenURL(OpenURLParams(abort_url, Referrer(),
|
| + WindowOpenDisposition::CURRENT_TAB,
|
| ui::PAGE_TRANSITION_TYPED, false));
|
| stop_observer.Wait();
|
| EXPECT_TRUE(web_contents->GetController().GetPendingEntry());
|
| @@ -538,7 +539,8 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, ClearPendingOnFailUnlessNTP) {
|
| content::NOTIFICATION_LOAD_STOP,
|
| content::Source<NavigationController>(
|
| &web_contents->GetController()));
|
| - browser()->OpenURL(OpenURLParams(abort_url, Referrer(), CURRENT_TAB,
|
| + browser()->OpenURL(OpenURLParams(abort_url, Referrer(),
|
| + WindowOpenDisposition::CURRENT_TAB,
|
| ui::PAGE_TRANSITION_TYPED, false));
|
| stop_observer.Wait();
|
| EXPECT_FALSE(web_contents->GetController().GetPendingEntry());
|
| @@ -667,7 +669,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, ReloadThenCancelBeforeUnload) {
|
|
|
| // Navigate to another page, but click cancel in the dialog. Make sure that
|
| // the throbber stops spinning.
|
| - chrome::Reload(browser(), CURRENT_TAB);
|
| + chrome::Reload(browser(), WindowOpenDisposition::CURRENT_TAB);
|
| AppModalDialog* alert = ui_test_utils::WaitForAppModalDialog();
|
| alert->CloseModalDialog();
|
| EXPECT_FALSE(
|
| @@ -788,7 +790,8 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, SingleBeforeUnloadAfterRedirect) {
|
| GURL https_url(https_test_server.GetURL("/title1.html"));
|
| GURL redirect_url(
|
| embedded_test_server()->GetURL("/server-redirect?" + https_url.spec()));
|
| - browser()->OpenURL(OpenURLParams(redirect_url, Referrer(), CURRENT_TAB,
|
| + browser()->OpenURL(OpenURLParams(redirect_url, Referrer(),
|
| + WindowOpenDisposition::CURRENT_TAB,
|
| ui::PAGE_TRANSITION_TYPED, false));
|
| AppModalDialog* alert = ui_test_utils::WaitForAppModalDialog();
|
| EXPECT_TRUE(
|
| @@ -810,8 +813,9 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, CancelBeforeUnloadResetsURL) {
|
| // Navigate to a page that triggers a cross-site transition.
|
| ASSERT_TRUE(embedded_test_server()->Start());
|
| GURL url2(embedded_test_server()->GetURL("/title1.html"));
|
| - browser()->OpenURL(OpenURLParams(
|
| - url2, Referrer(), CURRENT_TAB, ui::PAGE_TRANSITION_TYPED, false));
|
| + browser()->OpenURL(OpenURLParams(url2, Referrer(),
|
| + WindowOpenDisposition::CURRENT_TAB,
|
| + ui::PAGE_TRANSITION_TYPED, false));
|
|
|
| content::WindowedNotificationObserver host_destroyed_observer(
|
| content::NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED,
|
| @@ -884,7 +888,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_BeforeUnloadVsBeforeReload) {
|
| ui_test_utils::NavigateToURL(browser(), url);
|
|
|
| // Reload the page, and check that we get a "before reload" dialog.
|
| - chrome::Reload(browser(), CURRENT_TAB);
|
| + chrome::Reload(browser(), WindowOpenDisposition::CURRENT_TAB);
|
| AppModalDialog* alert = ui_test_utils::WaitForAppModalDialog();
|
| EXPECT_TRUE(static_cast<JavaScriptAppModalDialog*>(alert)->is_reload());
|
|
|
| @@ -893,8 +897,9 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_BeforeUnloadVsBeforeReload) {
|
|
|
| // Navigate to another url, and check that we get a "before unload" dialog.
|
| GURL url2(url::kAboutBlankURL);
|
| - browser()->OpenURL(OpenURLParams(
|
| - url2, Referrer(), CURRENT_TAB, ui::PAGE_TRANSITION_TYPED, false));
|
| + browser()->OpenURL(OpenURLParams(url2, Referrer(),
|
| + WindowOpenDisposition::CURRENT_TAB,
|
| + ui::PAGE_TRANSITION_TYPED, false));
|
|
|
| alert = ui_test_utils::WaitForAppModalDialog();
|
| EXPECT_FALSE(static_cast<JavaScriptAppModalDialog*>(alert)->is_reload());
|
| @@ -1426,7 +1431,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, ShouldShowLocationBar) {
|
| // Launch it in a window, as AppLauncherHandler::HandleLaunchApp() would.
|
| WebContents* app_window = OpenApplication(AppLaunchParams(
|
| browser()->profile(), extension_app, extensions::LAUNCH_CONTAINER_WINDOW,
|
| - NEW_WINDOW, extensions::SOURCE_TEST));
|
| + WindowOpenDisposition::NEW_WINDOW, extensions::SOURCE_TEST));
|
| ASSERT_TRUE(app_window);
|
|
|
| DevToolsWindow* devtools_window =
|
| @@ -1546,7 +1551,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, OpenAppWindowLikeNtp) {
|
| // Launch it in a window, as AppLauncherHandler::HandleLaunchApp() would.
|
| WebContents* app_window = OpenApplication(AppLaunchParams(
|
| browser()->profile(), extension_app, extensions::LAUNCH_CONTAINER_WINDOW,
|
| - NEW_WINDOW, extensions::SOURCE_TEST));
|
| + WindowOpenDisposition::NEW_WINDOW, extensions::SOURCE_TEST));
|
| ASSERT_TRUE(app_window);
|
|
|
| // Apps launched in a window from the NTP have an extensions tab helper but
|
| @@ -1622,7 +1627,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, ForwardDisabledOnForward) {
|
| content::Source<NavigationController>(
|
| &browser()->tab_strip_model()->GetActiveWebContents()->
|
| GetController()));
|
| - chrome::GoBack(browser(), CURRENT_TAB);
|
| + chrome::GoBack(browser(), WindowOpenDisposition::CURRENT_TAB);
|
| back_nav_load_observer.Wait();
|
| CommandUpdater* command_updater =
|
| browser()->command_controller()->command_updater();
|
| @@ -1633,7 +1638,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, ForwardDisabledOnForward) {
|
| content::Source<NavigationController>(
|
| &browser()->tab_strip_model()->GetActiveWebContents()->
|
| GetController()));
|
| - chrome::GoForward(browser(), CURRENT_TAB);
|
| + chrome::GoForward(browser(), WindowOpenDisposition::CURRENT_TAB);
|
| // This check will happen before the navigation completes, since the browser
|
| // won't process the renderer's response until the Wait() call below.
|
| EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_FORWARD));
|
| @@ -1986,7 +1991,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, UserGesturesReported) {
|
| EXPECT_TRUE(mock_observer.got_user_gesture());
|
|
|
| mock_observer.set_got_user_gesture(false);
|
| - chrome::Reload(browser(), CURRENT_TAB);
|
| + chrome::Reload(browser(), WindowOpenDisposition::CURRENT_TAB);
|
| EXPECT_TRUE(mock_observer.got_user_gesture());
|
| }
|
|
|
| @@ -2371,7 +2376,7 @@ class ClickModifierTest : public InProcessBrowserTest {
|
| browser->tab_strip_model()->GetActiveWebContents();
|
| EXPECT_EQ(url, web_contents->GetURL());
|
|
|
| - if (disposition == CURRENT_TAB) {
|
| + if (disposition == WindowOpenDisposition::CURRENT_TAB) {
|
| content::WebContents* web_contents =
|
| browser->tab_strip_model()->GetActiveWebContents();
|
| content::TestNavigationObserver same_tab_observer(web_contents);
|
| @@ -2389,7 +2394,7 @@ class ClickModifierTest : public InProcessBrowserTest {
|
| SimulateMouseClick(web_contents, modifiers, button);
|
| observer.Wait();
|
|
|
| - if (disposition == NEW_WINDOW) {
|
| + if (disposition == WindowOpenDisposition::NEW_WINDOW) {
|
| EXPECT_EQ(2u, chrome::GetBrowserCount(browser->profile()));
|
| return;
|
| }
|
| @@ -2398,10 +2403,10 @@ class ClickModifierTest : public InProcessBrowserTest {
|
| EXPECT_EQ(2, browser->tab_strip_model()->count());
|
| web_contents = browser->tab_strip_model()->GetActiveWebContents();
|
| WaitForLoadStop(web_contents);
|
| - if (disposition == NEW_FOREGROUND_TAB) {
|
| + if (disposition == WindowOpenDisposition::NEW_FOREGROUND_TAB) {
|
| EXPECT_EQ(getSecondPageTitle(), web_contents->GetTitle());
|
| } else {
|
| - ASSERT_EQ(NEW_BACKGROUND_TAB, disposition);
|
| + ASSERT_EQ(WindowOpenDisposition::NEW_BACKGROUND_TAB, disposition);
|
| EXPECT_EQ(getFirstPageTitle(), web_contents->GetTitle());
|
| }
|
| }
|
| @@ -2415,7 +2420,7 @@ class ClickModifierTest : public InProcessBrowserTest {
|
| IN_PROC_BROWSER_TEST_F(ClickModifierTest, WindowOpenBasicClickTest) {
|
| int modifiers = 0;
|
| blink::WebMouseEvent::Button button = blink::WebMouseEvent::Button::Left;
|
| - WindowOpenDisposition disposition = NEW_FOREGROUND_TAB;
|
| + WindowOpenDisposition disposition = WindowOpenDisposition::NEW_FOREGROUND_TAB;
|
| RunTest(browser(), GetWindowOpenURL(), modifiers, button, disposition);
|
| }
|
|
|
| @@ -2426,7 +2431,7 @@ IN_PROC_BROWSER_TEST_F(ClickModifierTest, WindowOpenBasicClickTest) {
|
| IN_PROC_BROWSER_TEST_F(ClickModifierTest, WindowOpenShiftClickTest) {
|
| int modifiers = blink::WebInputEvent::ShiftKey;
|
| blink::WebMouseEvent::Button button = blink::WebMouseEvent::Button::Left;
|
| - WindowOpenDisposition disposition = NEW_WINDOW;
|
| + WindowOpenDisposition disposition = WindowOpenDisposition::NEW_WINDOW;
|
| RunTest(browser(), GetWindowOpenURL(), modifiers, button, disposition);
|
| }
|
|
|
| @@ -2439,7 +2444,7 @@ IN_PROC_BROWSER_TEST_F(ClickModifierTest, WindowOpenControlClickTest) {
|
| int modifiers = blink::WebInputEvent::ControlKey;
|
| #endif
|
| blink::WebMouseEvent::Button button = blink::WebMouseEvent::Button::Left;
|
| - WindowOpenDisposition disposition = NEW_BACKGROUND_TAB;
|
| + WindowOpenDisposition disposition = WindowOpenDisposition::NEW_BACKGROUND_TAB;
|
| RunTest(browser(), GetWindowOpenURL(), modifiers, button, disposition);
|
| }
|
|
|
| @@ -2453,7 +2458,7 @@ IN_PROC_BROWSER_TEST_F(ClickModifierTest, WindowOpenControlShiftClickTest) {
|
| #endif
|
| modifiers |= blink::WebInputEvent::ShiftKey;
|
| blink::WebMouseEvent::Button button = blink::WebMouseEvent::Button::Left;
|
| - WindowOpenDisposition disposition = NEW_FOREGROUND_TAB;
|
| + WindowOpenDisposition disposition = WindowOpenDisposition::NEW_FOREGROUND_TAB;
|
| RunTest(browser(), GetWindowOpenURL(), modifiers, button, disposition);
|
| }
|
|
|
| @@ -2462,7 +2467,7 @@ IN_PROC_BROWSER_TEST_F(ClickModifierTest, WindowOpenControlShiftClickTest) {
|
| IN_PROC_BROWSER_TEST_F(ClickModifierTest, HrefBasicClickTest) {
|
| int modifiers = 0;
|
| blink::WebMouseEvent::Button button = blink::WebMouseEvent::Button::Left;
|
| - WindowOpenDisposition disposition = CURRENT_TAB;
|
| + WindowOpenDisposition disposition = WindowOpenDisposition::CURRENT_TAB;
|
| RunTest(browser(), GetHrefURL(), modifiers, button, disposition);
|
| }
|
|
|
| @@ -2473,7 +2478,7 @@ IN_PROC_BROWSER_TEST_F(ClickModifierTest, HrefBasicClickTest) {
|
| IN_PROC_BROWSER_TEST_F(ClickModifierTest, HrefShiftClickTest) {
|
| int modifiers = blink::WebInputEvent::ShiftKey;
|
| blink::WebMouseEvent::Button button = blink::WebMouseEvent::Button::Left;
|
| - WindowOpenDisposition disposition = NEW_WINDOW;
|
| + WindowOpenDisposition disposition = WindowOpenDisposition::NEW_WINDOW;
|
| RunTest(browser(), GetHrefURL(), modifiers, button, disposition);
|
| }
|
|
|
| @@ -2486,7 +2491,7 @@ IN_PROC_BROWSER_TEST_F(ClickModifierTest, HrefControlClickTest) {
|
| int modifiers = blink::WebInputEvent::ControlKey;
|
| #endif
|
| blink::WebMouseEvent::Button button = blink::WebMouseEvent::Button::Left;
|
| - WindowOpenDisposition disposition = NEW_BACKGROUND_TAB;
|
| + WindowOpenDisposition disposition = WindowOpenDisposition::NEW_BACKGROUND_TAB;
|
| RunTest(browser(), GetHrefURL(), modifiers, button, disposition);
|
| }
|
|
|
| @@ -2501,7 +2506,7 @@ IN_PROC_BROWSER_TEST_F(ClickModifierTest, DISABLED_HrefControlShiftClickTest) {
|
| #endif
|
| modifiers |= blink::WebInputEvent::ShiftKey;
|
| blink::WebMouseEvent::Button button = blink::WebMouseEvent::Button::Left;
|
| - WindowOpenDisposition disposition = NEW_FOREGROUND_TAB;
|
| + WindowOpenDisposition disposition = WindowOpenDisposition::NEW_FOREGROUND_TAB;
|
| RunTest(browser(), GetHrefURL(), modifiers, button, disposition);
|
| }
|
|
|
| @@ -2509,7 +2514,7 @@ IN_PROC_BROWSER_TEST_F(ClickModifierTest, DISABLED_HrefControlShiftClickTest) {
|
| IN_PROC_BROWSER_TEST_F(ClickModifierTest, HrefMiddleClickTest) {
|
| int modifiers = 0;
|
| blink::WebMouseEvent::Button button = blink::WebMouseEvent::Button::Middle;
|
| - WindowOpenDisposition disposition = NEW_BACKGROUND_TAB;
|
| + WindowOpenDisposition disposition = WindowOpenDisposition::NEW_BACKGROUND_TAB;
|
| RunTest(browser(), GetHrefURL(), modifiers, button, disposition);
|
| }
|
|
|
| @@ -2518,7 +2523,7 @@ IN_PROC_BROWSER_TEST_F(ClickModifierTest, HrefMiddleClickTest) {
|
| IN_PROC_BROWSER_TEST_F(ClickModifierTest, DISABLED_HrefShiftMiddleClickTest) {
|
| int modifiers = blink::WebInputEvent::ShiftKey;
|
| blink::WebMouseEvent::Button button = blink::WebMouseEvent::Button::Middle;
|
| - WindowOpenDisposition disposition = NEW_FOREGROUND_TAB;
|
| + WindowOpenDisposition disposition = WindowOpenDisposition::NEW_FOREGROUND_TAB;
|
| RunTest(browser(), GetHrefURL(), modifiers, button, disposition);
|
| }
|
|
|
|
|