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_list.h" | 21 #include "chrome/browser/ui/browser_list.h" |
21 #include "chrome/browser/ui/browser_window.h" | 22 #include "chrome/browser/ui/browser_window.h" |
22 #include "chrome/browser/ui/startup/startup_browser_creator.h" | 23 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
23 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h" | 24 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h" |
24 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 25 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
25 #include "chrome/common/chrome_switches.h" | 26 #include "chrome/common/chrome_switches.h" |
26 #include "chrome/common/pref_names.h" | 27 #include "chrome/common/pref_names.h" |
27 #include "chrome/common/url_constants.h" | 28 #include "chrome/common/url_constants.h" |
28 #include "chrome/test/base/in_process_browser_test.h" | 29 #include "chrome/test/base/in_process_browser_test.h" |
29 #include "chrome/test/base/ui_test_utils.h" | 30 #include "chrome/test/base/ui_test_utils.h" |
(...skipping 22 matching lines...) Expand all Loading... |
52 void LoadApp(const std::string& app_name, | 53 void LoadApp(const std::string& app_name, |
53 const Extension** out_app_extension) { | 54 const Extension** out_app_extension) { |
54 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII(app_name.c_str()))); | 55 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII(app_name.c_str()))); |
55 | 56 |
56 ExtensionService* service = browser()->profile()->GetExtensionService(); | 57 ExtensionService* service = browser()->profile()->GetExtensionService(); |
57 *out_app_extension = service->GetExtensionById( | 58 *out_app_extension = service->GetExtensionById( |
58 last_loaded_extension_id_, false); | 59 last_loaded_extension_id_, false); |
59 ASSERT_TRUE(*out_app_extension); | 60 ASSERT_TRUE(*out_app_extension); |
60 | 61 |
61 // Code that opens a new browser assumes we start with exactly one. | 62 // Code that opens a new browser assumes we start with exactly one. |
62 ASSERT_EQ(1u, BrowserList::GetBrowserCount(browser()->profile())); | 63 ASSERT_EQ(1u, browser::GetBrowserCount(browser()->profile())); |
63 } | 64 } |
64 | 65 |
65 void SetAppLaunchPref(const std::string& app_id, | 66 void SetAppLaunchPref(const std::string& app_id, |
66 ExtensionPrefs::LaunchType launch_type) { | 67 ExtensionPrefs::LaunchType launch_type) { |
67 ExtensionService* service = browser()->profile()->GetExtensionService(); | 68 ExtensionService* service = browser()->profile()->GetExtensionService(); |
68 service->extension_prefs()->SetLaunchType(app_id, launch_type); | 69 service->extension_prefs()->SetLaunchType(app_id, launch_type); |
69 } | 70 } |
70 | 71 |
71 // Check that there are two browsers. Find the one that is not |browser()|. | 72 // Check that there are two browsers. Find the one that is not |browser()|. |
72 void FindOneOtherBrowser(Browser** out_other_browser) { | 73 void FindOneOtherBrowser(Browser** out_other_browser) { |
73 // There should only be one other browser. | 74 // There should only be one other browser. |
74 ASSERT_EQ(2u, BrowserList::GetBrowserCount(browser()->profile())); | 75 ASSERT_EQ(2u, browser::GetBrowserCount(browser()->profile())); |
75 | 76 |
76 // Find the new browser. | 77 // Find the new browser. |
77 Browser* other_browser = NULL; | 78 Browser* other_browser = NULL; |
78 for (BrowserList::const_iterator i = BrowserList::begin(); | 79 for (BrowserList::const_iterator i = BrowserList::begin(); |
79 i != BrowserList::end() && !other_browser; ++i) { | 80 i != BrowserList::end() && !other_browser; ++i) { |
80 if (*i != browser()) | 81 if (*i != browser()) |
81 other_browser = *i; | 82 other_browser = *i; |
82 } | 83 } |
83 ASSERT_TRUE(other_browser); | 84 ASSERT_TRUE(other_browser); |
84 ASSERT_TRUE(other_browser != browser()); | 85 ASSERT_TRUE(other_browser != browser()); |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 | 293 |
293 CommandLine command_line(CommandLine::NO_PROGRAM); | 294 CommandLine command_line(CommandLine::NO_PROGRAM); |
294 command_line.AppendSwitchASCII(switches::kAppId, extension_app->id()); | 295 command_line.AppendSwitchASCII(switches::kAppId, extension_app->id()); |
295 browser::startup::IsFirstRun first_run = first_run::IsChromeFirstRun() ? | 296 browser::startup::IsFirstRun first_run = first_run::IsChromeFirstRun() ? |
296 browser::startup::IS_FIRST_RUN : browser::startup::IS_NOT_FIRST_RUN; | 297 browser::startup::IS_FIRST_RUN : browser::startup::IS_NOT_FIRST_RUN; |
297 StartupBrowserCreatorImpl launch(FilePath(), command_line, first_run); | 298 StartupBrowserCreatorImpl launch(FilePath(), command_line, first_run); |
298 ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false)); | 299 ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false)); |
299 | 300 |
300 // When an app shortcut is open and the pref indicates a tab should | 301 // When an app shortcut is open and the pref indicates a tab should |
301 // open, the tab is open in a new browser window. Expect a new window. | 302 // open, the tab is open in a new browser window. Expect a new window. |
302 ASSERT_EQ(2u, BrowserList::GetBrowserCount(browser()->profile())); | 303 ASSERT_EQ(2u, browser::GetBrowserCount(browser()->profile())); |
303 | 304 |
304 Browser* new_browser = NULL; | 305 Browser* new_browser = NULL; |
305 ASSERT_NO_FATAL_FAILURE(FindOneOtherBrowser(&new_browser)); | 306 ASSERT_NO_FATAL_FAILURE(FindOneOtherBrowser(&new_browser)); |
306 | 307 |
307 // The tab should be in a tabbed window. | 308 // The tab should be in a tabbed window. |
308 EXPECT_TRUE(new_browser->is_type_tabbed()); | 309 EXPECT_TRUE(new_browser->is_type_tabbed()); |
309 | 310 |
310 // The browser's app_name should not include the app's ID: It is in a | 311 // The browser's app_name should not include the app's ID: It is in a |
311 // normal browser. | 312 // normal browser. |
312 EXPECT_EQ( | 313 EXPECT_EQ( |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 last_opened_profiles.push_back(default_profile); | 410 last_opened_profiles.push_back(default_profile); |
410 last_opened_profiles.push_back(other_profile); | 411 last_opened_profiles.push_back(other_profile); |
411 browser_creator.Start(dummy, profile_manager->user_data_dir(), | 412 browser_creator.Start(dummy, profile_manager->user_data_dir(), |
412 default_profile, last_opened_profiles, &return_code); | 413 default_profile, last_opened_profiles, &return_code); |
413 | 414 |
414 // urls1 were opened in a browser for default_profile, and urls2 were opened | 415 // urls1 were opened in a browser for default_profile, and urls2 were opened |
415 // in a browser for other_profile. | 416 // in a browser for other_profile. |
416 Browser* new_browser = NULL; | 417 Browser* new_browser = NULL; |
417 // |browser()| is still around at this point, even though we've closed its | 418 // |browser()| is still around at this point, even though we've closed its |
418 // window. Thus the browser count for default_profile is 2. | 419 // window. Thus the browser count for default_profile is 2. |
419 ASSERT_EQ(2u, BrowserList::GetBrowserCount(default_profile)); | 420 ASSERT_EQ(2u, browser::GetBrowserCount(default_profile)); |
420 new_browser = FindOneOtherBrowserForProfile(default_profile, browser()); | 421 new_browser = FindOneOtherBrowserForProfile(default_profile, browser()); |
421 ASSERT_TRUE(new_browser); | 422 ASSERT_TRUE(new_browser); |
422 ASSERT_EQ(1, new_browser->tab_count()); | 423 ASSERT_EQ(1, new_browser->tab_count()); |
423 EXPECT_EQ(urls1[0], new_browser->GetWebContentsAt(0)->GetURL()); | 424 EXPECT_EQ(urls1[0], new_browser->GetWebContentsAt(0)->GetURL()); |
424 | 425 |
425 ASSERT_EQ(1u, BrowserList::GetBrowserCount(other_profile)); | 426 ASSERT_EQ(1u, browser::GetBrowserCount(other_profile)); |
426 new_browser = FindOneOtherBrowserForProfile(other_profile, NULL); | 427 new_browser = FindOneOtherBrowserForProfile(other_profile, NULL); |
427 ASSERT_TRUE(new_browser); | 428 ASSERT_TRUE(new_browser); |
428 ASSERT_EQ(1, new_browser->tab_count()); | 429 ASSERT_EQ(1, new_browser->tab_count()); |
429 EXPECT_EQ(urls2[0], new_browser->GetWebContentsAt(0)->GetURL()); | 430 EXPECT_EQ(urls2[0], new_browser->GetWebContentsAt(0)->GetURL()); |
430 } | 431 } |
431 | 432 |
432 IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, UpdateWithTwoProfiles) { | 433 IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, UpdateWithTwoProfiles) { |
433 // Make StartupBrowserCreator::WasRestarted() return true. | 434 // Make StartupBrowserCreator::WasRestarted() return true. |
434 StartupBrowserCreator::was_restarted_read_ = false; | 435 StartupBrowserCreator::was_restarted_read_ = false; |
435 PrefService* pref_service = g_browser_process->local_state(); | 436 PrefService* pref_service = g_browser_process->local_state(); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 while (SessionRestore::IsRestoring(profile1) || | 480 while (SessionRestore::IsRestoring(profile1) || |
480 SessionRestore::IsRestoring(profile2)) | 481 SessionRestore::IsRestoring(profile2)) |
481 MessageLoop::current()->RunAllPending(); | 482 MessageLoop::current()->RunAllPending(); |
482 | 483 |
483 // The startup URLs are ignored, and instead the last open sessions are | 484 // The startup URLs are ignored, and instead the last open sessions are |
484 // restored. | 485 // restored. |
485 EXPECT_TRUE(profile1->restored_last_session()); | 486 EXPECT_TRUE(profile1->restored_last_session()); |
486 EXPECT_TRUE(profile2->restored_last_session()); | 487 EXPECT_TRUE(profile2->restored_last_session()); |
487 | 488 |
488 Browser* new_browser = NULL; | 489 Browser* new_browser = NULL; |
489 ASSERT_EQ(1u, BrowserList::GetBrowserCount(profile1)); | 490 ASSERT_EQ(1u, browser::GetBrowserCount(profile1)); |
490 new_browser = FindOneOtherBrowserForProfile(profile1, NULL); | 491 new_browser = FindOneOtherBrowserForProfile(profile1, NULL); |
491 ASSERT_TRUE(new_browser); | 492 ASSERT_TRUE(new_browser); |
492 ASSERT_EQ(1, new_browser->tab_count()); | 493 ASSERT_EQ(1, new_browser->tab_count()); |
493 EXPECT_EQ(GURL(chrome::kAboutBlankURL), | 494 EXPECT_EQ(GURL(chrome::kAboutBlankURL), |
494 new_browser->GetWebContentsAt(0)->GetURL()); | 495 new_browser->GetWebContentsAt(0)->GetURL()); |
495 | 496 |
496 ASSERT_EQ(1u, BrowserList::GetBrowserCount(profile2)); | 497 ASSERT_EQ(1u, browser::GetBrowserCount(profile2)); |
497 new_browser = FindOneOtherBrowserForProfile(profile2, NULL); | 498 new_browser = FindOneOtherBrowserForProfile(profile2, NULL); |
498 ASSERT_TRUE(new_browser); | 499 ASSERT_TRUE(new_browser); |
499 ASSERT_EQ(1, new_browser->tab_count()); | 500 ASSERT_EQ(1, new_browser->tab_count()); |
500 EXPECT_EQ(GURL(chrome::kAboutBlankURL), | 501 EXPECT_EQ(GURL(chrome::kAboutBlankURL), |
501 new_browser->GetWebContentsAt(0)->GetURL()); | 502 new_browser->GetWebContentsAt(0)->GetURL()); |
502 } | 503 } |
503 | 504 |
504 IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, | 505 IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, |
505 ProfilesWithoutPagesNotLaunched) { | 506 ProfilesWithoutPagesNotLaunched) { |
506 Profile* default_profile = browser()->profile(); | 507 Profile* default_profile = browser()->profile(); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 while (SessionRestore::IsRestoring(default_profile) || | 565 while (SessionRestore::IsRestoring(default_profile) || |
565 SessionRestore::IsRestoring(profile_home1) || | 566 SessionRestore::IsRestoring(profile_home1) || |
566 SessionRestore::IsRestoring(profile_home2) || | 567 SessionRestore::IsRestoring(profile_home2) || |
567 SessionRestore::IsRestoring(profile_last) || | 568 SessionRestore::IsRestoring(profile_last) || |
568 SessionRestore::IsRestoring(profile_urls)) | 569 SessionRestore::IsRestoring(profile_urls)) |
569 MessageLoop::current()->RunAllPending(); | 570 MessageLoop::current()->RunAllPending(); |
570 | 571 |
571 Browser* new_browser = NULL; | 572 Browser* new_browser = NULL; |
572 // The last open profile (the profile_home1 in this case) will always be | 573 // The last open profile (the profile_home1 in this case) will always be |
573 // launched, even if it will open just the home page. | 574 // launched, even if it will open just the home page. |
574 ASSERT_EQ(1u, BrowserList::GetBrowserCount(profile_home1)); | 575 ASSERT_EQ(1u, browser::GetBrowserCount(profile_home1)); |
575 new_browser = FindOneOtherBrowserForProfile(profile_home1, NULL); | 576 new_browser = FindOneOtherBrowserForProfile(profile_home1, NULL); |
576 ASSERT_TRUE(new_browser); | 577 ASSERT_TRUE(new_browser); |
577 ASSERT_EQ(1, new_browser->tab_count()); | 578 ASSERT_EQ(1, new_browser->tab_count()); |
578 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), | 579 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), |
579 new_browser->GetWebContentsAt(0)->GetURL()); | 580 new_browser->GetWebContentsAt(0)->GetURL()); |
580 | 581 |
581 // profile_urls opened the urls. | 582 // profile_urls opened the urls. |
582 ASSERT_EQ(1u, BrowserList::GetBrowserCount(profile_urls)); | 583 ASSERT_EQ(1u, browser::GetBrowserCount(profile_urls)); |
583 new_browser = FindOneOtherBrowserForProfile(profile_urls, NULL); | 584 new_browser = FindOneOtherBrowserForProfile(profile_urls, NULL); |
584 ASSERT_TRUE(new_browser); | 585 ASSERT_TRUE(new_browser); |
585 ASSERT_EQ(1, new_browser->tab_count()); | 586 ASSERT_EQ(1, new_browser->tab_count()); |
586 EXPECT_EQ(urls[0], new_browser->GetWebContentsAt(0)->GetURL()); | 587 EXPECT_EQ(urls[0], new_browser->GetWebContentsAt(0)->GetURL()); |
587 | 588 |
588 // profile_last opened the last open pages. | 589 // profile_last opened the last open pages. |
589 ASSERT_EQ(1u, BrowserList::GetBrowserCount(profile_last)); | 590 ASSERT_EQ(1u, browser::GetBrowserCount(profile_last)); |
590 new_browser = FindOneOtherBrowserForProfile(profile_last, NULL); | 591 new_browser = FindOneOtherBrowserForProfile(profile_last, NULL); |
591 ASSERT_TRUE(new_browser); | 592 ASSERT_TRUE(new_browser); |
592 ASSERT_EQ(1, new_browser->tab_count()); | 593 ASSERT_EQ(1, new_browser->tab_count()); |
593 EXPECT_EQ(GURL(chrome::kAboutBlankURL), | 594 EXPECT_EQ(GURL(chrome::kAboutBlankURL), |
594 new_browser->GetWebContentsAt(0)->GetURL()); | 595 new_browser->GetWebContentsAt(0)->GetURL()); |
595 | 596 |
596 // profile_home2 was not launched since it would've only opened the home page. | 597 // profile_home2 was not launched since it would've only opened the home page. |
597 ASSERT_EQ(0u, BrowserList::GetBrowserCount(profile_home2)); | 598 ASSERT_EQ(0u, browser::GetBrowserCount(profile_home2)); |
598 } | 599 } |
599 | 600 |
600 IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, ProfilesLaunchedAfterCrash) { | 601 IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, ProfilesLaunchedAfterCrash) { |
601 // After an unclean exit, all profiles will be launched. However, they won't | 602 // After an unclean exit, all profiles will be launched. However, they won't |
602 // open any pages automatically. | 603 // open any pages automatically. |
603 | 604 |
604 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 605 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
605 | 606 |
606 // Create 3 profiles. | 607 // Create 3 profiles. |
607 FilePath dest_path1 = profile_manager->user_data_dir().Append( | 608 FilePath dest_path1 = profile_manager->user_data_dir().Append( |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 last_opened_profiles, &return_code); | 652 last_opened_profiles, &return_code); |
652 | 653 |
653 // No profiles are getting restored, since they all display the crash info | 654 // No profiles are getting restored, since they all display the crash info |
654 // bar. | 655 // bar. |
655 EXPECT_FALSE(SessionRestore::IsRestoring(profile_home)); | 656 EXPECT_FALSE(SessionRestore::IsRestoring(profile_home)); |
656 EXPECT_FALSE(SessionRestore::IsRestoring(profile_last)); | 657 EXPECT_FALSE(SessionRestore::IsRestoring(profile_last)); |
657 EXPECT_FALSE(SessionRestore::IsRestoring(profile_urls)); | 658 EXPECT_FALSE(SessionRestore::IsRestoring(profile_urls)); |
658 | 659 |
659 // The profile which normally opens the home page displays the new tab page. | 660 // The profile which normally opens the home page displays the new tab page. |
660 Browser* new_browser = NULL; | 661 Browser* new_browser = NULL; |
661 ASSERT_EQ(1u, BrowserList::GetBrowserCount(profile_home)); | 662 ASSERT_EQ(1u, browser::GetBrowserCount(profile_home)); |
662 new_browser = FindOneOtherBrowserForProfile(profile_home, NULL); | 663 new_browser = FindOneOtherBrowserForProfile(profile_home, NULL); |
663 ASSERT_TRUE(new_browser); | 664 ASSERT_TRUE(new_browser); |
664 ASSERT_EQ(1, new_browser->tab_count()); | 665 ASSERT_EQ(1, new_browser->tab_count()); |
665 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), | 666 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), |
666 new_browser->GetWebContentsAt(0)->GetURL()); | 667 new_browser->GetWebContentsAt(0)->GetURL()); |
667 EXPECT_EQ(1U, new_browser->GetTabContentsWrapperAt(0)->infobar_tab_helper()-> | 668 EXPECT_EQ(1U, new_browser->GetTabContentsWrapperAt(0)->infobar_tab_helper()-> |
668 infobar_count()); | 669 infobar_count()); |
669 | 670 |
670 // The profile which normally opens last open pages displays the new tab page. | 671 // The profile which normally opens last open pages displays the new tab page. |
671 ASSERT_EQ(1u, BrowserList::GetBrowserCount(profile_last)); | 672 ASSERT_EQ(1u, browser::GetBrowserCount(profile_last)); |
672 new_browser = FindOneOtherBrowserForProfile(profile_last, NULL); | 673 new_browser = FindOneOtherBrowserForProfile(profile_last, NULL); |
673 ASSERT_TRUE(new_browser); | 674 ASSERT_TRUE(new_browser); |
674 ASSERT_EQ(1, new_browser->tab_count()); | 675 ASSERT_EQ(1, new_browser->tab_count()); |
675 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), | 676 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), |
676 new_browser->GetWebContentsAt(0)->GetURL()); | 677 new_browser->GetWebContentsAt(0)->GetURL()); |
677 EXPECT_EQ(1U, new_browser->GetTabContentsWrapperAt(0)->infobar_tab_helper()-> | 678 EXPECT_EQ(1U, new_browser->GetTabContentsWrapperAt(0)->infobar_tab_helper()-> |
678 infobar_count()); | 679 infobar_count()); |
679 | 680 |
680 // The profile which normally opens URLs displays the new tab page. | 681 // The profile which normally opens URLs displays the new tab page. |
681 ASSERT_EQ(1u, BrowserList::GetBrowserCount(profile_urls)); | 682 ASSERT_EQ(1u, browser::GetBrowserCount(profile_urls)); |
682 new_browser = FindOneOtherBrowserForProfile(profile_urls, NULL); | 683 new_browser = FindOneOtherBrowserForProfile(profile_urls, NULL); |
683 ASSERT_TRUE(new_browser); | 684 ASSERT_TRUE(new_browser); |
684 ASSERT_EQ(1, new_browser->tab_count()); | 685 ASSERT_EQ(1, new_browser->tab_count()); |
685 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), | 686 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), |
686 new_browser->GetWebContentsAt(0)->GetURL()); | 687 new_browser->GetWebContentsAt(0)->GetURL()); |
687 EXPECT_EQ(1U, new_browser->GetTabContentsWrapperAt(0)->infobar_tab_helper()-> | 688 EXPECT_EQ(1U, new_browser->GetTabContentsWrapperAt(0)->infobar_tab_helper()-> |
688 infobar_count()); | 689 infobar_count()); |
689 } | 690 } |
690 #endif // !OS_CHROMEOS | 691 #endif // !OS_CHROMEOS |
OLD | NEW |