| 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 g_browser_process->profile_manager()->user_data_dir(); | 128 g_browser_process->profile_manager()->user_data_dir(); |
| 129 base::FilePath startup_profile_dir = | 129 base::FilePath startup_profile_dir = |
| 130 g_browser_process->profile_manager()->GetLastUsedProfileDir( | 130 g_browser_process->profile_manager()->GetLastUsedProfileDir( |
| 131 user_data_dir); | 131 user_data_dir); |
| 132 | 132 |
| 133 browser_creator.ProcessCommandLineAlreadyRunning(cmdline, current_dir, | 133 browser_creator.ProcessCommandLineAlreadyRunning(cmdline, current_dir, |
| 134 startup_profile_dir); | 134 startup_profile_dir); |
| 135 } | 135 } |
| 136 #endif // defined(OS_WIN) | 136 #endif // defined(OS_WIN) |
| 137 | 137 |
| 138 GURL GetSigninPromoURL() { |
| 139 return signin::GetPromoURL( |
| 140 signin_metrics::AccessPoint::ACCESS_POINT_START_PAGE, |
| 141 signin_metrics::Reason::REASON_SIGNIN_PRIMARY_ACCOUNT, false); |
| 142 } |
| 143 |
| 138 } // namespace | 144 } // namespace |
| 139 | 145 |
| 140 class StartupBrowserCreatorTest : public ExtensionBrowserTest { | 146 class StartupBrowserCreatorTest : public ExtensionBrowserTest { |
| 141 protected: | 147 protected: |
| 142 StartupBrowserCreatorTest() {} | 148 StartupBrowserCreatorTest() {} |
| 143 | 149 |
| 144 bool SetUpUserDataDirectory() override { | 150 bool SetUpUserDataDirectory() override { |
| 145 return ExtensionBrowserTest::SetUpUserDataDirectory(); | 151 return ExtensionBrowserTest::SetUpUserDataDirectory(); |
| 146 } | 152 } |
| 147 | 153 |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 | 613 |
| 608 // This should have created a new browser window. | 614 // This should have created a new browser window. |
| 609 Browser* new_browser = FindOneOtherBrowser(browser()); | 615 Browser* new_browser = FindOneOtherBrowser(browser()); |
| 610 ASSERT_TRUE(new_browser); | 616 ASSERT_TRUE(new_browser); |
| 611 | 617 |
| 612 TabStripModel* tab_strip = new_browser->tab_strip_model(); | 618 TabStripModel* tab_strip = new_browser->tab_strip_model(); |
| 613 | 619 |
| 614 if (signin::ShouldShowPromoAtStartup(browser()->profile(), true)) { | 620 if (signin::ShouldShowPromoAtStartup(browser()->profile(), true)) { |
| 615 // The browser should show only the promo. | 621 // The browser should show only the promo. |
| 616 ASSERT_EQ(1, tab_strip->count()); | 622 ASSERT_EQ(1, tab_strip->count()); |
| 617 EXPECT_EQ(signin::GetPromoURL(signin_metrics::SOURCE_START_PAGE, false), | 623 EXPECT_EQ(GetSigninPromoURL(), tab_strip->GetWebContentsAt(0)->GetURL()); |
| 618 tab_strip->GetWebContentsAt(0)->GetURL()); | |
| 619 } else if (IsWindows10OrNewer()) { | 624 } else if (IsWindows10OrNewer()) { |
| 620 // The browser should show the welcome page and the NTP. | 625 // The browser should show the welcome page and the NTP. |
| 621 ASSERT_EQ(2, tab_strip->count()); | 626 ASSERT_EQ(2, tab_strip->count()); |
| 622 EXPECT_EQ(GURL(internals::GetWelcomePageURL()), | 627 EXPECT_EQ(GURL(internals::GetWelcomePageURL()), |
| 623 tab_strip->GetWebContentsAt(0)->GetURL()); | 628 tab_strip->GetWebContentsAt(0)->GetURL()); |
| 624 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), | 629 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), |
| 625 tab_strip->GetWebContentsAt(1)->GetURL()); | 630 tab_strip->GetWebContentsAt(1)->GetURL()); |
| 626 } else { | 631 } else { |
| 627 // The browser should show only the NTP. | 632 // The browser should show only the NTP. |
| 628 ASSERT_EQ(1, tab_strip->count()); | 633 ASSERT_EQ(1, tab_strip->count()); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 648 TabStripModel* tab_strip = new_browser->tab_strip_model(); | 653 TabStripModel* tab_strip = new_browser->tab_strip_model(); |
| 649 EXPECT_EQ(2, tab_strip->count()); | 654 EXPECT_EQ(2, tab_strip->count()); |
| 650 | 655 |
| 651 if (IsWindows10OrNewer()) { | 656 if (IsWindows10OrNewer()) { |
| 652 EXPECT_EQ(internals::GetWelcomePageURL(), | 657 EXPECT_EQ(internals::GetWelcomePageURL(), |
| 653 tab_strip->GetWebContentsAt(0)->GetURL()); | 658 tab_strip->GetWebContentsAt(0)->GetURL()); |
| 654 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), | 659 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), |
| 655 tab_strip->GetWebContentsAt(1)->GetURL()); | 660 tab_strip->GetWebContentsAt(1)->GetURL()); |
| 656 } else { | 661 } else { |
| 657 if (signin::ShouldShowPromoAtStartup(browser()->profile(), true)) { | 662 if (signin::ShouldShowPromoAtStartup(browser()->profile(), true)) { |
| 658 EXPECT_EQ(signin::GetPromoURL(signin_metrics::SOURCE_START_PAGE, false), | 663 EXPECT_EQ(GetSigninPromoURL(), tab_strip->GetWebContentsAt(0)->GetURL()); |
| 659 tab_strip->GetWebContentsAt(0)->GetURL()); | |
| 660 } else { | 664 } else { |
| 661 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), | 665 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), |
| 662 tab_strip->GetWebContentsAt(0)->GetURL()); | 666 tab_strip->GetWebContentsAt(0)->GetURL()); |
| 663 } | 667 } |
| 664 EXPECT_EQ(internals::GetWelcomePageURL(), | 668 EXPECT_EQ(internals::GetWelcomePageURL(), |
| 665 tab_strip->GetWebContentsAt(1)->GetURL()); | 669 tab_strip->GetWebContentsAt(1)->GetURL()); |
| 666 } | 670 } |
| 667 } | 671 } |
| 668 | 672 |
| 669 IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, SyncPromoWithFirstRunTabs) { | 673 IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, SyncPromoWithFirstRunTabs) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 684 ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false, | 688 ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false, |
| 685 browser()->host_desktop_type())); | 689 browser()->host_desktop_type())); |
| 686 | 690 |
| 687 // This should have created a new browser window. | 691 // This should have created a new browser window. |
| 688 Browser* new_browser = FindOneOtherBrowser(browser()); | 692 Browser* new_browser = FindOneOtherBrowser(browser()); |
| 689 ASSERT_TRUE(new_browser); | 693 ASSERT_TRUE(new_browser); |
| 690 | 694 |
| 691 TabStripModel* tab_strip = new_browser->tab_strip_model(); | 695 TabStripModel* tab_strip = new_browser->tab_strip_model(); |
| 692 if (signin::ShouldShowPromoAtStartup(browser()->profile(), true)) { | 696 if (signin::ShouldShowPromoAtStartup(browser()->profile(), true)) { |
| 693 EXPECT_EQ(2, tab_strip->count()); | 697 EXPECT_EQ(2, tab_strip->count()); |
| 694 EXPECT_EQ(signin::GetPromoURL(signin_metrics::SOURCE_START_PAGE, false), | 698 EXPECT_EQ(GetSigninPromoURL(), tab_strip->GetWebContentsAt(0)->GetURL()); |
| 695 tab_strip->GetWebContentsAt(0)->GetURL()); | |
| 696 EXPECT_EQ("title1.html", | 699 EXPECT_EQ("title1.html", |
| 697 tab_strip->GetWebContentsAt(1)->GetURL().ExtractFileName()); | 700 tab_strip->GetWebContentsAt(1)->GetURL().ExtractFileName()); |
| 698 } else { | 701 } else { |
| 699 EXPECT_EQ(1, tab_strip->count()); | 702 EXPECT_EQ(1, tab_strip->count()); |
| 700 EXPECT_EQ("title1.html", | 703 EXPECT_EQ("title1.html", |
| 701 tab_strip->GetWebContentsAt(0)->GetURL().ExtractFileName()); | 704 tab_strip->GetWebContentsAt(0)->GetURL().ExtractFileName()); |
| 702 } | 705 } |
| 703 } | 706 } |
| 704 | 707 |
| 705 // The welcome page should still be shown if there are more than 2 first run | 708 // The welcome page should still be shown if there are more than 2 first run |
| (...skipping 13 matching lines...) Expand all Loading... |
| 719 ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false, | 722 ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false, |
| 720 browser()->host_desktop_type())); | 723 browser()->host_desktop_type())); |
| 721 | 724 |
| 722 // This should have created a new browser window. | 725 // This should have created a new browser window. |
| 723 Browser* new_browser = FindOneOtherBrowser(browser()); | 726 Browser* new_browser = FindOneOtherBrowser(browser()); |
| 724 ASSERT_TRUE(new_browser); | 727 ASSERT_TRUE(new_browser); |
| 725 | 728 |
| 726 TabStripModel* tab_strip = new_browser->tab_strip_model(); | 729 TabStripModel* tab_strip = new_browser->tab_strip_model(); |
| 727 if (signin::ShouldShowPromoAtStartup(browser()->profile(), true)) { | 730 if (signin::ShouldShowPromoAtStartup(browser()->profile(), true)) { |
| 728 EXPECT_EQ(3, tab_strip->count()); | 731 EXPECT_EQ(3, tab_strip->count()); |
| 729 EXPECT_EQ(signin::GetPromoURL(signin_metrics::SOURCE_START_PAGE, false), | 732 EXPECT_EQ(GetSigninPromoURL(), tab_strip->GetWebContentsAt(0)->GetURL()); |
| 730 tab_strip->GetWebContentsAt(0)->GetURL()); | |
| 731 EXPECT_EQ("title1.html", | 733 EXPECT_EQ("title1.html", |
| 732 tab_strip->GetWebContentsAt(1)->GetURL().ExtractFileName()); | 734 tab_strip->GetWebContentsAt(1)->GetURL().ExtractFileName()); |
| 733 EXPECT_EQ(internals::GetWelcomePageURL(), | 735 EXPECT_EQ(internals::GetWelcomePageURL(), |
| 734 tab_strip->GetWebContentsAt(2)->GetURL()); | 736 tab_strip->GetWebContentsAt(2)->GetURL()); |
| 735 } else { | 737 } else { |
| 736 EXPECT_EQ(2, tab_strip->count()); | 738 EXPECT_EQ(2, tab_strip->count()); |
| 737 EXPECT_EQ("title1.html", | 739 EXPECT_EQ("title1.html", |
| 738 tab_strip->GetWebContentsAt(0)->GetURL().ExtractFileName()); | 740 tab_strip->GetWebContentsAt(0)->GetURL().ExtractFileName()); |
| 739 EXPECT_EQ(internals::GetWelcomePageURL(), | 741 EXPECT_EQ(internals::GetWelcomePageURL(), |
| 740 tab_strip->GetWebContentsAt(1)->GetURL()); | 742 tab_strip->GetWebContentsAt(1)->GetURL()); |
| (...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1400 ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), true, | 1402 ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), true, |
| 1401 browser()->host_desktop_type())); | 1403 browser()->host_desktop_type())); |
| 1402 | 1404 |
| 1403 // This should have created a new browser window. | 1405 // This should have created a new browser window. |
| 1404 Browser* new_browser = FindOneOtherBrowser(browser()); | 1406 Browser* new_browser = FindOneOtherBrowser(browser()); |
| 1405 ASSERT_TRUE(new_browser); | 1407 ASSERT_TRUE(new_browser); |
| 1406 | 1408 |
| 1407 // Verify that the sync promo and the welcome page are shown. | 1409 // Verify that the sync promo and the welcome page are shown. |
| 1408 TabStripModel* tab_strip = new_browser->tab_strip_model(); | 1410 TabStripModel* tab_strip = new_browser->tab_strip_model(); |
| 1409 ASSERT_EQ(2, tab_strip->count()); | 1411 ASSERT_EQ(2, tab_strip->count()); |
| 1410 EXPECT_EQ(signin::GetPromoURL(signin_metrics::SOURCE_START_PAGE, false), | 1412 EXPECT_EQ(GetSigninPromoURL(), tab_strip->GetWebContentsAt(0)->GetURL()); |
| 1411 tab_strip->GetWebContentsAt(0)->GetURL()); | |
| 1412 EXPECT_EQ(internals::GetWelcomePageURL(), | 1413 EXPECT_EQ(internals::GetWelcomePageURL(), |
| 1413 tab_strip->GetWebContentsAt(1)->GetURL()); | 1414 tab_strip->GetWebContentsAt(1)->GetURL()); |
| 1414 } | 1415 } |
| 1415 | 1416 |
| 1416 #if defined(GOOGLE_CHROME_BUILD) && defined(OS_MACOSX) | 1417 #if defined(GOOGLE_CHROME_BUILD) && defined(OS_MACOSX) |
| 1417 // http://crbug.com/314819 | 1418 // http://crbug.com/314819 |
| 1418 #define MAYBE_FirstRunTabsPromoAllowed DISABLED_FirstRunTabsPromoAllowed | 1419 #define MAYBE_FirstRunTabsPromoAllowed DISABLED_FirstRunTabsPromoAllowed |
| 1419 #else | 1420 #else |
| 1420 #define MAYBE_FirstRunTabsPromoAllowed FirstRunTabsPromoAllowed | 1421 #define MAYBE_FirstRunTabsPromoAllowed FirstRunTabsPromoAllowed |
| 1421 #endif | 1422 #endif |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1446 ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), true, | 1447 ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), true, |
| 1447 browser()->host_desktop_type())); | 1448 browser()->host_desktop_type())); |
| 1448 | 1449 |
| 1449 // This should have created a new browser window. | 1450 // This should have created a new browser window. |
| 1450 Browser* new_browser = FindOneOtherBrowser(browser()); | 1451 Browser* new_browser = FindOneOtherBrowser(browser()); |
| 1451 ASSERT_TRUE(new_browser); | 1452 ASSERT_TRUE(new_browser); |
| 1452 | 1453 |
| 1453 // Verify that the first-run tab is shown and the sync promo has been added. | 1454 // Verify that the first-run tab is shown and the sync promo has been added. |
| 1454 TabStripModel* tab_strip = new_browser->tab_strip_model(); | 1455 TabStripModel* tab_strip = new_browser->tab_strip_model(); |
| 1455 ASSERT_EQ(2, tab_strip->count()); | 1456 ASSERT_EQ(2, tab_strip->count()); |
| 1456 EXPECT_EQ(signin::GetPromoURL(signin_metrics::SOURCE_START_PAGE, false), | 1457 EXPECT_EQ(GetSigninPromoURL(), tab_strip->GetWebContentsAt(0)->GetURL()); |
| 1457 tab_strip->GetWebContentsAt(0)->GetURL()); | |
| 1458 EXPECT_EQ("title1.html", | 1458 EXPECT_EQ("title1.html", |
| 1459 tab_strip->GetWebContentsAt(1)->GetURL().ExtractFileName()); | 1459 tab_strip->GetWebContentsAt(1)->GetURL().ExtractFileName()); |
| 1460 } | 1460 } |
| 1461 | 1461 |
| 1462 #if defined(GOOGLE_CHROME_BUILD) && defined(OS_MACOSX) | 1462 #if defined(GOOGLE_CHROME_BUILD) && defined(OS_MACOSX) |
| 1463 // http://crbug.com/314819 | 1463 // http://crbug.com/314819 |
| 1464 #define MAYBE_FirstRunTabsContainSyncPromo \ | 1464 #define MAYBE_FirstRunTabsContainSyncPromo \ |
| 1465 DISABLED_FirstRunTabsContainSyncPromo | 1465 DISABLED_FirstRunTabsContainSyncPromo |
| 1466 #else | 1466 #else |
| 1467 #define MAYBE_FirstRunTabsContainSyncPromo FirstRunTabsContainSyncPromo | 1467 #define MAYBE_FirstRunTabsContainSyncPromo FirstRunTabsContainSyncPromo |
| 1468 #endif | 1468 #endif |
| 1469 IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorFirstRunTest, | 1469 IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorFirstRunTest, |
| 1470 MAYBE_FirstRunTabsContainSyncPromo) { | 1470 MAYBE_FirstRunTabsContainSyncPromo) { |
| 1471 if (!PlatformSupportsSyncPromo()) | 1471 if (!PlatformSupportsSyncPromo()) |
| 1472 return; | 1472 return; |
| 1473 // Simulate the following master_preferences: | 1473 // Simulate the following master_preferences: |
| 1474 // { | 1474 // { |
| 1475 // "first_run_tabs" : [ | 1475 // "first_run_tabs" : [ |
| 1476 // "/title1.html", | 1476 // "/title1.html", |
| 1477 // "chrome://signin/?source=0&next_page=chrome%3A%2F%2Fnewtab%2F" | 1477 // "chrome://signin/?source=0&next_page=chrome%3A%2F%2Fnewtab%2F" |
| 1478 // ], | 1478 // ], |
| 1479 // "sync_promo": { | 1479 // "sync_promo": { |
| 1480 // "show_on_first_run_allowed": true | 1480 // "show_on_first_run_allowed": true |
| 1481 // } | 1481 // } |
| 1482 // } | 1482 // } |
| 1483 ASSERT_TRUE(embedded_test_server()->Start()); | 1483 ASSERT_TRUE(embedded_test_server()->Start()); |
| 1484 StartupBrowserCreator browser_creator; | 1484 StartupBrowserCreator browser_creator; |
| 1485 browser_creator.AddFirstRunTab( | 1485 browser_creator.AddFirstRunTab( |
| 1486 embedded_test_server()->GetURL("/title1.html")); | 1486 embedded_test_server()->GetURL("/title1.html")); |
| 1487 browser_creator.AddFirstRunTab( | 1487 browser_creator.AddFirstRunTab(GetSigninPromoURL()); |
| 1488 signin::GetPromoURL(signin_metrics::SOURCE_START_PAGE, false)); | |
| 1489 browser()->profile()->GetPrefs()->SetBoolean( | 1488 browser()->profile()->GetPrefs()->SetBoolean( |
| 1490 prefs::kSignInPromoShowOnFirstRunAllowed, true); | 1489 prefs::kSignInPromoShowOnFirstRunAllowed, true); |
| 1491 | 1490 |
| 1492 // Do a process-startup browser launch. | 1491 // Do a process-startup browser launch. |
| 1493 base::CommandLine dummy(base::CommandLine::NO_PROGRAM); | 1492 base::CommandLine dummy(base::CommandLine::NO_PROGRAM); |
| 1494 StartupBrowserCreatorImpl launch(base::FilePath(), dummy, &browser_creator, | 1493 StartupBrowserCreatorImpl launch(base::FilePath(), dummy, &browser_creator, |
| 1495 chrome::startup::IS_FIRST_RUN); | 1494 chrome::startup::IS_FIRST_RUN); |
| 1496 ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), true, | 1495 ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), true, |
| 1497 browser()->host_desktop_type())); | 1496 browser()->host_desktop_type())); |
| 1498 | 1497 |
| 1499 // This should have created a new browser window. | 1498 // This should have created a new browser window. |
| 1500 Browser* new_browser = FindOneOtherBrowser(browser()); | 1499 Browser* new_browser = FindOneOtherBrowser(browser()); |
| 1501 ASSERT_TRUE(new_browser); | 1500 ASSERT_TRUE(new_browser); |
| 1502 | 1501 |
| 1503 // Verify that the first-run tabs are shown and no sync promo has been added | 1502 // Verify that the first-run tabs are shown and no sync promo has been added |
| 1504 // as the first-run tabs contain it already. | 1503 // as the first-run tabs contain it already. |
| 1505 TabStripModel* tab_strip = new_browser->tab_strip_model(); | 1504 TabStripModel* tab_strip = new_browser->tab_strip_model(); |
| 1506 ASSERT_EQ(2, tab_strip->count()); | 1505 ASSERT_EQ(2, tab_strip->count()); |
| 1507 EXPECT_EQ("title1.html", | 1506 EXPECT_EQ("title1.html", |
| 1508 tab_strip->GetWebContentsAt(0)->GetURL().ExtractFileName()); | 1507 tab_strip->GetWebContentsAt(0)->GetURL().ExtractFileName()); |
| 1509 EXPECT_EQ(signin::GetPromoURL(signin_metrics::SOURCE_START_PAGE, false), | 1508 EXPECT_EQ(GetSigninPromoURL(), tab_strip->GetWebContentsAt(1)->GetURL()); |
| 1510 tab_strip->GetWebContentsAt(1)->GetURL()); | |
| 1511 } | 1509 } |
| 1512 | 1510 |
| 1513 #if defined(GOOGLE_CHROME_BUILD) && defined(OS_MACOSX) | 1511 #if defined(GOOGLE_CHROME_BUILD) && defined(OS_MACOSX) |
| 1514 // http://crbug.com/314819 | 1512 // http://crbug.com/314819 |
| 1515 #define MAYBE_FirstRunTabsContainNTPSyncPromoAllowed \ | 1513 #define MAYBE_FirstRunTabsContainNTPSyncPromoAllowed \ |
| 1516 DISABLED_FirstRunTabsContainNTPSyncPromoAllowed | 1514 DISABLED_FirstRunTabsContainNTPSyncPromoAllowed |
| 1517 #else | 1515 #else |
| 1518 #define MAYBE_FirstRunTabsContainNTPSyncPromoAllowed \ | 1516 #define MAYBE_FirstRunTabsContainNTPSyncPromoAllowed \ |
| 1519 FirstRunTabsContainNTPSyncPromoAllowed | 1517 FirstRunTabsContainNTPSyncPromoAllowed |
| 1520 #endif | 1518 #endif |
| (...skipping 27 matching lines...) Expand all Loading... |
| 1548 browser()->host_desktop_type())); | 1546 browser()->host_desktop_type())); |
| 1549 | 1547 |
| 1550 // This should have created a new browser window. | 1548 // This should have created a new browser window. |
| 1551 Browser* new_browser = FindOneOtherBrowser(browser()); | 1549 Browser* new_browser = FindOneOtherBrowser(browser()); |
| 1552 ASSERT_TRUE(new_browser); | 1550 ASSERT_TRUE(new_browser); |
| 1553 | 1551 |
| 1554 // Verify that the first-run tabs are shown but the NTP that they contain has | 1552 // Verify that the first-run tabs are shown but the NTP that they contain has |
| 1555 // been replaced by the sync promo. | 1553 // been replaced by the sync promo. |
| 1556 TabStripModel* tab_strip = new_browser->tab_strip_model(); | 1554 TabStripModel* tab_strip = new_browser->tab_strip_model(); |
| 1557 ASSERT_EQ(2, tab_strip->count()); | 1555 ASSERT_EQ(2, tab_strip->count()); |
| 1558 EXPECT_EQ(signin::GetPromoURL(signin_metrics::SOURCE_START_PAGE, false), | 1556 EXPECT_EQ(GetSigninPromoURL(), tab_strip->GetWebContentsAt(0)->GetURL()); |
| 1559 tab_strip->GetWebContentsAt(0)->GetURL()); | |
| 1560 EXPECT_EQ("title1.html", | 1557 EXPECT_EQ("title1.html", |
| 1561 tab_strip->GetWebContentsAt(1)->GetURL().ExtractFileName()); | 1558 tab_strip->GetWebContentsAt(1)->GetURL().ExtractFileName()); |
| 1562 } | 1559 } |
| 1563 | 1560 |
| 1564 #if defined(GOOGLE_CHROME_BUILD) && defined(OS_MACOSX) | 1561 #if defined(GOOGLE_CHROME_BUILD) && defined(OS_MACOSX) |
| 1565 // http://crbug.com/314819 | 1562 // http://crbug.com/314819 |
| 1566 #define MAYBE_FirstRunTabsContainNTPSyncPromoForbidden \ | 1563 #define MAYBE_FirstRunTabsContainNTPSyncPromoForbidden \ |
| 1567 DISABLED_FirstRunTabsContainNTPSyncPromoForbidden | 1564 DISABLED_FirstRunTabsContainNTPSyncPromoForbidden |
| 1568 #else | 1565 #else |
| 1569 #define MAYBE_FirstRunTabsContainNTPSyncPromoForbidden \ | 1566 #define MAYBE_FirstRunTabsContainNTPSyncPromoForbidden \ |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1718 ASSERT_EQ(1, tab_strip->count()); | 1715 ASSERT_EQ(1, tab_strip->count()); |
| 1719 EXPECT_EQ("title1.html", | 1716 EXPECT_EQ("title1.html", |
| 1720 tab_strip->GetWebContentsAt(0)->GetURL().ExtractFileName()); | 1717 tab_strip->GetWebContentsAt(0)->GetURL().ExtractFileName()); |
| 1721 } | 1718 } |
| 1722 #endif // defined(ENABLE_CONFIGURATION_POLICY) | 1719 #endif // defined(ENABLE_CONFIGURATION_POLICY) |
| 1723 | 1720 |
| 1724 #endif // !defined(OS_LINUX) || !defined(GOOGLE_CHROME_BUILD) || | 1721 #endif // !defined(OS_LINUX) || !defined(GOOGLE_CHROME_BUILD) || |
| 1725 // defined(ENABLE_CONFIGURATION_POLICY) | 1722 // defined(ENABLE_CONFIGURATION_POLICY) |
| 1726 | 1723 |
| 1727 #endif // !defined(OS_CHROMEOS) | 1724 #endif // !defined(OS_CHROMEOS) |
| OLD | NEW |