OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
9 #include "chrome/browser/autocomplete/autocomplete_edit.h" | 9 #include "chrome/browser/autocomplete/autocomplete_edit.h" |
10 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 10 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
(...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1015 singleton_url, content::PAGE_TRANSITION_LINK); | 1015 singleton_url, content::PAGE_TRANSITION_LINK); |
1016 TabContents* tab_contents = wrapper->tab_contents(); | 1016 TabContents* tab_contents = wrapper->tab_contents(); |
1017 | 1017 |
1018 // We should have one browser with 2 tabs, the 2nd selected. | 1018 // We should have one browser with 2 tabs, the 2nd selected. |
1019 EXPECT_EQ(1u, BrowserList::size()); | 1019 EXPECT_EQ(1u, BrowserList::size()); |
1020 EXPECT_EQ(2, browser()->tab_count()); | 1020 EXPECT_EQ(2, browser()->tab_count()); |
1021 EXPECT_EQ(1, browser()->active_index()); | 1021 EXPECT_EQ(1, browser()->active_index()); |
1022 | 1022 |
1023 // Kill the singleton tab. | 1023 // Kill the singleton tab. |
1024 tab_contents->SetIsCrashed(base::TERMINATION_STATUS_PROCESS_CRASHED, -1); | 1024 tab_contents->SetIsCrashed(base::TERMINATION_STATUS_PROCESS_CRASHED, -1); |
1025 EXPECT_TRUE(tab_contents->is_crashed()); | 1025 EXPECT_TRUE(tab_contents->IsCrashed()); |
1026 | 1026 |
1027 browser::NavigateParams p(MakeNavigateParams()); | 1027 browser::NavigateParams p(MakeNavigateParams()); |
1028 p.disposition = SINGLETON_TAB; | 1028 p.disposition = SINGLETON_TAB; |
1029 p.url = singleton_url; | 1029 p.url = singleton_url; |
1030 p.window_action = browser::NavigateParams::SHOW_WINDOW; | 1030 p.window_action = browser::NavigateParams::SHOW_WINDOW; |
1031 p.path_behavior = browser::NavigateParams::IGNORE_AND_NAVIGATE; | 1031 p.path_behavior = browser::NavigateParams::IGNORE_AND_NAVIGATE; |
1032 ui_test_utils::NavigateToURL(&p); | 1032 ui_test_utils::NavigateToURL(&p); |
1033 | 1033 |
1034 // The tab should not be sad anymore. | 1034 // The tab should not be sad anymore. |
1035 EXPECT_FALSE(tab_contents->is_crashed()); | 1035 EXPECT_FALSE(tab_contents->IsCrashed()); |
1036 } | 1036 } |
1037 | 1037 |
1038 IN_PROC_BROWSER_TEST_F(BrowserNavigatorTest, | 1038 IN_PROC_BROWSER_TEST_F(BrowserNavigatorTest, |
1039 NavigateFromDefaultToOptionsInSameTab) { | 1039 NavigateFromDefaultToOptionsInSameTab) { |
1040 { | 1040 { |
1041 ui_test_utils::WindowedNotificationObserver observer( | 1041 ui_test_utils::WindowedNotificationObserver observer( |
1042 content::NOTIFICATION_LOAD_STOP, | 1042 content::NOTIFICATION_LOAD_STOP, |
1043 content::NotificationService::AllSources()); | 1043 content::NotificationService::AllSources()); |
1044 browser()->OpenOptionsDialog(); | 1044 browser()->OpenOptionsDialog(); |
1045 observer.Wait(); | 1045 observer.Wait(); |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1266 content::NotificationService::AllSources()); | 1266 content::NotificationService::AllSources()); |
1267 browser()->ShowDownloadsTab(); | 1267 browser()->ShowDownloadsTab(); |
1268 observer.Wait(); | 1268 observer.Wait(); |
1269 } | 1269 } |
1270 EXPECT_EQ(1, browser()->tab_count()); | 1270 EXPECT_EQ(1, browser()->tab_count()); |
1271 EXPECT_EQ(GURL(chrome::kChromeUIDownloadsURL), | 1271 EXPECT_EQ(GURL(chrome::kChromeUIDownloadsURL), |
1272 browser()->GetSelectedTabContents()->GetURL()); | 1272 browser()->GetSelectedTabContents()->GetURL()); |
1273 } | 1273 } |
1274 | 1274 |
1275 } // namespace | 1275 } // namespace |
OLD | NEW |