| Index: chrome/browser/ui/views/extensions/extension_uninstall_dialog_view_browsertest.cc
|
| diff --git a/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view_browsertest.cc b/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view_browsertest.cc
|
| index 166413349501ab0918a2437799c5cdb1ef5a4241..3315530c81aca39d7cd924d14c44ee610c633354 100644
|
| --- a/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view_browsertest.cc
|
| +++ b/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view_browsertest.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 "base/command_line.h"
|
| #include "base/macros.h"
|
| #include "base/run_loop.h"
|
| #include "chrome/browser/extensions/extension_service.h"
|
| @@ -14,12 +15,8 @@
|
| #include "extensions/common/extension.h"
|
| #include "extensions/common/extension_builder.h"
|
| #include "extensions/common/value_builder.h"
|
| -
|
| -#if defined(OS_MACOSX)
|
| -#include "base/command_line.h"
|
| -#include "chrome/browser/ui/browser_dialogs.h"
|
| -#include "content/public/common/content_switches.h"
|
| -#endif
|
| +#include "ui/base/ui_base_switches.h"
|
| +#include "ui/views/widget/widget.h"
|
|
|
| namespace {
|
|
|
| @@ -58,19 +55,27 @@ class TestExtensionUninstallDialogDelegate
|
|
|
| } // namespace
|
|
|
| -typedef InProcessBrowserTest ExtensionUninstallDialogViewBrowserTest;
|
| +class ExtensionUninstallDialogViewBrowserTest : public InProcessBrowserTest {
|
| + public:
|
| + ExtensionUninstallDialogViewBrowserTest() {}
|
|
|
| -// Test that ExtensionUninstallDialog cancels the uninstall if the aura::Window
|
| -// which is passed to ExtensionUninstallDialog::Create() is destroyed before
|
| -// ExtensionUninstallDialogDelegateView is created.
|
| -IN_PROC_BROWSER_TEST_F(ExtensionUninstallDialogViewBrowserTest,
|
| - TrackParentWindowDestruction) {
|
| + // InProcessBrowserTest:
|
| + void SetUpCommandLine(base::CommandLine* command_line) override {
|
| #if defined(OS_MACOSX)
|
| - base::CommandLine::ForCurrentProcess()->
|
| - AppendSwitchASCII(switches::kEnableFeatures,
|
| - chrome::kMacViewsWebUIDialogs.name);
|
| + base::CommandLine::ForCurrentProcess()->AppendSwitch(
|
| + switches::kExtendMdToSecondaryUi);
|
| #endif
|
| + }
|
|
|
| + private:
|
| + DISALLOW_COPY_AND_ASSIGN(ExtensionUninstallDialogViewBrowserTest);
|
| +};
|
| +
|
| +// Test that ExtensionUninstallDialog cancels the uninstall if the Window which
|
| +// is passed to ExtensionUninstallDialog::Create() is destroyed before
|
| +// ExtensionUninstallDialogDelegateView is created.
|
| +IN_PROC_BROWSER_TEST_F(ExtensionUninstallDialogViewBrowserTest,
|
| + TrackParentWindowDestruction) {
|
| scoped_refptr<extensions::Extension> extension(BuildTestExtension());
|
| extensions::ExtensionSystem::Get(browser()->profile())->extension_service()
|
| ->AddExtension(extension.get());
|
| @@ -91,17 +96,11 @@ IN_PROC_BROWSER_TEST_F(ExtensionUninstallDialogViewBrowserTest,
|
| EXPECT_TRUE(delegate.canceled());
|
| }
|
|
|
| -// Test that ExtensionUninstallDialog cancels the uninstall if the aura::Window
|
| -// which is passed to ExtensionUninstallDialog::Create() is destroyed after
|
| +// Test that ExtensionUninstallDialog cancels the uninstall if the Window which
|
| +// is passed to ExtensionUninstallDialog::Create() is destroyed after
|
| // ExtensionUninstallDialogDelegateView is created.
|
| IN_PROC_BROWSER_TEST_F(ExtensionUninstallDialogViewBrowserTest,
|
| TrackParentWindowDestructionAfterViewCreation) {
|
| -#if defined(OS_MACOSX)
|
| - base::CommandLine::ForCurrentProcess()->
|
| - AppendSwitchASCII(switches::kEnableFeatures,
|
| - chrome::kMacViewsWebUIDialogs.name);
|
| -#endif
|
| -
|
| scoped_refptr<extensions::Extension> extension(BuildTestExtension());
|
| extensions::ExtensionSystem::Get(browser()->profile())->extension_service()
|
| ->AddExtension(extension.get());
|
| @@ -121,6 +120,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionUninstallDialogViewBrowserTest,
|
| content::RunAllPendingInMessageLoop();
|
|
|
| // Kill parent window.
|
| + base::RunLoop().Run();
|
| browser()->window()->Close();
|
| run_loop.Run();
|
| EXPECT_TRUE(delegate.canceled());
|
|
|