Commit ef8284d0 authored by Elly Fong-Jones's avatar Elly Fong-Jones Committed by Commit Bot

cbui: get rid of views_mode_controller

We never did this cleanup after shipping MacViews. This change removes
all the remaining uses of it (blessedly only in tests) and removes the
namespace altogether.

Bug: 845389
Change-Id: Icb52064f8ad7a8c66030c941ba1cdf298a1ae73a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1895654
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712189}
parent 035e3b00
...@@ -18,11 +18,6 @@ ...@@ -18,11 +18,6 @@
#include "extensions/test/extension_test_message_listener.h" #include "extensions/test/extension_test_message_listener.h"
#include "extensions/test/result_catcher.h" #include "extensions/test/result_catcher.h"
#if defined(OS_MACOSX)
#include "base/mac/mac_util.h"
#include "chrome/browser/ui/views_mode_controller.h"
#endif
using extensions::AppWindowGeometryCache; using extensions::AppWindowGeometryCache;
using extensions::ResultCatcher; using extensions::ResultCatcher;
...@@ -154,17 +149,14 @@ IN_PROC_BROWSER_TEST_F(AppWindowAPITest, DISABLED_TestMaximize) { ...@@ -154,17 +149,14 @@ IN_PROC_BROWSER_TEST_F(AppWindowAPITest, DISABLED_TestMaximize) {
// Flaky on Linux. http://crbug.com/424399. // Flaky on Linux. http://crbug.com/424399.
#if defined(OS_LINUX) && !defined(OS_CHROMEOS) #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
#define MAYBE_TestMinimize DISABLED_TestMinimize #define MAYBE_TestMinimize DISABLED_TestMinimize
#elif defined(OS_MACOSX)
// Fails on Mac: https://crbug.com/834908
#define MAYBE_TestMinimize DISABLED_TestMinimize
#else #else
#define MAYBE_TestMinimize TestMinimize #define MAYBE_TestMinimize TestMinimize
#endif #endif
IN_PROC_BROWSER_TEST_F(AppWindowAPITest, MAYBE_TestMinimize) { IN_PROC_BROWSER_TEST_F(AppWindowAPITest, MAYBE_TestMinimize) {
#if defined(OS_MACOSX)
if (base::mac::IsOS10_10())
return; // Fails when swarmed. http://crbug.com/660582
if (!views_mode_controller::IsViewsBrowserCocoa())
return; // Fails in Views mode: https://crbug.com/834908
#endif
ASSERT_TRUE(RunAppWindowAPITest("testMinimize")) << message_; ASSERT_TRUE(RunAppWindowAPITest("testMinimize")) << message_;
} }
...@@ -183,6 +175,15 @@ IN_PROC_BROWSER_TEST_F(AppWindowAPITest, DISABLED_TestRestoreAfterClose) { ...@@ -183,6 +175,15 @@ IN_PROC_BROWSER_TEST_F(AppWindowAPITest, DISABLED_TestRestoreAfterClose) {
#define MAYBE_TestInitialConstraints DISABLED_TestInitialConstraints #define MAYBE_TestInitialConstraints DISABLED_TestInitialConstraints
#define MAYBE_TestSetBounds DISABLED_TestSetBounds #define MAYBE_TestSetBounds DISABLED_TestSetBounds
#define MAYBE_TestSetSizeConstraints DISABLED_TestSetSizeConstraints #define MAYBE_TestSetSizeConstraints DISABLED_TestSetSizeConstraints
#elif defined(OS_MACOSX)
// Most of these don't work under MacViews, which has never had complete support
// for old-style app windows.
// https://crbug.com/834908
#define MAYBE_TestDeprecatedBounds TestDeprecatedBounds
#define MAYBE_TestInitialBounds DISABLED_TestInitialBounds
#define MAYBE_TestInitialConstraints DISABLED_TestInitialConstraints
#define MAYBE_TestSetBounds TestSetBounds
#define MAYBE_TestSetSizeConstraints DISABLED_TestSetSizeConstraints
#else #else
#define MAYBE_TestDeprecatedBounds TestDeprecatedBounds #define MAYBE_TestDeprecatedBounds TestDeprecatedBounds
#define MAYBE_TestInitialBounds TestInitialBounds #define MAYBE_TestInitialBounds TestInitialBounds
...@@ -197,18 +198,10 @@ IN_PROC_BROWSER_TEST_F(AppWindowAPITest, MAYBE_TestDeprecatedBounds) { ...@@ -197,18 +198,10 @@ IN_PROC_BROWSER_TEST_F(AppWindowAPITest, MAYBE_TestDeprecatedBounds) {
} }
IN_PROC_BROWSER_TEST_F(AppWindowAPITest, MAYBE_TestInitialBounds) { IN_PROC_BROWSER_TEST_F(AppWindowAPITest, MAYBE_TestInitialBounds) {
#if defined(OS_MACOSX)
if (!views_mode_controller::IsViewsBrowserCocoa())
return; // Fails in Views mode: https://crbug.com/834908
#endif
ASSERT_TRUE(RunAppWindowAPITest("testInitialBounds")) << message_; ASSERT_TRUE(RunAppWindowAPITest("testInitialBounds")) << message_;
} }
IN_PROC_BROWSER_TEST_F(AppWindowAPITest, MAYBE_TestInitialConstraints) { IN_PROC_BROWSER_TEST_F(AppWindowAPITest, MAYBE_TestInitialConstraints) {
#if defined(OS_MACOSX)
if (!views_mode_controller::IsViewsBrowserCocoa())
return; // Fails in Views mode: https://crbug.com/834908
#endif
ASSERT_TRUE(RunAppWindowAPITest("testInitialConstraints")) << message_; ASSERT_TRUE(RunAppWindowAPITest("testInitialConstraints")) << message_;
} }
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/exclusive_access/fullscreen_controller_test.h" #include "chrome/browser/ui/exclusive_access/fullscreen_controller_test.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/views_mode_controller.h"
#include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/interactive_test_utils.h" #include "chrome/test/base/interactive_test_utils.h"
#include "chrome/test/base/ui_test_utils.h" #include "chrome/test/base/ui_test_utils.h"
...@@ -83,16 +82,6 @@ void WaitForRenderWidgetHostCount(size_t target_count) { ...@@ -83,16 +82,6 @@ void WaitForRenderWidgetHostCount(size_t target_count) {
} }
} }
// Used to disable a few problematic tests for MacViews:
// https://crbug.com/850594
bool IsMacViewsBrowser() {
#if defined(OS_MACOSX)
return !views_mode_controller::IsViewsBrowserCocoa();
#else
return false;
#endif
}
} // namespace } // namespace
class SitePerProcessInteractiveBrowserTest : public InProcessBrowserTest { class SitePerProcessInteractiveBrowserTest : public InProcessBrowserTest {
...@@ -744,10 +733,14 @@ void WaitForMultipleFullscreenEvents( ...@@ -744,10 +733,14 @@ void WaitForMultipleFullscreenEvents(
// - fullscreenchange events fire in both frames. // - fullscreenchange events fire in both frames.
// - fullscreen CSS is applied correctly in both frames. // - fullscreen CSS is applied correctly in both frames.
// //
#if defined(OS_MACOSX)
// https://crbug.com/845389
#define MAYBE_FullscreenElementInSubframe DISABLED_FullscreenElementInSubframe
#else
#define MAYBE_FullscreenElementInSubframe FullscreenElementInSubframe
#endif
IN_PROC_BROWSER_TEST_F(SitePerProcessInteractiveBrowserTest, IN_PROC_BROWSER_TEST_F(SitePerProcessInteractiveBrowserTest,
FullscreenElementInSubframe) { MAYBE_FullscreenElementInSubframe) {
if (IsMacViewsBrowser())
return;
// Start on a page with one subframe (id "child-0") that has // Start on a page with one subframe (id "child-0") that has
// "allowfullscreen" enabled. // "allowfullscreen" enabled.
GURL main_url(embedded_test_server()->GetURL( GURL main_url(embedded_test_server()->GetURL(
...@@ -937,10 +930,15 @@ void SitePerProcessInteractiveBrowserTest::FullscreenElementInABA( ...@@ -937,10 +930,15 @@ void SitePerProcessInteractiveBrowserTest::FullscreenElementInABA(
EXPECT_EQ("none", GetFullscreenElementId(grandchild)); EXPECT_EQ("none", GetFullscreenElementId(grandchild));
} }
#if defined(OS_MACOSX)
#define MAYBE_FullscreenElementInABAAndExitViaEscapeKey \
DISABLED_FullscreenElementInABAAndExitViaEscapeKey
#else
#define MAYBE_FullscreenElementInABAAndExitViaEscapeKey \
FullscreenElementInABAAndExitViaEscapeKey
#endif
IN_PROC_BROWSER_TEST_F(SitePerProcessInteractiveBrowserTest, IN_PROC_BROWSER_TEST_F(SitePerProcessInteractiveBrowserTest,
FullscreenElementInABAAndExitViaEscapeKey) { MAYBE_FullscreenElementInABAAndExitViaEscapeKey) {
if (IsMacViewsBrowser())
return;
FullscreenElementInABA(FullscreenExitMethod::ESC_PRESS); FullscreenElementInABA(FullscreenExitMethod::ESC_PRESS);
} }
...@@ -948,8 +946,6 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessInteractiveBrowserTest, ...@@ -948,8 +946,6 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessInteractiveBrowserTest,
// on Mac (crbug.com/850594). // on Mac (crbug.com/850594).
IN_PROC_BROWSER_TEST_F(SitePerProcessInteractiveBrowserTest, IN_PROC_BROWSER_TEST_F(SitePerProcessInteractiveBrowserTest,
DISABLED_FullscreenElementInABAAndExitViaJS) { DISABLED_FullscreenElementInABAAndExitViaJS) {
if (IsMacViewsBrowser())
return;
FullscreenElementInABA(FullscreenExitMethod::JS_CALL); FullscreenElementInABA(FullscreenExitMethod::JS_CALL);
} }
......
...@@ -3244,8 +3244,6 @@ jumbo_static_library("ui") { ...@@ -3244,8 +3244,6 @@ jumbo_static_library("ui") {
"views/webauthn/hover_list_view.h", "views/webauthn/hover_list_view.h",
"views/webauthn/sheet_view_factory.cc", "views/webauthn/sheet_view_factory.cc",
"views/webauthn/sheet_view_factory.h", "views/webauthn/sheet_view_factory.h",
"views_mode_controller.cc",
"views_mode_controller.h",
"webauthn/account_hover_list_model.cc", "webauthn/account_hover_list_model.cc",
"webauthn/account_hover_list_model.h", "webauthn/account_hover_list_model.h",
"webauthn/authenticator_request_sheet_model.h", "webauthn/authenticator_request_sheet_model.h",
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/fullscreen_keyboard_browsertest_base.h" #include "chrome/browser/ui/fullscreen_keyboard_browsertest_base.h"
#include "chrome/browser/ui/views_mode_controller.h"
#include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/in_process_browser_test.h"
#include "ui/events/keycodes/keyboard_codes.h" #include "ui/events/keycodes/keyboard_codes.h"
...@@ -79,14 +78,17 @@ IN_PROC_BROWSER_TEST_F( ...@@ -79,14 +78,17 @@ IN_PROC_BROWSER_TEST_F(
ASSERT_FALSE(IsInBrowserFullscreen()); ASSERT_FALSE(IsInBrowserFullscreen());
} }
IN_PROC_BROWSER_TEST_F(
BrowserCommandControllerInteractiveTest,
KeyEventsShouldBeConsumedByWebPageInJsFullscreenExceptForEsc) {
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
// https://crbug.com/850594 // https://crbug.com/850594
if (!views_mode_controller::IsViewsBrowserCocoa()) #define MAYBE_KeyEventsShouldBeConsumedByWebPageInJsFullscreenExceptForEsc \
return; DISABLED_KeyEventsShouldBeConsumedByWebPageInJsFullscreenExceptForEsc
#else
#define MAYBE_KeyEventsShouldBeConsumedByWebPageInJsFullscreenExceptForEsc \
KeyEventsShouldBeConsumedByWebPageInJsFullscreenExceptForEsc
#endif #endif
IN_PROC_BROWSER_TEST_F(
BrowserCommandControllerInteractiveTest,
MAYBE_KeyEventsShouldBeConsumedByWebPageInJsFullscreenExceptForEsc) {
ASSERT_NO_FATAL_FAILURE(StartFullscreenLockPage()); ASSERT_NO_FATAL_FAILURE(StartFullscreenLockPage());
ASSERT_NO_FATAL_FAILURE(SendJsFullscreenShortcutAndWait()); ASSERT_NO_FATAL_FAILURE(SendJsFullscreenShortcutAndWait());
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include "chrome/browser/ui/find_bar/find_tab_helper.h" #include "chrome/browser/ui/find_bar/find_tab_helper.h"
#include "chrome/browser/ui/find_bar/find_types.h" #include "chrome/browser/ui/find_bar/find_types.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/views_mode_controller.h"
#include "chrome/common/url_constants.h" #include "chrome/common/url_constants.h"
#include "chrome/test/base/find_result_waiter.h" #include "chrome/test/base/find_result_waiter.h"
#include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/in_process_browser_test.h"
...@@ -1102,16 +1101,13 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, RestartSearchFromF3) { ...@@ -1102,16 +1101,13 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, RestartSearchFromF3) {
// with the last search from the same tab rather than the last overall search. // with the last search from the same tab rather than the last overall search.
// The only exception is if there is a global pasteboard (for example on Mac). // The only exception is if there is a global pasteboard (for example on Mac).
// http://crbug.com/30006 // http://crbug.com/30006
IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, PreferPreviousSearch) {
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
if (!views_mode_controller::IsViewsBrowserCocoa()) { // https://crbug.com/845389
// TODO(http://crbug.com/843878): Remove the interactive UI test #define MAYBE_PreferPreviousSearch DISABLED_PreferPreviousSearch
// FindBarPlatformHelperMacInteractiveUITest.PreferPreviousSearch #else
// once http://crbug.com/843878 is fixed. #define MAYBE_PreferPreviousSearch PreferPreviousSearch
return;
}
#endif #endif
IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, MAYBE_PreferPreviousSearch) {
// First we navigate to any page. // First we navigate to any page.
GURL url = GetURL(kSimple); GURL url = GetURL(kSimple);
ui_test_utils::NavigateToURL(browser(), url); ui_test_utils::NavigateToURL(browser(), url);
...@@ -1441,21 +1437,20 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, ...@@ -1441,21 +1437,20 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest,
// Verify that if there's a global pasteboard (for example on Mac) then doing // Verify that if there's a global pasteboard (for example on Mac) then doing
// a search on one tab will clear the matches label on the other tabs. // a search on one tab will clear the matches label on the other tabs.
#if defined(OS_MACOSX)
// TODO(http://crbug.com/843878): Remove the interactive UI test
// FindBarPlatformHelperMacInteractiveUITest.GlobalPasteBoardClearMatches
// once http://crbug.com/843878 is fixed.
#define MAYBE_GlobalPasteBoardClearMatches DISABLED_GlobalPasteBoardClearMatches
#else
#define MAYBE_GlobalPasteBoardClearMatches GlobalPasteBoardClearMatches
#endif
IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, IN_PROC_BROWSER_TEST_F(FindInPageControllerTest,
GlobalPasteBoardClearMatches) { MAYBE_GlobalPasteBoardClearMatches) {
FindBar* find_bar = browser()->GetFindBarController()->find_bar(); FindBar* find_bar = browser()->GetFindBarController()->find_bar();
if (!find_bar->HasGlobalFindPasteboard()) if (!find_bar->HasGlobalFindPasteboard())
return; return;
#if defined(OS_MACOSX)
if (!views_mode_controller::IsViewsBrowserCocoa()) {
// TODO(http://crbug.com/843878): Remove the interactive UI test
// FindBarPlatformHelperMacInteractiveUITest.GlobalPasteBoardClearMatches
// once http://crbug.com/843878 is fixed.
return;
}
#endif
// First we navigate to any page. // First we navigate to any page.
GURL url = GetURL(kSimple); GURL url = GetURL(kSimple);
ui_test_utils::NavigateToURL(browser(), url); ui_test_utils::NavigateToURL(browser(), url);
...@@ -1534,16 +1529,13 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, IncognitoFindNextSecret) { ...@@ -1534,16 +1529,13 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, IncognitoFindNextSecret) {
// Find text in regular window, send IDC_FIND_NEXT to incognito. It should // Find text in regular window, send IDC_FIND_NEXT to incognito. It should
// search for the first phrase. // search for the first phrase.
IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, IncognitoFindNextShared) {
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
if (!views_mode_controller::IsViewsBrowserCocoa()) { #define MAYBE_IncognitoFindNextShared DISABLED_IncognitoFindNextShared
// TODO(http://crbug.com/843878): Remove the interactive UI test #else
// FindBarPlatformHelperMacInteractiveUITest.IncognitoFindNextShared #define MAYBE_IncognitoFindNextShared IncognitoFindNextShared
// once http://crbug.com/843878 is fixed.
return;
}
#endif #endif
IN_PROC_BROWSER_TEST_F(FindInPageControllerTest,
MAYBE_IncognitoFindNextShared) {
WebContents* web_contents = WebContents* web_contents =
browser()->tab_strip_model()->GetActiveWebContents(); browser()->tab_strip_model()->GetActiveWebContents();
// On Mac this updates the find pboard. // On Mac this updates the find pboard.
......
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/views_mode_controller.h"
#include "base/feature_list.h"
#include "ui/base/ui_base_features.h"
#if defined(OS_MACOSX)
namespace views_mode_controller {
bool IsViewsBrowserCocoa() {
// TODO(https://crbug.com/832676): Delete all code guarded on this function
// returning true and then remove this function.
return false;
}
} // namespace views_mode_controller
#endif
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_VIEWS_MODE_CONTROLLER_H_
#define CHROME_BROWSER_UI_VIEWS_MODE_CONTROLLER_H_
#include "build/build_config.h"
#include "build/buildflag.h"
#if defined(OS_MACOSX)
namespace views_mode_controller {
// Returns whether a Views-capable browser build should use the Cocoa browser
// UI. Always returns false.
// TODO(https://crbug.com/832676): Delete all code guarded on this function
// returning true and then remove this function.
bool IsViewsBrowserCocoa();
} // namespace views_mode_controller
#endif
#endif // CHROME_BROWSER_UI_VIEWS_MODE_CONTROLLER_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment