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 CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_FULLSCREEN_CONTROLLER_STATE_TEST_H_ | 5 #ifndef CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_FULLSCREEN_CONTROLLER_STATE_TEST_H_ |
6 #define CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_FULLSCREEN_CONTROLLER_STATE_TEST_H_ | 6 #define CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_FULLSCREEN_CONTROLLER_STATE_TEST_H_ |
7 | 7 |
| 8 #include <memory> |
8 #include <sstream> | 9 #include <sstream> |
9 | 10 |
10 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
11 #include "base/macros.h" | 12 #include "base/macros.h" |
12 #include "base/memory/scoped_ptr.h" | |
13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
14 | 14 |
15 class Browser; | 15 class Browser; |
16 class FullscreenController; | 16 class FullscreenController; |
17 class FullscreenNotificationObserver; | 17 class FullscreenNotificationObserver; |
18 | 18 |
19 // Utility definition for mapping enum values to strings in switch statements. | 19 // Utility definition for mapping enum values to strings in switch statements. |
20 #define ENUM_TO_STRING(enum) case enum: return #enum | 20 #define ENUM_TO_STRING(enum) case enum: return #enum |
21 | 21 |
22 // Test fixture used to test Fullscreen Controller through exhaustive sequences | 22 // Test fixture used to test Fullscreen Controller through exhaustive sequences |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 | 184 |
185 private: | 185 private: |
186 // The state the FullscreenController is expected to be in. | 186 // The state the FullscreenController is expected to be in. |
187 State state_; | 187 State state_; |
188 | 188 |
189 // The state when the previous NOTIFICATION_FULLSCREEN_CHANGED notification | 189 // The state when the previous NOTIFICATION_FULLSCREEN_CHANGED notification |
190 // was received. | 190 // was received. |
191 State last_notification_received_state_; | 191 State last_notification_received_state_; |
192 | 192 |
193 // Listens for the NOTIFICATION_FULLSCREEN_CHANGED notification. | 193 // Listens for the NOTIFICATION_FULLSCREEN_CHANGED notification. |
194 scoped_ptr<FullscreenNotificationObserver> fullscreen_notification_observer_; | 194 std::unique_ptr<FullscreenNotificationObserver> |
| 195 fullscreen_notification_observer_; |
195 | 196 |
196 // Human defined |State| that results given each [state][event] pair. | 197 // Human defined |State| that results given each [state][event] pair. |
197 State transition_table_[NUM_STATES][NUM_EVENTS]; | 198 State transition_table_[NUM_STATES][NUM_EVENTS]; |
198 | 199 |
199 // Generated information about the transitions between states [from][to]. | 200 // Generated information about the transitions between states [from][to]. |
200 // View generated data with: out/Release/unit_tests | 201 // View generated data with: out/Release/unit_tests |
201 // --gtest_filter="FullscreenController*DebugLogStateTables" | 202 // --gtest_filter="FullscreenController*DebugLogStateTables" |
202 // --gtest_also_run_disabled_tests | 203 // --gtest_also_run_disabled_tests |
203 StateTransitionInfo state_transitions_[NUM_STATES][NUM_STATES]; | 204 StateTransitionInfo state_transitions_[NUM_STATES][NUM_STATES]; |
204 | 205 |
205 // Log of operations reported on errors via GetAndClearDebugLog(). | 206 // Log of operations reported on errors via GetAndClearDebugLog(). |
206 std::ostringstream debugging_log_; | 207 std::ostringstream debugging_log_; |
207 | 208 |
208 DISALLOW_COPY_AND_ASSIGN(FullscreenControllerStateTest); | 209 DISALLOW_COPY_AND_ASSIGN(FullscreenControllerStateTest); |
209 }; | 210 }; |
210 | 211 |
211 #endif // CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_FULLSCREEN_CONTROLLER_STATE_TEST_H
_ | 212 #endif // CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_FULLSCREEN_CONTROLLER_STATE_TEST_H
_ |
OLD | NEW |