| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/browser_navigator_browsertest.h" | 5 #include "chrome/browser/ui/browser_navigator_browsertest.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 10 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 default: | 177 default: |
| 178 break; | 178 break; |
| 179 } | 179 } |
| 180 } | 180 } |
| 181 | 181 |
| 182 | 182 |
| 183 namespace { | 183 namespace { |
| 184 | 184 |
| 185 // This test verifies that when a navigation occurs within a tab, the tab count | 185 // This test verifies that when a navigation occurs within a tab, the tab count |
| 186 // of the Browser remains the same and the current tab bears the loaded URL. | 186 // of the Browser remains the same and the current tab bears the loaded URL. |
| 187 // Note that network URLs are not actually loaded in tests, so this also tests | |
| 188 // that error pages leave the intended URL in the address bar. | |
| 189 IN_PROC_BROWSER_TEST_F(BrowserNavigatorTest, Disposition_CurrentTab) { | 187 IN_PROC_BROWSER_TEST_F(BrowserNavigatorTest, Disposition_CurrentTab) { |
| 190 ui_test_utils::NavigateToURL(browser(), GetGoogleURL()); | 188 ui_test_utils::NavigateToURL(browser(), GetGoogleURL()); |
| 191 EXPECT_EQ(GetGoogleURL(), | 189 EXPECT_EQ(GetGoogleURL(), |
| 192 browser()->tab_strip_model()->GetActiveWebContents()->GetURL()); | 190 browser()->tab_strip_model()->GetActiveWebContents()->GetURL()); |
| 193 // We should have one window with one tab. | 191 // We should have one window with one tab. |
| 194 EXPECT_EQ(1u, chrome::GetTotalBrowserCount()); | 192 EXPECT_EQ(1u, chrome::GetTotalBrowserCount()); |
| 195 EXPECT_EQ(1, browser()->tab_strip_model()->count()); | 193 EXPECT_EQ(1, browser()->tab_strip_model()->count()); |
| 196 } | 194 } |
| 197 | 195 |
| 198 // This test verifies that a singleton tab is refocused if one is already opened | 196 // This test verifies that a singleton tab is refocused if one is already opened |
| (...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1261 // Now navigate using the incognito profile and check that a new window | 1259 // Now navigate using the incognito profile and check that a new window |
| 1262 // is created. | 1260 // is created. |
| 1263 chrome::NavigateParams params_incognito( | 1261 chrome::NavigateParams params_incognito( |
| 1264 browser()->profile()->GetOffTheRecordProfile(), | 1262 browser()->profile()->GetOffTheRecordProfile(), |
| 1265 GetGoogleURL(), content::PAGE_TRANSITION_LINK); | 1263 GetGoogleURL(), content::PAGE_TRANSITION_LINK); |
| 1266 ui_test_utils::NavigateToURL(¶ms_incognito); | 1264 ui_test_utils::NavigateToURL(¶ms_incognito); |
| 1267 EXPECT_EQ(2u, chrome::GetTotalBrowserCount()); | 1265 EXPECT_EQ(2u, chrome::GetTotalBrowserCount()); |
| 1268 } | 1266 } |
| 1269 | 1267 |
| 1270 } // namespace | 1268 } // namespace |
| OLD | NEW |