| Index: chrome/browser/chromeos/settings/device_settings_test_helper.cc
|
| diff --git a/chrome/browser/chromeos/settings/device_settings_test_helper.cc b/chrome/browser/chromeos/settings/device_settings_test_helper.cc
|
| index 06fd21c3abe9cdb2d824ba271091bc00300b7c24..9898b7c2f78c4b8f76499c38f1e1ccbcb865c2e1 100644
|
| --- a/chrome/browser/chromeos/settings/device_settings_test_helper.cc
|
| +++ b/chrome/browser/chromeos/settings/device_settings_test_helper.cc
|
| @@ -17,6 +17,7 @@
|
| #include "chromeos/dbus/dbus_thread_manager.h"
|
| #include "components/ownership/mock_owner_key_util.h"
|
| #include "content/public/browser/browser_thread.h"
|
| +#include "content/public/test/test_utils.h"
|
|
|
| namespace chromeos {
|
|
|
| @@ -24,17 +25,6 @@ DeviceSettingsTestHelper::DeviceSettingsTestHelper() {}
|
|
|
| DeviceSettingsTestHelper::~DeviceSettingsTestHelper() {}
|
|
|
| -void DeviceSettingsTestHelper::FlushLoops() {
|
| - // DeviceSettingsService may trigger operations that hop back and forth
|
| - // between the message loop and the blocking pool. 2 iterations are currently
|
| - // sufficient (key loading, signing).
|
| - for (int i = 0; i < 2; ++i) {
|
| - base::MessageLoop::current()->RunUntilIdle();
|
| - content::BrowserThread::GetBlockingPool()->FlushForTesting();
|
| - }
|
| - base::MessageLoop::current()->RunUntilIdle();
|
| -}
|
| -
|
| void DeviceSettingsTestHelper::FlushStore() {
|
| std::vector<StorePolicyCallback> callbacks;
|
| callbacks.swap(device_policy_.store_callbacks_);
|
| @@ -78,11 +68,11 @@ void DeviceSettingsTestHelper::FlushRetrieve() {
|
|
|
| void DeviceSettingsTestHelper::Flush() {
|
| do {
|
| - FlushLoops();
|
| + content::RunAllBlockingPoolTasksUntilIdle();
|
| FlushStore();
|
| - FlushLoops();
|
| + content::RunAllBlockingPoolTasksUntilIdle();
|
| FlushRetrieve();
|
| - FlushLoops();
|
| + content::RunAllBlockingPoolTasksUntilIdle();
|
| } while (HasPendingOperations());
|
| }
|
|
|
|
|