Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Side by Side Diff: chrome/browser/ui/browser_navigator_browsertest.cc

Issue 13846007: Allow showing pending URL for new tab navigations, but only if safe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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.
187 IN_PROC_BROWSER_TEST_F(BrowserNavigatorTest, Disposition_CurrentTab) { 189 IN_PROC_BROWSER_TEST_F(BrowserNavigatorTest, Disposition_CurrentTab) {
188 ui_test_utils::NavigateToURL(browser(), GetGoogleURL()); 190 ui_test_utils::NavigateToURL(browser(), GetGoogleURL());
189 EXPECT_EQ(GetGoogleURL(), 191 EXPECT_EQ(GetGoogleURL(),
190 browser()->tab_strip_model()->GetActiveWebContents()->GetURL()); 192 browser()->tab_strip_model()->GetActiveWebContents()->GetURL());
191 // We should have one window with one tab. 193 // We should have one window with one tab.
192 EXPECT_EQ(1u, chrome::GetTotalBrowserCount()); 194 EXPECT_EQ(1u, chrome::GetTotalBrowserCount());
193 EXPECT_EQ(1, browser()->tab_strip_model()->count()); 195 EXPECT_EQ(1, browser()->tab_strip_model()->count());
194 } 196 }
195 197
196 // This test verifies that a singleton tab is refocused if one is already opened 198 // 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
1259 // Now navigate using the incognito profile and check that a new window 1261 // Now navigate using the incognito profile and check that a new window
1260 // is created. 1262 // is created.
1261 chrome::NavigateParams params_incognito( 1263 chrome::NavigateParams params_incognito(
1262 browser()->profile()->GetOffTheRecordProfile(), 1264 browser()->profile()->GetOffTheRecordProfile(),
1263 GetGoogleURL(), content::PAGE_TRANSITION_LINK); 1265 GetGoogleURL(), content::PAGE_TRANSITION_LINK);
1264 ui_test_utils::NavigateToURL(&params_incognito); 1266 ui_test_utils::NavigateToURL(&params_incognito);
1265 EXPECT_EQ(2u, chrome::GetTotalBrowserCount()); 1267 EXPECT_EQ(2u, chrome::GetTotalBrowserCount());
1266 } 1268 }
1267 1269
1268 } // namespace 1270 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698