| 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 #ifndef ASH_TEST_ASH_TEST_BASE_H_ | 5 #ifndef ASH_TEST_ASH_TEST_BASE_H_ |
| 6 #define ASH_TEST_ASH_TEST_BASE_H_ | 6 #define ASH_TEST_ASH_TEST_BASE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 62 |
| 63 class AshTestBase : public testing::Test { | 63 class AshTestBase : public testing::Test { |
| 64 public: | 64 public: |
| 65 AshTestBase(); | 65 AshTestBase(); |
| 66 ~AshTestBase() override; | 66 ~AshTestBase() override; |
| 67 | 67 |
| 68 // testing::Test: | 68 // testing::Test: |
| 69 void SetUp() override; | 69 void SetUp() override; |
| 70 void TearDown() override; | 70 void TearDown() override; |
| 71 | 71 |
| 72 // Returns the WmShelf for the primary display. |
| 73 static WmShelf* GetPrimaryShelf(); |
| 74 |
| 72 // Returns the system tray on the primary display. | 75 // Returns the system tray on the primary display. |
| 73 static SystemTray* GetPrimarySystemTray(); | 76 static SystemTray* GetPrimarySystemTray(); |
| 74 | 77 |
| 75 // Update the display configuration as given in |display_specs|. | 78 // Update the display configuration as given in |display_specs|. |
| 76 // See ash::test::DisplayManagerTestApi::UpdateDisplay for more details. | 79 // See ash::test::DisplayManagerTestApi::UpdateDisplay for more details. |
| 77 void UpdateDisplay(const std::string& display_specs); | 80 void UpdateDisplay(const std::string& display_specs); |
| 78 | 81 |
| 79 // Returns a root Window. Usually this is the active root Window, but that | 82 // Returns a root Window. Usually this is the active root Window, but that |
| 80 // method can return NULL sometimes, and in those cases, we fall back on the | 83 // method can return NULL sometimes, and in those cases, we fall back on the |
| 81 // primary root Window. | 84 // primary root Window. |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 130 |
| 128 // Returns the rotation currently active for the internal display. | 131 // Returns the rotation currently active for the internal display. |
| 129 static display::Display::Rotation GetCurrentInternalDisplayRotation(); | 132 static display::Display::Rotation GetCurrentInternalDisplayRotation(); |
| 130 | 133 |
| 131 // Proxy to AshTestHelper::SupportsMultipleDisplays(). | 134 // Proxy to AshTestHelper::SupportsMultipleDisplays(). |
| 132 static bool SupportsMultipleDisplays(); | 135 static bool SupportsMultipleDisplays(); |
| 133 | 136 |
| 134 // Proxy to AshTestHelper::SupportsHostWindowResize(). | 137 // Proxy to AshTestHelper::SupportsHostWindowResize(). |
| 135 static bool SupportsHostWindowResize(); | 138 static bool SupportsHostWindowResize(); |
| 136 | 139 |
| 137 // Returns the WmShelf for the primary display. | |
| 138 static WmShelf* GetPrimaryShelf(); | |
| 139 | |
| 140 void set_start_session(bool start_session) { start_session_ = start_session; } | 140 void set_start_session(bool start_session) { start_session_ = start_session; } |
| 141 | 141 |
| 142 // Sets material mode for the test. This will override material mode set via | 142 // Sets material mode for the test. This will override material mode set via |
| 143 // command line switches. | 143 // command line switches. |
| 144 void set_material_mode(MaterialDesignController::Mode material_mode) { | 144 void set_material_mode(MaterialDesignController::Mode material_mode) { |
| 145 CHECK(!setup_called_); | 145 CHECK(!setup_called_); |
| 146 material_mode_ = material_mode; | 146 material_mode_ = material_mode; |
| 147 } | 147 } |
| 148 | 148 |
| 149 AshTestHelper* ash_test_helper() { return ash_test_helper_.get(); } | 149 AshTestHelper* ash_test_helper() { return ash_test_helper_.get(); } |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 ~NoSessionAshTestBase() override {} | 195 ~NoSessionAshTestBase() override {} |
| 196 | 196 |
| 197 private: | 197 private: |
| 198 DISALLOW_COPY_AND_ASSIGN(NoSessionAshTestBase); | 198 DISALLOW_COPY_AND_ASSIGN(NoSessionAshTestBase); |
| 199 }; | 199 }; |
| 200 | 200 |
| 201 } // namespace test | 201 } // namespace test |
| 202 } // namespace ash | 202 } // namespace ash |
| 203 | 203 |
| 204 #endif // ASH_TEST_ASH_TEST_BASE_H_ | 204 #endif // ASH_TEST_ASH_TEST_BASE_H_ |
| OLD | NEW |