OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/chromeos/cros/cros_library.h" | 5 #include "chrome/browser/chromeos/cros/cros_library.h" |
6 #include "chrome/browser/chromeos/login/merge_session_load_page.h" | 6 #include "chrome/browser/chromeos/login/merge_session_load_page.h" |
| 7 #include "chrome/browser/chromeos/settings/cros_settings.h" |
7 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 8 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
8 #include "content/public/browser/interstitial_page.h" | 9 #include "content/public/browser/interstitial_page.h" |
9 #include "content/public/browser/navigation_controller.h" | 10 #include "content/public/browser/navigation_controller.h" |
10 #include "content/public/browser/web_contents.h" | 11 #include "content/public/browser/web_contents.h" |
11 #include "content/public/test/test_browser_thread.h" | 12 #include "content/public/test/test_browser_thread.h" |
12 #include "content/public/test/web_contents_tester.h" | 13 #include "content/public/test/web_contents_tester.h" |
13 | 14 |
14 using content::BrowserThread; | 15 using content::BrowserThread; |
15 using content::InterstitialPage; | 16 using content::InterstitialPage; |
16 using content::WebContents; | 17 using content::WebContents; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 // showing. | 68 // showing. |
68 InterstitialPage* GetMergeSessionLoadPage() { | 69 InterstitialPage* GetMergeSessionLoadPage() { |
69 return InterstitialPage::GetInterstitialPage(web_contents()); | 70 return InterstitialPage::GetInterstitialPage(web_contents()); |
70 } | 71 } |
71 | 72 |
72 private: | 73 private: |
73 content::TestBrowserThread ui_thread_; | 74 content::TestBrowserThread ui_thread_; |
74 content::TestBrowserThread file_user_blocking_thread_; | 75 content::TestBrowserThread file_user_blocking_thread_; |
75 content::TestBrowserThread io_thread_; | 76 content::TestBrowserThread io_thread_; |
76 | 77 |
77 // Initializes / shuts down a stub CrosLibrary. | |
78 chromeos::ScopedStubCrosEnabler stub_cros_enabler_; | 78 chromeos::ScopedStubCrosEnabler stub_cros_enabler_; |
| 79 chromeos::ScopedTestCrosSettings test_cros_settings_; |
79 | 80 |
80 DISALLOW_COPY_AND_ASSIGN(MergeSessionLoadPageTest); | 81 DISALLOW_COPY_AND_ASSIGN(MergeSessionLoadPageTest); |
81 }; | 82 }; |
82 | 83 |
83 TEST_F(MergeSessionLoadPageTest, MergeSessionPageNotShown) { | 84 TEST_F(MergeSessionLoadPageTest, MergeSessionPageNotShown) { |
84 UserManager::Get()->SetMergeSessionState( | 85 UserManager::Get()->SetMergeSessionState( |
85 UserManager::MERGE_STATUS_DONE); | 86 UserManager::MERGE_STATUS_DONE); |
86 // Start a load. | 87 // Start a load. |
87 Navigate(kURL1, 1); | 88 Navigate(kURL1, 1); |
88 // Load next page. | 89 // Load next page. |
(...skipping 29 matching lines...) Expand all Loading... |
118 | 119 |
119 // The URL remains to be URL2. | 120 // The URL remains to be URL2. |
120 EXPECT_EQ(kURL2, web_contents()->GetURL().spec()); | 121 EXPECT_EQ(kURL2, web_contents()->GetURL().spec()); |
121 | 122 |
122 // Commit navigation and the interstitial page is gone. | 123 // Commit navigation and the interstitial page is gone. |
123 Navigate(kURL2, 2); | 124 Navigate(kURL2, 2); |
124 EXPECT_FALSE(GetMergeSessionLoadPage()); | 125 EXPECT_FALSE(GetMergeSessionLoadPage()); |
125 } | 126 } |
126 | 127 |
127 } // namespace chromeos | 128 } // namespace chromeos |
OLD | NEW |