Commit 8d73ce20 authored by Bret Sepulveda's avatar Bret Sepulveda Committed by Commit Bot

Delete TestBrowserUi::UseMdOnly.

All tests should be using MD for secondary UI by default, so this call
is now a no-op.

Bug: 867557
Change-Id: Ia0d6f774543425c56084894f15f4d262f9071f7c
Reviewed-on: https://chromium-review.googlesource.com/1155632Reviewed-by: default avatarVasilii Sukhanov <vasilii@chromium.org>
Reviewed-by: default avatarTrent Apted <tapted@chromium.org>
Commit-Queue: Bret Sepulveda <bsep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579487}
parent 017b6770
...@@ -3348,13 +3348,6 @@ class PasswordManagerDialogBrowserTest ...@@ -3348,13 +3348,6 @@ class PasswordManagerDialogBrowserTest
public: public:
PasswordManagerDialogBrowserTest() = default; PasswordManagerDialogBrowserTest() = default;
// SupportsTestUi:
void SetUp() override {
// Secondary UI needs to be enabled before ShowUi for the test to work.
UseMdOnly();
SupportsTestUi::SetUp();
}
void SetUpCommandLine(base::CommandLine* command_line) override { void SetUpCommandLine(base::CommandLine* command_line) override {
SupportsTestDialog<PasswordManagerBrowserTestBase>::SetUpCommandLine( SupportsTestDialog<PasswordManagerBrowserTestBase>::SetUpCommandLine(
command_line); command_line);
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#include <string> #include <string>
#include "base/command_line.h" #include "base/command_line.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/app/chrome_command_ids.h" #include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/content_settings/cookie_settings_factory.h" #include "chrome/browser/content_settings/cookie_settings_factory.h"
#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser.h"
...@@ -17,7 +16,6 @@ ...@@ -17,7 +16,6 @@
#include "chrome/test/base/ui_test_utils.h" #include "chrome/test/base/ui_test_utils.h"
#include "components/content_settings/core/browser/cookie_settings.h" #include "components/content_settings/core/browser/cookie_settings.h"
#include "net/test/embedded_test_server/embedded_test_server.h" #include "net/test/embedded_test_server/embedded_test_server.h"
#include "ui/base/ui_base_features.h"
class CollectedCookiesTest : public DialogBrowserTest { class CollectedCookiesTest : public DialogBrowserTest {
public: public:
...@@ -44,26 +42,8 @@ class CollectedCookiesTest : public DialogBrowserTest { ...@@ -44,26 +42,8 @@ class CollectedCookiesTest : public DialogBrowserTest {
DISALLOW_COPY_AND_ASSIGN(CollectedCookiesTest); DISALLOW_COPY_AND_ASSIGN(CollectedCookiesTest);
}; };
// Runs with --secondary-ui-md. Users of this can switch to CollectedCookiesTest
// when that is the default.
class CollectedCookiesTestMd : public CollectedCookiesTest {
public:
CollectedCookiesTestMd() {}
// CollectedCookiesTest:
void SetUp() override {
UseMdOnly();
CollectedCookiesTest::SetUp();
}
private:
base::test::ScopedFeatureList scoped_feature_list_;
DISALLOW_COPY_AND_ASSIGN(CollectedCookiesTestMd);
};
// Test that calls ShowUi("default"). // Test that calls ShowUi("default").
IN_PROC_BROWSER_TEST_F(CollectedCookiesTestMd, InvokeUi_default) { IN_PROC_BROWSER_TEST_F(CollectedCookiesTest, InvokeUi_default) {
ShowAndVerifyUi(); ShowAndVerifyUi();
} }
......
...@@ -59,18 +59,6 @@ TestBrowserDialog::TestBrowserDialog() = default; ...@@ -59,18 +59,6 @@ TestBrowserDialog::TestBrowserDialog() = default;
TestBrowserDialog::~TestBrowserDialog() = default; TestBrowserDialog::~TestBrowserDialog() = default;
void TestBrowserDialog::PreShow() { void TestBrowserDialog::PreShow() {
// The rest of this class assumes the child dialog is toolkit-views. So, for
// Mac, it will only work when MD for secondary UI is enabled. Without this, a
// Cocoa dialog will be created, which TestBrowserDialog doesn't support.
// Force kSecondaryUiMd on Mac to get coverage on the bots. Leave it optional
// elsewhere so that the non-MD dialog can be invoked to compare.
#if defined(OS_MACOSX)
// Note that since SetUp() has already been called, some parts of the toolkit
// may already be initialized without MD - this is just to ensure Cocoa
// dialogs are not selected.
UseMdOnly();
#endif
UpdateWidgets(); UpdateWidgets();
} }
......
...@@ -6,11 +6,8 @@ ...@@ -6,11 +6,8 @@
#include "base/command_line.h" #include "base/command_line.h"
#include "base/test/gtest_util.h" #include "base/test/gtest_util.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/test_switches.h" #include "base/test/test_switches.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/common/chrome_features.h"
#include "ui/base/ui_base_features.h"
namespace { namespace {
...@@ -39,17 +36,3 @@ void TestBrowserUi::ShowAndVerifyUi() { ...@@ -39,17 +36,3 @@ void TestBrowserUi::ShowAndVerifyUi() {
else else
DismissUi(); DismissUi();
} }
void TestBrowserUi::UseMdOnly() {
if (enable_md_)
return;
enable_md_ = std::make_unique<base::test::ScopedFeatureList>();
enable_md_->InitWithFeatures(
#if defined(OS_MACOSX)
{features::kSecondaryUiMd, features::kShowAllDialogsWithViewsToolkit},
#else
{features::kSecondaryUiMd},
#endif
{});
}
...@@ -11,12 +11,6 @@ ...@@ -11,12 +11,6 @@
#include "base/macros.h" #include "base/macros.h"
#include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/in_process_browser_test.h"
namespace base {
namespace test {
class ScopedFeatureList;
} // namespace test
} // namespace base
// TestBrowserUi provides a way to register an InProcessBrowserTest testing // TestBrowserUi provides a way to register an InProcessBrowserTest testing
// harness with a framework that invokes Chrome browser UI in a consistent way. // harness with a framework that invokes Chrome browser UI in a consistent way.
// It optionally provides a way to invoke UI "interactively". This allows // It optionally provides a way to invoke UI "interactively". This allows
...@@ -101,14 +95,7 @@ class TestBrowserUi { ...@@ -101,14 +95,7 @@ class TestBrowserUi {
// with no other code. // with no other code.
void ShowAndVerifyUi(); void ShowAndVerifyUi();
// Convenience method to force-enable features::kSecondaryUiMd for this test
// on all platforms. This should be called in an override of SetUp().
void UseMdOnly();
private: private:
// If non-null, forces secondary UI to MD.
std::unique_ptr<base::test::ScopedFeatureList> enable_md_;
DISALLOW_COPY_AND_ASSIGN(TestBrowserUi); DISALLOW_COPY_AND_ASSIGN(TestBrowserUi);
}; };
......
...@@ -10,12 +10,6 @@ class UpdateRecommendedDialogTest : public DialogBrowserTest { ...@@ -10,12 +10,6 @@ class UpdateRecommendedDialogTest : public DialogBrowserTest {
public: public:
UpdateRecommendedDialogTest() {} UpdateRecommendedDialogTest() {}
// DialogBrowserTest:
void SetUp() override {
UseMdOnly();
DialogBrowserTest::SetUp();
}
void ShowUi(const std::string& name) override { void ShowUi(const std::string& name) override {
InProcessBrowserTest::browser()->window()->ShowUpdateChromeDialog(); InProcessBrowserTest::browser()->window()->ShowUpdateChromeDialog();
} }
......
...@@ -48,9 +48,6 @@ class ExtensionMessageBubbleViewBrowserTest ...@@ -48,9 +48,6 @@ class ExtensionMessageBubbleViewBrowserTest
ExtensionMessageBubbleViewBrowserTest() {} ExtensionMessageBubbleViewBrowserTest() {}
~ExtensionMessageBubbleViewBrowserTest() override {} ~ExtensionMessageBubbleViewBrowserTest() override {}
// ExtensionMessageBubbleBrowserTest:
void SetUp() override;
// TestBrowserDialog: // TestBrowserDialog:
void ShowUi(const std::string& name) override; void ShowUi(const std::string& name) override;
...@@ -71,14 +68,6 @@ class ExtensionMessageBubbleViewBrowserTest ...@@ -71,14 +68,6 @@ class ExtensionMessageBubbleViewBrowserTest
DISALLOW_COPY_AND_ASSIGN(ExtensionMessageBubbleViewBrowserTest); DISALLOW_COPY_AND_ASSIGN(ExtensionMessageBubbleViewBrowserTest);
}; };
void ExtensionMessageBubbleViewBrowserTest::SetUp() {
// MD is required on Mac to get a Views bubble. On other platforms, it should
// not affect the behavior of the bubble (just the appearance), so enable for
// all platforms.
UseMdOnly();
SupportsTestUi::SetUp();
}
void ExtensionMessageBubbleViewBrowserTest::ShowUi(const std::string& name) { void ExtensionMessageBubbleViewBrowserTest::ShowUi(const std::string& name) {
// When invoked this way, the dialog test harness must close the bubble. // When invoked this way, the dialog test harness must close the bubble.
base::AutoReset<bool> guard(&block_close_, true); base::AutoReset<bool> guard(&block_close_, true);
......
...@@ -44,14 +44,6 @@ class PasswordBubbleBrowserTest ...@@ -44,14 +44,6 @@ class PasswordBubbleBrowserTest
} }
} }
// SupportsTestUi:
void SetUp() override {
#if defined(OS_MACOSX)
UseMdOnly(); // This needs to be called during SetUp() on Mac.
#endif
SupportsTestUi::SetUp();
}
private: private:
DISALLOW_COPY_AND_ASSIGN(PasswordBubbleBrowserTest); DISALLOW_COPY_AND_ASSIGN(PasswordBubbleBrowserTest);
}; };
......
...@@ -13,11 +13,6 @@ class RelaunchRecommendedBubbleViewDialogTest : public DialogBrowserTest { ...@@ -13,11 +13,6 @@ class RelaunchRecommendedBubbleViewDialogTest : public DialogBrowserTest {
protected: protected:
RelaunchRecommendedBubbleViewDialogTest() = default; RelaunchRecommendedBubbleViewDialogTest() = default;
void SetUp() override {
UseMdOnly();
DialogBrowserTest::SetUp();
}
// DialogBrowserTest: // DialogBrowserTest:
void ShowUi(const std::string& name) override { void ShowUi(const std::string& name) override {
base::TimeTicks detection_time = base::TimeTicks detection_time =
......
...@@ -13,11 +13,6 @@ class RelaunchRequiredDialogViewDialogTest : public DialogBrowserTest { ...@@ -13,11 +13,6 @@ class RelaunchRequiredDialogViewDialogTest : public DialogBrowserTest {
protected: protected:
RelaunchRequiredDialogViewDialogTest() = default; RelaunchRequiredDialogViewDialogTest() = default;
void SetUp() override {
UseMdOnly();
DialogBrowserTest::SetUp();
}
// DialogBrowserTest: // DialogBrowserTest:
void ShowUi(const std::string& name) override { void ShowUi(const std::string& name) override {
base::TimeTicks deadline = base::TimeTicks deadline =
......
...@@ -37,12 +37,6 @@ class ProfileSigninConfirmationDialogTest : public DialogBrowserTest { ...@@ -37,12 +37,6 @@ class ProfileSigninConfirmationDialogTest : public DialogBrowserTest {
public: public:
ProfileSigninConfirmationDialogTest() {} ProfileSigninConfirmationDialogTest() {}
// DialogBrowserTest:
void SetUp() override {
UseMdOnly();
DialogBrowserTest::SetUp();
}
void ShowUi(const std::string& name) override { void ShowUi(const std::string& name) override {
Profile* profile = browser()->profile(); Profile* profile = browser()->profile();
......
...@@ -289,11 +289,6 @@ class TryChromeDialogTest ...@@ -289,11 +289,6 @@ class TryChromeDialogTest
TryChromeDialogTest() TryChromeDialogTest()
: SupportsTestDialog<TryChromeDialogBrowserTestBase>(GetParam()) {} : SupportsTestDialog<TryChromeDialogBrowserTestBase>(GetParam()) {}
// SupportsTestUi:
void SetUp() override {
UseMdOnly();
SupportsTestUi::SetUp();
}
void ShowUi(const std::string& name) override { ShowDialogSync(); } void ShowUi(const std::string& name) override { ShowDialogSync(); }
private: private:
......
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