| Index: chrome/browser/chromeos/login/merge_session_load_page_unittest.cc
|
| diff --git a/chrome/browser/chromeos/login/merge_session_load_page_unittest.cc b/chrome/browser/chromeos/login/merge_session_load_page_unittest.cc
|
| index 8eef9c0b4ba14dab9307dbf4fb4699066085a014..e110a7c9e99fba1af03786de9e7bcfeb74dedb44 100644
|
| --- a/chrome/browser/chromeos/login/merge_session_load_page_unittest.cc
|
| +++ b/chrome/browser/chromeos/login/merge_session_load_page_unittest.cc
|
| @@ -2,6 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +#include "base/run_loop.h"
|
| #include "chrome/browser/chromeos/cros/cros_library.h"
|
| #include "chrome/browser/chromeos/login/merge_session_load_page.h"
|
| #include "chrome/browser/chromeos/login/user_manager.h"
|
| @@ -11,7 +12,6 @@
|
| #include "content/public/browser/interstitial_page.h"
|
| #include "content/public/browser/navigation_controller.h"
|
| #include "content/public/browser/web_contents.h"
|
| -#include "content/public/test/test_browser_thread.h"
|
| #include "content/public/test/web_contents_tester.h"
|
|
|
| using content::BrowserThread;
|
| @@ -48,12 +48,21 @@ class TestMergeSessionLoadPage : public MergeSessionLoadPage {
|
| };
|
|
|
| class MergeSessionLoadPageTest : public ChromeRenderViewHostTestHarness {
|
| - public:
|
| - MergeSessionLoadPageTest()
|
| - : ui_thread_(BrowserThread::UI, MessageLoop::current()),
|
| - file_user_blocking_thread_(
|
| - BrowserThread::FILE_USER_BLOCKING, MessageLoop::current()),
|
| - io_thread_(BrowserThread::IO, MessageLoop::current()) {
|
| + protected:
|
| + virtual void SetUp() OVERRIDE {
|
| + ChromeRenderViewHostTestHarness::SetUp();
|
| +#if defined OS_CHROMEOS
|
| + test_user_manager_.reset(new chromeos::ScopedTestUserManager());
|
| +#endif
|
| + }
|
| +
|
| + virtual void TearDown() OVERRIDE {
|
| +#if defined OS_CHROMEOS
|
| + // Clean up pending tasks that might depend on the user manager.
|
| + base::RunLoop().RunUntilIdle();
|
| + test_user_manager_.reset();
|
| +#endif
|
| + ChromeRenderViewHostTestHarness::TearDown();
|
| }
|
|
|
| void Navigate(const char* url, int page_id) {
|
| @@ -73,16 +82,10 @@ class MergeSessionLoadPageTest : public ChromeRenderViewHostTestHarness {
|
| }
|
|
|
| private:
|
| - content::TestBrowserThread ui_thread_;
|
| - content::TestBrowserThread file_user_blocking_thread_;
|
| - content::TestBrowserThread io_thread_;
|
| -
|
| ScopedStubCrosEnabler stub_cros_enabler_;
|
| ScopedTestDeviceSettingsService test_device_settings_service_;
|
| ScopedTestCrosSettings test_cros_settings_;
|
| - ScopedTestUserManager test_user_manager_;
|
| -
|
| - DISALLOW_COPY_AND_ASSIGN(MergeSessionLoadPageTest);
|
| + scoped_ptr<chromeos::ScopedTestUserManager> test_user_manager_;
|
| };
|
|
|
| TEST_F(MergeSessionLoadPageTest, MergeSessionPageNotShown) {
|
| @@ -114,12 +117,12 @@ TEST_F(MergeSessionLoadPageTest, MergeSessionPageShown) {
|
| ShowInterstitial(kURL2);
|
| InterstitialPage* interstitial = GetMergeSessionLoadPage();
|
| ASSERT_TRUE(interstitial);
|
| - MessageLoop::current()->RunUntilIdle();
|
| + base::RunLoop().RunUntilIdle();
|
|
|
| // Simulate merge session completion.
|
| UserManager::Get()->SetMergeSessionState(
|
| UserManager::MERGE_STATUS_DONE);
|
| - MessageLoop::current()->RunUntilIdle();
|
| + base::RunLoop().RunUntilIdle();
|
|
|
| // The URL remains to be URL2.
|
| EXPECT_EQ(kURL2, web_contents()->GetURL().spec());
|
|
|