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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 default: | 178 default: |
179 break; | 179 break; |
180 } | 180 } |
181 } | 181 } |
182 | 182 |
183 | 183 |
184 namespace { | 184 namespace { |
185 | 185 |
186 // This test verifies that when a navigation occurs within a tab, the tab count | 186 // This test verifies that when a navigation occurs within a tab, the tab count |
187 // of the Browser remains the same and the current tab bears the loaded URL. | 187 // of the Browser remains the same and the current tab bears the loaded URL. |
| 188 // Note that network URLs are not actually loaded in tests, so this also tests |
| 189 // that error pages leave the intended URL in the address bar. |
188 IN_PROC_BROWSER_TEST_F(BrowserNavigatorTest, Disposition_CurrentTab) { | 190 IN_PROC_BROWSER_TEST_F(BrowserNavigatorTest, Disposition_CurrentTab) { |
189 ui_test_utils::NavigateToURL(browser(), GetGoogleURL()); | 191 ui_test_utils::NavigateToURL(browser(), GetGoogleURL()); |
190 EXPECT_EQ(GetGoogleURL(), | 192 EXPECT_EQ(GetGoogleURL(), |
191 browser()->tab_strip_model()->GetActiveWebContents()->GetURL()); | 193 browser()->tab_strip_model()->GetActiveWebContents()->GetURL()); |
192 // We should have one window with one tab. | 194 // We should have one window with one tab. |
193 EXPECT_EQ(1u, chrome::GetTotalBrowserCount()); | 195 EXPECT_EQ(1u, chrome::GetTotalBrowserCount()); |
194 EXPECT_EQ(1, browser()->tab_strip_model()->count()); | 196 EXPECT_EQ(1, browser()->tab_strip_model()->count()); |
195 } | 197 } |
196 | 198 |
197 // This test verifies that a singleton tab is refocused if one is already opened | 199 // This test verifies that a singleton tab is refocused if one is already opened |
(...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1299 ui_test_utils::NavigateToURL(&viewsource_params); | 1301 ui_test_utils::NavigateToURL(&viewsource_params); |
1300 | 1302 |
1301 chrome::NavigateParams singleton_params(browser(), | 1303 chrome::NavigateParams singleton_params(browser(), |
1302 GURL(chrome::kChromeUIVersionURL), | 1304 GURL(chrome::kChromeUIVersionURL), |
1303 content::PAGE_TRANSITION_LINK); | 1305 content::PAGE_TRANSITION_LINK); |
1304 singleton_params.disposition = SINGLETON_TAB; | 1306 singleton_params.disposition = SINGLETON_TAB; |
1305 EXPECT_EQ(-1, chrome::GetIndexOfSingletonTab(&singleton_params)); | 1307 EXPECT_EQ(-1, chrome::GetIndexOfSingletonTab(&singleton_params)); |
1306 } | 1308 } |
1307 | 1309 |
1308 } // namespace | 1310 } // namespace |
OLD | NEW |