| 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 22 matching lines...) Expand all Loading... |
| 33 #include "chrome/test/base/ui_test_utils.h" | 33 #include "chrome/test/base/ui_test_utils.h" |
| 34 #include "content/public/browser/native_web_keyboard_event.h" | 34 #include "content/public/browser/native_web_keyboard_event.h" |
| 35 #include "content/public/browser/notification_service.h" | 35 #include "content/public/browser/notification_service.h" |
| 36 #include "content/public/browser/web_contents.h" | 36 #include "content/public/browser/web_contents.h" |
| 37 #include "content/public/common/url_constants.h" | 37 #include "content/public/common/url_constants.h" |
| 38 #include "content/public/test/browser_test_utils.h" | 38 #include "content/public/test/browser_test_utils.h" |
| 39 #include "content/test/net/url_request_mock_http_job.h" | 39 #include "content/test/net/url_request_mock_http_job.h" |
| 40 #include "extensions/common/constants.h" | 40 #include "extensions/common/constants.h" |
| 41 #include "net/base/net_util.h" | 41 #include "net/base/net_util.h" |
| 42 #include "testing/gtest/include/gtest/gtest.h" | 42 #include "testing/gtest/include/gtest/gtest.h" |
| 43 #include "ui/base/hit_test.h" |
| 43 #include "ui/events/event_utils.h" | 44 #include "ui/events/event_utils.h" |
| 44 #include "ui/gfx/screen.h" | 45 #include "ui/gfx/screen.h" |
| 45 | 46 |
| 46 using content::WebContents; | 47 using content::WebContents; |
| 47 | 48 |
| 48 class PanelBrowserTest : public BasePanelBrowserTest { | 49 class PanelBrowserTest : public BasePanelBrowserTest { |
| 49 public: | 50 public: |
| 50 PanelBrowserTest() : BasePanelBrowserTest() { | 51 PanelBrowserTest() : BasePanelBrowserTest() { |
| 51 } | 52 } |
| 52 | 53 |
| (...skipping 1519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1572 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, | 1573 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, |
| 1573 MAYBE_CustomMaxSizeOnDisplaySettingsChange) { | 1574 MAYBE_CustomMaxSizeOnDisplaySettingsChange) { |
| 1574 PanelManager* panel_manager = PanelManager::GetInstance(); | 1575 PanelManager* panel_manager = PanelManager::GetInstance(); |
| 1575 Panel* panel = CreatePanelWithBounds("1", gfx::Rect(0, 0, 240, 220)); | 1576 Panel* panel = CreatePanelWithBounds("1", gfx::Rect(0, 0, 240, 220)); |
| 1576 | 1577 |
| 1577 // Trigger custom max size by user resizing. | 1578 // Trigger custom max size by user resizing. |
| 1578 gfx::Size bigger_size = gfx::Size(550, 400); | 1579 gfx::Size bigger_size = gfx::Size(550, 400); |
| 1579 gfx::Point mouse_location = panel->GetBounds().origin(); | 1580 gfx::Point mouse_location = panel->GetBounds().origin(); |
| 1580 panel_manager->StartResizingByMouse(panel, | 1581 panel_manager->StartResizingByMouse(panel, |
| 1581 mouse_location, | 1582 mouse_location, |
| 1582 panel::RESIZE_TOP_LEFT); | 1583 HTTOPLEFT); |
| 1583 mouse_location.Offset(panel->GetBounds().width() - bigger_size.width(), | 1584 mouse_location.Offset(panel->GetBounds().width() - bigger_size.width(), |
| 1584 panel->GetBounds().height() - bigger_size.height()); | 1585 panel->GetBounds().height() - bigger_size.height()); |
| 1585 panel_manager->ResizeByMouse(mouse_location); | 1586 panel_manager->ResizeByMouse(mouse_location); |
| 1586 panel_manager->EndResizingByMouse(false); | 1587 panel_manager->EndResizingByMouse(false); |
| 1587 | 1588 |
| 1588 gfx::Size old_max_size = panel->max_size(); | 1589 gfx::Size old_max_size = panel->max_size(); |
| 1589 EXPECT_EQ(bigger_size, old_max_size); | 1590 EXPECT_EQ(bigger_size, old_max_size); |
| 1590 gfx::Size old_full_size = panel->full_size(); | 1591 gfx::Size old_full_size = panel->full_size(); |
| 1591 EXPECT_EQ(bigger_size, old_full_size); | 1592 EXPECT_EQ(bigger_size, old_full_size); |
| 1592 | 1593 |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1781 #else | 1782 #else |
| 1782 #define MAYBE_FocusChangeEventOnMinimize FocusChangeEventOnMinimize | 1783 #define MAYBE_FocusChangeEventOnMinimize FocusChangeEventOnMinimize |
| 1783 #endif | 1784 #endif |
| 1784 IN_PROC_BROWSER_TEST_F(PanelExtensionApiTest, | 1785 IN_PROC_BROWSER_TEST_F(PanelExtensionApiTest, |
| 1785 MAYBE_FocusChangeEventOnMinimize) { | 1786 MAYBE_FocusChangeEventOnMinimize) { |
| 1786 // This is needed so the subsequently created panels can be activated. | 1787 // This is needed so the subsequently created panels can be activated. |
| 1787 // On a Mac, it transforms background-only test process into foreground one. | 1788 // On a Mac, it transforms background-only test process into foreground one. |
| 1788 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); | 1789 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); |
| 1789 ASSERT_TRUE(RunExtensionTest("panels/focus_change_on_minimize")) << message_; | 1790 ASSERT_TRUE(RunExtensionTest("panels/focus_change_on_minimize")) << message_; |
| 1790 } | 1791 } |
| OLD | NEW |