| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/extensions/extension_browsertest.h" | 9 #include "chrome/browser/extensions/extension_browsertest.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| 11 #include "chrome/browser/first_run/first_run.h" | 11 #include "chrome/browser/first_run/first_run.h" |
| 12 #include "chrome/browser/infobars/infobar_tab_helper.h" | 12 #include "chrome/browser/infobars/infobar_tab_helper.h" |
| 13 #include "chrome/browser/prefs/pref_service.h" | 13 #include "chrome/browser/prefs/pref_service.h" |
| 14 #include "chrome/browser/prefs/session_startup_pref.h" | 14 #include "chrome/browser/prefs/session_startup_pref.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/browser/profiles/profile_impl.h" | 16 #include "chrome/browser/profiles/profile_impl.h" |
| 17 #include "chrome/browser/profiles/profile_manager.h" | 17 #include "chrome/browser/profiles/profile_manager.h" |
| 18 #include "chrome/browser/sessions/session_restore.h" | 18 #include "chrome/browser/sessions/session_restore.h" |
| 19 #include "chrome/browser/ui/browser.h" | 19 #include "chrome/browser/ui/browser.h" |
| 20 #include "chrome/browser/ui/browser_finder.h" | 20 #include "chrome/browser/ui/browser_finder.h" |
| 21 #include "chrome/browser/ui/browser_list.h" | 21 #include "chrome/browser/ui/browser_list.h" |
| 22 #include "chrome/browser/ui/browser_window.h" | 22 #include "chrome/browser/ui/browser_window.h" |
| 23 #include "chrome/browser/ui/startup/startup_browser_creator.h" | 23 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
| 24 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h" | 24 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h" |
| 25 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 25 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 26 #include "chrome/common/chrome_switches.h" | 26 #include "chrome/common/chrome_switches.h" |
| 27 #include "chrome/common/pref_names.h" | 27 #include "chrome/common/pref_names.h" |
| 28 #include "chrome/common/url_constants.h" | 28 #include "chrome/common/url_constants.h" |
| 29 #include "chrome/test/base/in_process_browser_test.h" | 29 #include "chrome/test/base/in_process_browser_test.h" |
| 30 #include "chrome/test/base/ui_test_utils.h" | 30 #include "chrome/test/base/ui_test_utils.h" |
| 31 #include "content/public/browser/web_contents.h" | 31 #include "content/public/browser/web_contents.h" |
| 32 #include "testing/gtest/include/gtest/gtest.h" | 32 #include "testing/gtest/include/gtest/gtest.h" |
| 33 | 33 |
| 34 using extensions::Extension; | 34 using extensions::Extension; |
| 35 | 35 |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 EXPECT_FALSE(SessionRestore::IsRestoring(profile_urls)); | 660 EXPECT_FALSE(SessionRestore::IsRestoring(profile_urls)); |
| 661 | 661 |
| 662 // The profile which normally opens the home page displays the new tab page. | 662 // The profile which normally opens the home page displays the new tab page. |
| 663 Browser* new_browser = NULL; | 663 Browser* new_browser = NULL; |
| 664 ASSERT_EQ(1u, browser::GetBrowserCount(profile_home)); | 664 ASSERT_EQ(1u, browser::GetBrowserCount(profile_home)); |
| 665 new_browser = FindOneOtherBrowserForProfile(profile_home, NULL); | 665 new_browser = FindOneOtherBrowserForProfile(profile_home, NULL); |
| 666 ASSERT_TRUE(new_browser); | 666 ASSERT_TRUE(new_browser); |
| 667 ASSERT_EQ(1, new_browser->tab_count()); | 667 ASSERT_EQ(1, new_browser->tab_count()); |
| 668 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), | 668 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), |
| 669 new_browser->GetWebContentsAt(0)->GetURL()); | 669 new_browser->GetWebContentsAt(0)->GetURL()); |
| 670 EXPECT_EQ(1U, new_browser->GetTabContentsWrapperAt(0)->infobar_tab_helper()-> | 670 EXPECT_EQ(1U, new_browser->GetTabContentsAt(0)->infobar_tab_helper()-> |
| 671 infobar_count()); | 671 infobar_count()); |
| 672 | 672 |
| 673 // The profile which normally opens last open pages displays the new tab page. | 673 // The profile which normally opens last open pages displays the new tab page. |
| 674 ASSERT_EQ(1u, browser::GetBrowserCount(profile_last)); | 674 ASSERT_EQ(1u, browser::GetBrowserCount(profile_last)); |
| 675 new_browser = FindOneOtherBrowserForProfile(profile_last, NULL); | 675 new_browser = FindOneOtherBrowserForProfile(profile_last, NULL); |
| 676 ASSERT_TRUE(new_browser); | 676 ASSERT_TRUE(new_browser); |
| 677 ASSERT_EQ(1, new_browser->tab_count()); | 677 ASSERT_EQ(1, new_browser->tab_count()); |
| 678 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), | 678 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), |
| 679 new_browser->GetWebContentsAt(0)->GetURL()); | 679 new_browser->GetWebContentsAt(0)->GetURL()); |
| 680 EXPECT_EQ(1U, new_browser->GetTabContentsWrapperAt(0)->infobar_tab_helper()-> | 680 EXPECT_EQ(1U, new_browser->GetTabContentsAt(0)->infobar_tab_helper()-> |
| 681 infobar_count()); | 681 infobar_count()); |
| 682 | 682 |
| 683 // The profile which normally opens URLs displays the new tab page. | 683 // The profile which normally opens URLs displays the new tab page. |
| 684 ASSERT_EQ(1u, browser::GetBrowserCount(profile_urls)); | 684 ASSERT_EQ(1u, browser::GetBrowserCount(profile_urls)); |
| 685 new_browser = FindOneOtherBrowserForProfile(profile_urls, NULL); | 685 new_browser = FindOneOtherBrowserForProfile(profile_urls, NULL); |
| 686 ASSERT_TRUE(new_browser); | 686 ASSERT_TRUE(new_browser); |
| 687 ASSERT_EQ(1, new_browser->tab_count()); | 687 ASSERT_EQ(1, new_browser->tab_count()); |
| 688 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), | 688 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), |
| 689 new_browser->GetWebContentsAt(0)->GetURL()); | 689 new_browser->GetWebContentsAt(0)->GetURL()); |
| 690 EXPECT_EQ(1U, new_browser->GetTabContentsWrapperAt(0)->infobar_tab_helper()-> | 690 EXPECT_EQ(1U, new_browser->GetTabContentsAt(0)->infobar_tab_helper()-> |
| 691 infobar_count()); | 691 infobar_count()); |
| 692 } | 692 } |
| 693 #endif // !OS_CHROMEOS | 693 #endif // !OS_CHROMEOS |
| OLD | NEW |