OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/prefs/pref_service.h" | 6 #include "base/prefs/pref_service.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
10 #include "chrome/browser/devtools/devtools_window.h" | 10 #include "chrome/browser/devtools/devtools_window.h" |
(...skipping 1671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1682 | 1682 |
1683 // Create a test panel with web contents loaded. | 1683 // Create a test panel with web contents loaded. |
1684 CreatePanelParams params("1", gfx::Rect(), SHOW_AS_ACTIVE); | 1684 CreatePanelParams params("1", gfx::Rect(), SHOW_AS_ACTIVE); |
1685 GURL url(ui_test_utils::GetTestUrl( | 1685 GURL url(ui_test_utils::GetTestUrl( |
1686 base::FilePath(kTestDir), | 1686 base::FilePath(kTestDir), |
1687 base::FilePath(FILE_PATH_LITERAL("update-preferred-size.html")))); | 1687 base::FilePath(FILE_PATH_LITERAL("update-preferred-size.html")))); |
1688 params.url = url; | 1688 params.url = url; |
1689 Panel* panel = CreatePanelWithParams(params); | 1689 Panel* panel = CreatePanelWithParams(params); |
1690 EXPECT_EQ(1, panel_manager->num_panels()); | 1690 EXPECT_EQ(1, panel_manager->num_panels()); |
1691 | 1691 |
1692 // Close the panel by acclerator. | 1692 // Close the panel by accelerator. |
1693 content::WindowedNotificationObserver signal( | 1693 content::WindowedNotificationObserver signal( |
1694 chrome::NOTIFICATION_PANEL_CLOSED, | 1694 chrome::NOTIFICATION_PANEL_CLOSED, |
1695 content::Source<Panel>(panel)); | 1695 content::Source<Panel>(panel)); |
1696 #if defined(USE_AURA) | 1696 #if defined(USE_AURA) |
1697 double now = ui::EventTimeForNow().InSecondsF(); | 1697 double now = ui::EventTimeForNow().InSecondsF(); |
1698 content::NativeWebKeyboardEvent key_event( | 1698 content::NativeWebKeyboardEvent key_event( |
1699 ui::ET_KEY_PRESSED, | 1699 ui::ET_KEY_PRESSED, |
1700 false, | 1700 false, |
1701 ui::VKEY_W, | 1701 ui::VKEY_W, |
1702 ui::EF_CONTROL_DOWN, | 1702 ui::EF_CONTROL_DOWN, |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1772 #else | 1772 #else |
1773 #define MAYBE_FocusChangeEventOnMinimize FocusChangeEventOnMinimize | 1773 #define MAYBE_FocusChangeEventOnMinimize FocusChangeEventOnMinimize |
1774 #endif | 1774 #endif |
1775 IN_PROC_BROWSER_TEST_F(PanelExtensionApiTest, | 1775 IN_PROC_BROWSER_TEST_F(PanelExtensionApiTest, |
1776 MAYBE_FocusChangeEventOnMinimize) { | 1776 MAYBE_FocusChangeEventOnMinimize) { |
1777 // This is needed so the subsequently created panels can be activated. | 1777 // This is needed so the subsequently created panels can be activated. |
1778 // On a Mac, it transforms background-only test process into foreground one. | 1778 // On a Mac, it transforms background-only test process into foreground one. |
1779 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); | 1779 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); |
1780 ASSERT_TRUE(RunExtensionTest("panels/focus_change_on_minimize")) << message_; | 1780 ASSERT_TRUE(RunExtensionTest("panels/focus_change_on_minimize")) << message_; |
1781 } | 1781 } |
OLD | NEW |