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

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

Issue 23475011: Revert 220623 "Update chrome://newtab checks in browser tests to..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 3 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 "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/app/chrome_command_ids.h" 10 #include "chrome/app/chrome_command_ids.h"
11 #include "chrome/browser/prefs/incognito_mode_prefs.h" 11 #include "chrome/browser/prefs/incognito_mode_prefs.h"
12 #include "chrome/browser/profiles/profile.h" 12 #include "chrome/browser/profiles/profile.h"
13 #include "chrome/browser/search/search.h"
14 #include "chrome/browser/ui/browser.h" 13 #include "chrome/browser/ui/browser.h"
15 #include "chrome/browser/ui/browser_commands.h" 14 #include "chrome/browser/ui/browser_commands.h"
16 #include "chrome/browser/ui/browser_finder.h" 15 #include "chrome/browser/ui/browser_finder.h"
17 #include "chrome/browser/ui/browser_navigator.h" 16 #include "chrome/browser/ui/browser_navigator.h"
18 #include "chrome/browser/ui/browser_tabstrip.h" 17 #include "chrome/browser/ui/browser_tabstrip.h"
19 #include "chrome/browser/ui/browser_window.h" 18 #include "chrome/browser/ui/browser_window.h"
20 #include "chrome/browser/ui/chrome_pages.h" 19 #include "chrome/browser/ui/chrome_pages.h"
21 #include "chrome/browser/ui/singleton_tabs.h" 20 #include "chrome/browser/ui/singleton_tabs.h"
22 #include "chrome/browser/ui/tabs/tab_strip_model.h" 21 #include "chrome/browser/ui/tabs/tab_strip_model.h"
23 #include "chrome/common/chrome_switches.h" 22 #include "chrome/common/chrome_switches.h"
(...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after
1086 ShortenUberURL(browser()->tab_strip_model()-> 1085 ShortenUberURL(browser()->tab_strip_model()->
1087 GetActiveWebContents()->GetURL())); 1086 GetActiveWebContents()->GetURL()));
1088 } 1087 }
1089 1088
1090 IN_PROC_BROWSER_TEST_F(BrowserNavigatorTest, 1089 IN_PROC_BROWSER_TEST_F(BrowserNavigatorTest,
1091 NavigateFromNTPToOptionsInSameTab) { 1090 NavigateFromNTPToOptionsInSameTab) {
1092 chrome::NavigateParams p(MakeNavigateParams()); 1091 chrome::NavigateParams p(MakeNavigateParams());
1093 p.url = GURL(chrome::kChromeUINewTabURL); 1092 p.url = GURL(chrome::kChromeUINewTabURL);
1094 ui_test_utils::NavigateToURL(&p); 1093 ui_test_utils::NavigateToURL(&p);
1095 EXPECT_EQ(1, browser()->tab_strip_model()->count()); 1094 EXPECT_EQ(1, browser()->tab_strip_model()->count());
1096 EXPECT_TRUE(chrome::IsNTPURL( 1095 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL),
1097 browser()->tab_strip_model()->GetActiveWebContents()->GetURL(), 1096 browser()->tab_strip_model()->GetActiveWebContents()->GetURL());
1098 browser()->profile()));
1099 1097
1100 { 1098 {
1101 content::WindowedNotificationObserver observer( 1099 content::WindowedNotificationObserver observer(
1102 content::NOTIFICATION_LOAD_STOP, 1100 content::NOTIFICATION_LOAD_STOP,
1103 content::NotificationService::AllSources()); 1101 content::NotificationService::AllSources());
1104 chrome::ShowSettings(browser()); 1102 chrome::ShowSettings(browser());
1105 observer.Wait(); 1103 observer.Wait();
1106 } 1104 }
1107 EXPECT_EQ(1, browser()->tab_strip_model()->count()); 1105 EXPECT_EQ(1, browser()->tab_strip_model()->count());
1108 EXPECT_EQ(GetSettingsURL(), 1106 EXPECT_EQ(GetSettingsURL(),
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
1351 // Open a renderer initiated POST request in new foreground tab. 1349 // Open a renderer initiated POST request in new foreground tab.
1352 string16 expected_title(base::ASCIIToUTF16(kExpectedTitle)); 1350 string16 expected_title(base::ASCIIToUTF16(kExpectedTitle));
1353 std::string post_data = kExpectedTitle; 1351 std::string post_data = kExpectedTitle;
1354 string16 title; 1352 string16 title;
1355 ASSERT_TRUE(OpenPOSTURLInNewForegroundTabAndGetTitle( 1353 ASSERT_TRUE(OpenPOSTURLInNewForegroundTabAndGetTitle(
1356 test_server()->GetURL(kEchoTitleCommand), post_data, false, &title)); 1354 test_server()->GetURL(kEchoTitleCommand), post_data, false, &title));
1357 EXPECT_NE(expected_title, title); 1355 EXPECT_NE(expected_title, title);
1358 } 1356 }
1359 1357
1360 } // namespace 1358 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698