| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 875 panel->Restore(); | 875 panel->Restore(); |
| 876 WaitForBoundsAnimationFinished(panel); | 876 WaitForBoundsAnimationFinished(panel); |
| 877 EXPECT_EQ(Panel::EXPANDED, panel->expansion_state()); | 877 EXPECT_EQ(Panel::EXPANDED, panel->expansion_state()); |
| 878 EXPECT_EQ(initial_height, panel->GetBounds().height()); | 878 EXPECT_EQ(initial_height, panel->GetBounds().height()); |
| 879 EXPECT_EQ(expected_bottom_on_expanded, panel->GetBounds().bottom()); | 879 EXPECT_EQ(expected_bottom_on_expanded, panel->GetBounds().bottom()); |
| 880 | 880 |
| 881 panel->Close(); | 881 panel->Close(); |
| 882 } | 882 } |
| 883 | 883 |
| 884 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, ChangeAutoHideTaskBarThickness) { | 884 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, ChangeAutoHideTaskBarThickness) { |
| 885 ASSERT_TRUE(base::MessageLoopForUI::IsCurrent()); |
| 886 |
| 885 PanelManager* manager = PanelManager::GetInstance(); | 887 PanelManager* manager = PanelManager::GetInstance(); |
| 886 DockedPanelCollection* docked_collection = manager->docked_collection(); | 888 DockedPanelCollection* docked_collection = manager->docked_collection(); |
| 887 int initial_starting_right_position = | 889 int initial_starting_right_position = |
| 888 docked_collection->StartingRightPosition(); | 890 docked_collection->StartingRightPosition(); |
| 889 | 891 |
| 890 int bottom_bar_thickness = 20; | 892 int bottom_bar_thickness = 20; |
| 891 int right_bar_thickness = 30; | 893 int right_bar_thickness = 30; |
| 892 mock_display_settings_provider()->EnableAutoHidingDesktopBar( | 894 mock_display_settings_provider()->EnableAutoHidingDesktopBar( |
| 893 DisplaySettingsProvider::DESKTOP_BAR_ALIGNED_BOTTOM, | 895 DisplaySettingsProvider::DESKTOP_BAR_ALIGNED_BOTTOM, |
| 894 true, | 896 true, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 913 int bottom_bar_thickness_delta = 10; | 915 int bottom_bar_thickness_delta = 10; |
| 914 bottom_bar_thickness += bottom_bar_thickness_delta; | 916 bottom_bar_thickness += bottom_bar_thickness_delta; |
| 915 int right_bar_thickness_delta = 15; | 917 int right_bar_thickness_delta = 15; |
| 916 right_bar_thickness += right_bar_thickness_delta; | 918 right_bar_thickness += right_bar_thickness_delta; |
| 917 mock_display_settings_provider()->SetDesktopBarThickness( | 919 mock_display_settings_provider()->SetDesktopBarThickness( |
| 918 DisplaySettingsProvider::DESKTOP_BAR_ALIGNED_BOTTOM, | 920 DisplaySettingsProvider::DESKTOP_BAR_ALIGNED_BOTTOM, |
| 919 bottom_bar_thickness); | 921 bottom_bar_thickness); |
| 920 mock_display_settings_provider()->SetDesktopBarThickness( | 922 mock_display_settings_provider()->SetDesktopBarThickness( |
| 921 DisplaySettingsProvider::DESKTOP_BAR_ALIGNED_RIGHT, | 923 DisplaySettingsProvider::DESKTOP_BAR_ALIGNED_RIGHT, |
| 922 right_bar_thickness); | 924 right_bar_thickness); |
| 923 base::MessageLoopForUI::current()->RunUntilIdle(); | 925 base::RunLoop().RunUntilIdle(); |
| 924 EXPECT_EQ(initial_starting_right_position, | 926 EXPECT_EQ(initial_starting_right_position, |
| 925 docked_collection->StartingRightPosition()); | 927 docked_collection->StartingRightPosition()); |
| 926 EXPECT_EQ(docked_collection->work_area().bottom() - bottom_bar_thickness, | 928 EXPECT_EQ(docked_collection->work_area().bottom() - bottom_bar_thickness, |
| 927 panel->GetBounds().bottom()); | 929 panel->GetBounds().bottom()); |
| 928 EXPECT_EQ(docked_collection->StartingRightPosition(), | 930 EXPECT_EQ(docked_collection->StartingRightPosition(), |
| 929 panel->GetBounds().right()); | 931 panel->GetBounds().right()); |
| 930 | 932 |
| 931 initial_starting_right_position = docked_collection->StartingRightPosition(); | 933 initial_starting_right_position = docked_collection->StartingRightPosition(); |
| 932 bottom_bar_thickness_delta = 20; | 934 bottom_bar_thickness_delta = 20; |
| 933 bottom_bar_thickness -= bottom_bar_thickness_delta; | 935 bottom_bar_thickness -= bottom_bar_thickness_delta; |
| 934 right_bar_thickness_delta = 10; | 936 right_bar_thickness_delta = 10; |
| 935 right_bar_thickness -= right_bar_thickness_delta; | 937 right_bar_thickness -= right_bar_thickness_delta; |
| 936 mock_display_settings_provider()->SetDesktopBarThickness( | 938 mock_display_settings_provider()->SetDesktopBarThickness( |
| 937 DisplaySettingsProvider::DESKTOP_BAR_ALIGNED_BOTTOM, | 939 DisplaySettingsProvider::DESKTOP_BAR_ALIGNED_BOTTOM, |
| 938 bottom_bar_thickness); | 940 bottom_bar_thickness); |
| 939 mock_display_settings_provider()->SetDesktopBarThickness( | 941 mock_display_settings_provider()->SetDesktopBarThickness( |
| 940 DisplaySettingsProvider::DESKTOP_BAR_ALIGNED_RIGHT, | 942 DisplaySettingsProvider::DESKTOP_BAR_ALIGNED_RIGHT, |
| 941 right_bar_thickness); | 943 right_bar_thickness); |
| 942 base::MessageLoopForUI::current()->RunUntilIdle(); | 944 base::RunLoop().RunUntilIdle(); |
| 943 EXPECT_EQ(docked_collection->StartingRightPosition(), | 945 EXPECT_EQ(docked_collection->StartingRightPosition(), |
| 944 initial_starting_right_position); | 946 initial_starting_right_position); |
| 945 EXPECT_EQ(docked_collection->work_area().bottom() - bottom_bar_thickness, | 947 EXPECT_EQ(docked_collection->work_area().bottom() - bottom_bar_thickness, |
| 946 panel->GetBounds().bottom()); | 948 panel->GetBounds().bottom()); |
| 947 EXPECT_EQ(docked_collection->StartingRightPosition(), | 949 EXPECT_EQ(docked_collection->StartingRightPosition(), |
| 948 panel->GetBounds().right()); | 950 panel->GetBounds().right()); |
| 949 | 951 |
| 950 panel->Close(); | 952 panel->Close(); |
| 951 } | 953 } |
| 952 | 954 |
| (...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1760 #else | 1762 #else |
| 1761 #define MAYBE_FocusChangeEventOnMinimize FocusChangeEventOnMinimize | 1763 #define MAYBE_FocusChangeEventOnMinimize FocusChangeEventOnMinimize |
| 1762 #endif | 1764 #endif |
| 1763 IN_PROC_BROWSER_TEST_F(PanelExtensionApiTest, | 1765 IN_PROC_BROWSER_TEST_F(PanelExtensionApiTest, |
| 1764 MAYBE_FocusChangeEventOnMinimize) { | 1766 MAYBE_FocusChangeEventOnMinimize) { |
| 1765 // This is needed so the subsequently created panels can be activated. | 1767 // This is needed so the subsequently created panels can be activated. |
| 1766 // On a Mac, it transforms background-only test process into foreground one. | 1768 // On a Mac, it transforms background-only test process into foreground one. |
| 1767 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); | 1769 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); |
| 1768 ASSERT_TRUE(RunExtensionTest("panels/focus_change_on_minimize")) << message_; | 1770 ASSERT_TRUE(RunExtensionTest("panels/focus_change_on_minimize")) << message_; |
| 1769 } | 1771 } |
| OLD | NEW |