| Index: chrome/browser/ui/panels/panel_browsertest.cc
|
| ===================================================================
|
| --- chrome/browser/ui/panels/panel_browsertest.cc (revision 170118)
|
| +++ chrome/browser/ui/panels/panel_browsertest.cc (working copy)
|
| @@ -6,6 +6,7 @@
|
| #include "base/utf_string_conversions.h"
|
| #include "chrome/app/chrome_command_ids.h"
|
| #include "chrome/browser/debugger/devtools_window.h"
|
| +#include "chrome/browser/extensions/extension_apitest.h"
|
| #include "chrome/browser/net/url_request_mock_util.h"
|
| #include "chrome/browser/prefs/browser_prefs.h"
|
| #include "chrome/browser/prefs/pref_service.h"
|
| @@ -25,9 +26,11 @@
|
| #include "chrome/browser/ui/panels/test_panel_active_state_observer.h"
|
| #include "chrome/browser/web_applications/web_app.h"
|
| #include "chrome/common/chrome_notification_types.h"
|
| +#include "chrome/common/chrome_switches.h"
|
| #include "chrome/common/extensions/extension_manifest_constants.h"
|
| #include "chrome/common/pref_names.h"
|
| #include "chrome/common/url_constants.h"
|
| +#include "chrome/test/base/interactive_test_utils.h"
|
| #include "chrome/test/base/ui_test_utils.h"
|
| #include "content/public/browser/native_web_keyboard_event.h"
|
| #include "content/public/browser/notification_service.h"
|
| @@ -1747,3 +1750,26 @@
|
| signal.Wait();
|
| EXPECT_EQ(0, panel_manager->num_panels());
|
| }
|
| +
|
| +class PanelExtensionApiTest : public ExtensionApiTest {
|
| + protected:
|
| + virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
|
| + ExtensionApiTest::SetUpCommandLine(command_line);
|
| + command_line->AppendSwitch(switches::kEnablePanels);
|
| + }
|
| +};
|
| +
|
| +#if defined(OS_LINUX) || defined(USE_AURA)
|
| +// Focus test fails if there is no window manager on Linux.
|
| +// Aura panels have different behavior that do not apply to this test.
|
| +#define MAYBE_FocusChangeEventOnMinimize DISABLED_FocusChangeEventOnMinimize
|
| +#else
|
| +#define MAYBE_FocusChangeEventOnMinimize FocusChangeEventOnMinimize
|
| +#endif
|
| +IN_PROC_BROWSER_TEST_F(PanelExtensionApiTest,
|
| + MAYBE_FocusChangeEventOnMinimize) {
|
| + // This is needed so the subsequently created panels can be activated.
|
| + // On a Mac, it transforms background-only test process into foreground one.
|
| + ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
|
| + ASSERT_TRUE(RunExtensionTest("panels/focus_change_on_minimize")) << message_;
|
| +}
|
|
|