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