| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 UI_AURA_TEST_ENV_TEST_HELPER_H_ | 5 #ifndef UI_AURA_TEST_ENV_TEST_HELPER_H_ |
| 6 #define UI_AURA_TEST_ENV_TEST_HELPER_H_ | 6 #define UI_AURA_TEST_ENV_TEST_HELPER_H_ |
| 7 | 7 |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 env_->input_state_lookup_ = std::move(input_state_lookup); | 25 env_->input_state_lookup_ = std::move(input_state_lookup); |
| 26 } | 26 } |
| 27 | 27 |
| 28 void ResetEventState() { | 28 void ResetEventState() { |
| 29 env_->mouse_button_flags_ = 0; | 29 env_->mouse_button_flags_ = 0; |
| 30 env_->is_touch_down_ = false; | 30 env_->is_touch_down_ = false; |
| 31 } | 31 } |
| 32 | 32 |
| 33 void SetMode(Env::Mode mode) { env_->mode_ = mode; } | 33 void SetMode(Env::Mode mode) { env_->mode_ = mode; } |
| 34 | 34 |
| 35 WindowTreeClient* GetWindowTreeClient() { return env_->window_tree_client_; } |
| 36 |
| 35 // This circumvents the DCHECKs in Env::SetWindowTreeClient() and should | 37 // This circumvents the DCHECKs in Env::SetWindowTreeClient() and should |
| 36 // only be used for tests where Env is long lived. | 38 // only be used for tests where Env is long lived. |
| 37 void SetWindowTreeClient(WindowTreeClient* window_tree_client) { | 39 void SetWindowTreeClient(WindowTreeClient* window_tree_client) { |
| 38 env_->window_tree_client_ = window_tree_client; | 40 env_->window_tree_client_ = window_tree_client; |
| 39 } | 41 } |
| 40 | 42 |
| 41 void SetAlwaysUseLastMouseLocation(bool value) { | 43 void SetAlwaysUseLastMouseLocation(bool value) { |
| 42 env_->always_use_last_mouse_location_ = value; | 44 env_->always_use_last_mouse_location_ = value; |
| 43 } | 45 } |
| 44 | 46 |
| 45 private: | 47 private: |
| 46 Env* env_; | 48 Env* env_; |
| 47 | 49 |
| 48 DISALLOW_COPY_AND_ASSIGN(EnvTestHelper); | 50 DISALLOW_COPY_AND_ASSIGN(EnvTestHelper); |
| 49 }; | 51 }; |
| 50 | 52 |
| 51 } // namespace test | 53 } // namespace test |
| 52 } // namespace aura | 54 } // namespace aura |
| 53 | 55 |
| 54 #endif // UI_AURA_TEST_ENV_TEST_HELPER_H_ | 56 #endif // UI_AURA_TEST_ENV_TEST_HELPER_H_ |
| OLD | NEW |