| 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_CHROMEOS_SETTINGS_DEVICE_SETTINGS_TEST_HELPER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_SETTINGS_TEST_HELPER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_SETTINGS_TEST_HELPER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_SETTINGS_TEST_HELPER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 // interface. The pattern is to initialize DeviceSettingsService with the helper | 35 // interface. The pattern is to initialize DeviceSettingsService with the helper |
| 36 // for the SessionManagerClient pointer. The helper records calls made by | 36 // for the SessionManagerClient pointer. The helper records calls made by |
| 37 // DeviceSettingsService. The test can then verify state, after which it should | 37 // DeviceSettingsService. The test can then verify state, after which it should |
| 38 // call one of the Flush() variants that will resume processing. | 38 // call one of the Flush() variants that will resume processing. |
| 39 class DeviceSettingsTestHelper : public SessionManagerClient { | 39 class DeviceSettingsTestHelper : public SessionManagerClient { |
| 40 public: | 40 public: |
| 41 // Wraps a device settings service instance for testing. | 41 // Wraps a device settings service instance for testing. |
| 42 DeviceSettingsTestHelper(); | 42 DeviceSettingsTestHelper(); |
| 43 virtual ~DeviceSettingsTestHelper(); | 43 virtual ~DeviceSettingsTestHelper(); |
| 44 | 44 |
| 45 // Flushes operations on the current message loop and the blocking pool. | |
| 46 void FlushLoops(); | |
| 47 | |
| 48 // Runs all pending store callbacks. | 45 // Runs all pending store callbacks. |
| 49 void FlushStore(); | 46 void FlushStore(); |
| 50 | 47 |
| 51 // Runs all pending retrieve callbacks. | 48 // Runs all pending retrieve callbacks. |
| 52 void FlushRetrieve(); | 49 void FlushRetrieve(); |
| 53 | 50 |
| 54 // Flushes all pending operations. | 51 // Flushes all pending operations. |
| 55 void Flush(); | 52 void Flush(); |
| 56 | 53 |
| 57 // Checks whether any asynchronous Store/Retrieve operations are pending. | 54 // Checks whether any asynchronous Store/Retrieve operations are pending. |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 | 193 |
| 197 scoped_ptr<DBusThreadManagerSetter> dbus_setter_; | 194 scoped_ptr<DBusThreadManagerSetter> dbus_setter_; |
| 198 | 195 |
| 199 private: | 196 private: |
| 200 DISALLOW_COPY_AND_ASSIGN(DeviceSettingsTestBase); | 197 DISALLOW_COPY_AND_ASSIGN(DeviceSettingsTestBase); |
| 201 }; | 198 }; |
| 202 | 199 |
| 203 } // namespace chromeos | 200 } // namespace chromeos |
| 204 | 201 |
| 205 #endif // CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_SETTINGS_TEST_HELPER_H_ | 202 #endif // CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_SETTINGS_TEST_HELPER_H_ |
| OLD | NEW |