| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 // Returns the EventGenerator that uses screen coordinates and works | 92 // Returns the EventGenerator that uses screen coordinates and works |
| 93 // across multiple displays. It createse a new generator if it | 93 // across multiple displays. It createse a new generator if it |
| 94 // hasn't been created yet. | 94 // hasn't been created yet. |
| 95 aura::test::EventGenerator& GetEventGenerator(); | 95 aura::test::EventGenerator& GetEventGenerator(); |
| 96 | 96 |
| 97 protected: | 97 protected: |
| 98 // True if the running environment supports multiple displays, | 98 // True if the running environment supports multiple displays, |
| 99 // or false otherwise (e.g. win8 bot). | 99 // or false otherwise (e.g. win8 bot). |
| 100 static bool SupportsMultipleDisplays(); | 100 static bool SupportsMultipleDisplays(); |
| 101 | 101 |
| 102 // True if the running environment supports host window resize, |
| 103 // or false otherwise (e.g. win8 bot). |
| 104 static bool SupportsHostWindowResize(); |
| 105 |
| 102 void RunAllPendingInMessageLoop(); | 106 void RunAllPendingInMessageLoop(); |
| 103 | 107 |
| 104 // Utility methods to emulate user logged in or not, session started or not | 108 // Utility methods to emulate user logged in or not, session started or not |
| 105 // and user able to lock screen or not cases. | 109 // and user able to lock screen or not cases. |
| 106 void SetSessionStarted(bool session_started); | 110 void SetSessionStarted(bool session_started); |
| 107 void SetUserLoggedIn(bool user_logged_in); | 111 void SetUserLoggedIn(bool user_logged_in); |
| 108 void SetCanLockScreen(bool can_lock_screen); | 112 void SetCanLockScreen(bool can_lock_screen); |
| 109 | 113 |
| 110 private: | 114 private: |
| 111 bool setup_called_; | 115 bool setup_called_; |
| 112 bool teardown_called_; | 116 bool teardown_called_; |
| 113 base::MessageLoopForUI message_loop_; | 117 base::MessageLoopForUI message_loop_; |
| 114 scoped_ptr<AshTestHelper> ash_test_helper_; | 118 scoped_ptr<AshTestHelper> ash_test_helper_; |
| 115 scoped_ptr<aura::test::EventGenerator> event_generator_; | 119 scoped_ptr<aura::test::EventGenerator> event_generator_; |
| 116 #if defined(OS_WIN) | 120 #if defined(OS_WIN) |
| 117 // Note that the order is important here as ipc_thread_ should be destroyed | 121 // Note that the order is important here as ipc_thread_ should be destroyed |
| 118 // after metro_viewer_host_->channel_. | 122 // after metro_viewer_host_->channel_. |
| 119 scoped_ptr<base::Thread> ipc_thread_; | 123 scoped_ptr<base::Thread> ipc_thread_; |
| 120 scoped_ptr<TestMetroViewerProcessHost> metro_viewer_host_; | 124 scoped_ptr<TestMetroViewerProcessHost> metro_viewer_host_; |
| 121 ui::ScopedOleInitializer ole_initializer_; | 125 ui::ScopedOleInitializer ole_initializer_; |
| 122 #endif | 126 #endif |
| 123 | 127 |
| 124 DISALLOW_COPY_AND_ASSIGN(AshTestBase); | 128 DISALLOW_COPY_AND_ASSIGN(AshTestBase); |
| 125 }; | 129 }; |
| 126 | 130 |
| 127 } // namespace test | 131 } // namespace test |
| 128 } // namespace ash | 132 } // namespace ash |
| 129 | 133 |
| 130 #endif // ASH_TEST_ASH_TEST_BASE_H_ | 134 #endif // ASH_TEST_ASH_TEST_BASE_H_ |
| OLD | NEW |