OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "base/run_loop.h" | 5 #include "base/run_loop.h" |
6 #include "base/time/time.h" | 6 #include "base/time/time.h" |
7 #include "chrome/browser/chromeos/login/signin/merge_session_load_page.h" | 7 #include "chrome/browser/chromeos/login/signin/merge_session_load_page.h" |
8 #include "chrome/browser/chromeos/login/signin/oauth2_login_manager.h" | 8 #include "chrome/browser/chromeos/login/signin/oauth2_login_manager.h" |
9 #include "chrome/browser/chromeos/login/signin/oauth2_login_manager_factory.h" | 9 #include "chrome/browser/chromeos/login/signin/oauth2_login_manager_factory.h" |
10 #include "chrome/browser/chromeos/login/users/scoped_test_user_manager.h" | 10 #include "chrome/browser/chromeos/login/users/scoped_test_user_manager.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 MergeSessionThrottle::CompletionCallback()) { | 41 MergeSessionThrottle::CompletionCallback()) { |
42 interstitial_page_->DontCreateViewForTesting(); | 42 interstitial_page_->DontCreateViewForTesting(); |
43 } | 43 } |
44 | 44 |
45 private: | 45 private: |
46 DISALLOW_COPY_AND_ASSIGN(TestMergeSessionLoadPage); | 46 DISALLOW_COPY_AND_ASSIGN(TestMergeSessionLoadPage); |
47 }; | 47 }; |
48 | 48 |
49 class MergeSessionLoadPageTest : public ChromeRenderViewHostTestHarness { | 49 class MergeSessionLoadPageTest : public ChromeRenderViewHostTestHarness { |
50 protected: | 50 protected: |
51 virtual void SetUp() override { | 51 void SetUp() override { |
52 ChromeRenderViewHostTestHarness::SetUp(); | 52 ChromeRenderViewHostTestHarness::SetUp(); |
53 #if defined OS_CHROMEOS | 53 #if defined OS_CHROMEOS |
54 test_user_manager_.reset(new chromeos::ScopedTestUserManager()); | 54 test_user_manager_.reset(new chromeos::ScopedTestUserManager()); |
55 #endif | 55 #endif |
56 } | 56 } |
57 | 57 |
58 virtual void TearDown() override { | 58 void TearDown() override { |
59 #if defined OS_CHROMEOS | 59 #if defined OS_CHROMEOS |
60 // Clean up pending tasks that might depend on the user manager. | 60 // Clean up pending tasks that might depend on the user manager. |
61 base::RunLoop().RunUntilIdle(); | 61 base::RunLoop().RunUntilIdle(); |
62 test_user_manager_.reset(); | 62 test_user_manager_.reset(); |
63 #endif | 63 #endif |
64 ChromeRenderViewHostTestHarness::TearDown(); | 64 ChromeRenderViewHostTestHarness::TearDown(); |
65 } | 65 } |
66 | 66 |
67 void Navigate(const char* url, int page_id) { | 67 void Navigate(const char* url, int page_id) { |
68 WebContentsTester::For(web_contents())->TestDidNavigate( | 68 WebContentsTester::For(web_contents())->TestDidNavigate( |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 | 168 |
169 // The URL remains to be URL2. | 169 // The URL remains to be URL2. |
170 EXPECT_EQ(kURL2, web_contents()->GetVisibleURL().spec()); | 170 EXPECT_EQ(kURL2, web_contents()->GetVisibleURL().spec()); |
171 | 171 |
172 // Commit navigation and the interstitial page is gone. | 172 // Commit navigation and the interstitial page is gone. |
173 Navigate(kURL2, 2); | 173 Navigate(kURL2, 2); |
174 EXPECT_FALSE(GetMergeSessionLoadPage()); | 174 EXPECT_FALSE(GetMergeSessionLoadPage()); |
175 } | 175 } |
176 | 176 |
177 } // namespace chromeos | 177 } // namespace chromeos |
OLD | NEW |