| 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 <stdint.h> |
| 6 |
| 7 #include "base/macros.h" |
| 5 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 6 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 7 #include "chrome/browser/chromeos/login/signin/merge_session_load_page.h" | 10 #include "chrome/browser/chromeos/login/signin/merge_session_load_page.h" |
| 8 #include "chrome/browser/chromeos/login/signin/oauth2_login_manager.h" | 11 #include "chrome/browser/chromeos/login/signin/oauth2_login_manager.h" |
| 9 #include "chrome/browser/chromeos/login/signin/oauth2_login_manager_factory.h" | 12 #include "chrome/browser/chromeos/login/signin/oauth2_login_manager_factory.h" |
| 10 #include "chrome/browser/chromeos/login/users/scoped_test_user_manager.h" | 13 #include "chrome/browser/chromeos/login/users/scoped_test_user_manager.h" |
| 11 #include "chrome/browser/chromeos/settings/cros_settings.h" | 14 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 12 #include "chrome/browser/chromeos/settings/device_settings_service.h" | 15 #include "chrome/browser/chromeos/settings/device_settings_service.h" |
| 13 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 16 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
| 14 #include "content/public/browser/interstitial_page.h" | 17 #include "content/public/browser/interstitial_page.h" |
| 15 #include "content/public/browser/navigation_controller.h" | 18 #include "content/public/browser/navigation_controller.h" |
| 16 #include "content/public/browser/navigation_entry.h" | 19 #include "content/public/browser/navigation_entry.h" |
| 17 #include "content/public/browser/web_contents.h" | 20 #include "content/public/browser/web_contents.h" |
| 18 #include "content/public/test/web_contents_tester.h" | 21 #include "content/public/test/web_contents_tester.h" |
| 19 | 22 |
| 20 using content::InterstitialPage; | 23 using content::InterstitialPage; |
| 21 using content::WebContents; | 24 using content::WebContents; |
| 22 using content::WebContentsTester; | 25 using content::WebContentsTester; |
| 23 | 26 |
| 24 namespace { | 27 namespace { |
| 25 | 28 |
| 26 const char kURL1[] = "http://www.google.com/"; | 29 const char kURL1[] = "http://www.google.com/"; |
| 27 const char kURL2[] = "http://mail.google.com/"; | 30 const char kURL2[] = "http://mail.google.com/"; |
| 28 | 31 |
| 29 const int64 kSessionMergeTimeout = 60; | 32 const int64_t kSessionMergeTimeout = 60; |
| 30 | 33 |
| 31 } // namespace | 34 } // namespace |
| 32 | 35 |
| 33 namespace chromeos { | 36 namespace chromeos { |
| 34 | 37 |
| 35 // An MergeSessionLoadPage class that does not create windows. | 38 // An MergeSessionLoadPage class that does not create windows. |
| 36 class TestMergeSessionLoadPage : public MergeSessionLoadPage { | 39 class TestMergeSessionLoadPage : public MergeSessionLoadPage { |
| 37 public: | 40 public: |
| 38 TestMergeSessionLoadPage(WebContents* web_contents, const GURL& url) | 41 TestMergeSessionLoadPage(WebContents* web_contents, const GURL& url) |
| 39 : MergeSessionLoadPage( | 42 : MergeSessionLoadPage( |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 | 177 |
| 175 // The URL remains to be URL2. | 178 // The URL remains to be URL2. |
| 176 EXPECT_EQ(kURL2, web_contents()->GetVisibleURL().spec()); | 179 EXPECT_EQ(kURL2, web_contents()->GetVisibleURL().spec()); |
| 177 | 180 |
| 178 // Commit navigation and the interstitial page is gone. | 181 // Commit navigation and the interstitial page is gone. |
| 179 Navigate(kURL2, 2, pending_id, true); | 182 Navigate(kURL2, 2, pending_id, true); |
| 180 EXPECT_FALSE(GetMergeSessionLoadPage()); | 183 EXPECT_FALSE(GetMergeSessionLoadPage()); |
| 181 } | 184 } |
| 182 | 185 |
| 183 } // namespace chromeos | 186 } // namespace chromeos |
| OLD | NEW |