| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef ASH_COMMON_TEST_ASH_TEST_H_ | 5 #ifndef ASH_COMMON_TEST_ASH_TEST_H_ |
| 6 #define ASH_COMMON_TEST_ASH_TEST_H_ | 6 #define ASH_COMMON_TEST_ASH_TEST_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "ash/common/shell_window_ids.h" | 11 #include "ash/common/shell_window_ids.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 #include "ui/display/manager/display_layout.h" | 14 #include "ui/display/manager/display_layout.h" |
| 15 #include "ui/gfx/geometry/rect.h" | 15 #include "ui/gfx/geometry/rect.h" |
| 16 #include "ui/views/widget/widget.h" | 16 #include "ui/views/widget/widget.h" |
| 17 #include "ui/wm/public/window_types.h" | 17 #include "ui/wm/public/window_types.h" |
| 18 | 18 |
| 19 namespace display { | 19 namespace display { |
| 20 class Display; | 20 class Display; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace views { | 23 namespace views { |
| 24 class WidgetDelegate; | 24 class WidgetDelegate; |
| 25 } | 25 } |
| 26 | 26 |
| 27 namespace ash { | 27 namespace ash { |
| 28 | 28 |
| 29 class AshTestImpl; | 29 class AshTestImpl; |
| 30 class SystemTray; |
| 30 class WmShelf; | 31 class WmShelf; |
| 31 class WmWindow; | 32 class WmWindow; |
| 32 | 33 |
| 33 // Wraps a WmWindow calling WmWindow::Destroy() from the destructor. WmWindow is | 34 // Wraps a WmWindow calling WmWindow::Destroy() from the destructor. WmWindow is |
| 34 // owned by the corresponding window implementation. The only way to delete | 35 // owned by the corresponding window implementation. The only way to delete |
| 35 // WmWindow is to call WmWindow::Destroy(), which deletes the corresponding | 36 // WmWindow is to call WmWindow::Destroy(), which deletes the corresponding |
| 36 // window, then the WmWindow. This class calls WmWindow::Destroy() from its | 37 // window, then the WmWindow. This class calls WmWindow::Destroy() from its |
| 37 // destructor. | 38 // destructor. |
| 38 class WindowOwner { | 39 class WindowOwner { |
| 39 public: | 40 public: |
| (...skipping 16 matching lines...) Expand all Loading... |
| 56 // use the aura backend depend on "//ash/test:ash_with_aura_test_support." The | 57 // use the aura backend depend on "//ash/test:ash_with_aura_test_support." The |
| 57 // mus backend is not provided as a separate link target. | 58 // mus backend is not provided as a separate link target. |
| 58 class AshTest : public testing::Test { | 59 class AshTest : public testing::Test { |
| 59 public: | 60 public: |
| 60 AshTest(); | 61 AshTest(); |
| 61 ~AshTest() override; | 62 ~AshTest() override; |
| 62 | 63 |
| 63 // Returns the WmShelf for the primary display. | 64 // Returns the WmShelf for the primary display. |
| 64 static WmShelf* GetPrimaryShelf(); | 65 static WmShelf* GetPrimaryShelf(); |
| 65 | 66 |
| 67 // Returns the system tray on the primary display. |
| 68 static SystemTray* GetPrimarySystemTray(); |
| 69 |
| 66 bool SupportsMultipleDisplays() const; | 70 bool SupportsMultipleDisplays() const; |
| 67 | 71 |
| 68 // Update the display configuration as given in |display_spec|. | 72 // Update the display configuration as given in |display_spec|. |
| 69 // See test::DisplayManagerTestApi::UpdateDisplay for more details. | 73 // See test::DisplayManagerTestApi::UpdateDisplay for more details. |
| 70 void UpdateDisplay(const std::string& display_spec); | 74 void UpdateDisplay(const std::string& display_spec); |
| 71 | 75 |
| 72 // Creates a visible window in the appropriate container. If | 76 // Creates a visible window in the appropriate container. If |
| 73 // |bounds_in_screen| is empty the window is added to the primary root | 77 // |bounds_in_screen| is empty the window is added to the primary root |
| 74 // window, otherwise the window is added to the display matching | 78 // window, otherwise the window is added to the display matching |
| 75 // |bounds_in_screen|. |shell_window_id| is the shell window id to give to | 79 // |bounds_in_screen|. |shell_window_id| is the shell window id to give to |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 | 136 |
| 133 private: | 137 private: |
| 134 std::unique_ptr<AshTestImpl> test_impl_; | 138 std::unique_ptr<AshTestImpl> test_impl_; |
| 135 | 139 |
| 136 DISALLOW_COPY_AND_ASSIGN(AshTest); | 140 DISALLOW_COPY_AND_ASSIGN(AshTest); |
| 137 }; | 141 }; |
| 138 | 142 |
| 139 } // namespace ash | 143 } // namespace ash |
| 140 | 144 |
| 141 #endif // ASH_COMMON_TEST_ASH_TEST_H_ | 145 #endif // ASH_COMMON_TEST_ASH_TEST_H_ |
| OLD | NEW |