| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/i18n/rtl.h" | 8 #include "base/i18n/rtl.h" |
| 9 #include "base/sys_info.h" | 9 #include "base/sys_info.h" |
| 10 #include "chrome/app/chrome_dll_resource.h" | 10 #include "chrome/app/chrome_dll_resource.h" |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); | 495 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); |
| 496 model->SetTabPinned(2, true); | 496 model->SetTabPinned(2, true); |
| 497 | 497 |
| 498 // Write out the pinned tabs. | 498 // Write out the pinned tabs. |
| 499 PinnedTabCodec::WritePinnedTabs(browser()->profile()); | 499 PinnedTabCodec::WritePinnedTabs(browser()->profile()); |
| 500 | 500 |
| 501 // Simulate launching again. | 501 // Simulate launching again. |
| 502 CommandLine dummy(CommandLine::ARGUMENTS_ONLY); | 502 CommandLine dummy(CommandLine::ARGUMENTS_ONLY); |
| 503 BrowserInit::LaunchWithProfile launch(std::wstring(), dummy); | 503 BrowserInit::LaunchWithProfile launch(std::wstring(), dummy); |
| 504 launch.profile_ = browser()->profile(); | 504 launch.profile_ = browser()->profile(); |
| 505 launch.OpenStartupURLs(std::vector<GURL>()); | 505 launch.ProcessStartupURLs(std::vector<GURL>()); |
| 506 | 506 |
| 507 // The launch should have created a new browser. | 507 // The launch should have created a new browser. |
| 508 ASSERT_EQ(2u, BrowserList::GetBrowserCount(browser()->profile())); | 508 ASSERT_EQ(2u, BrowserList::GetBrowserCount(browser()->profile())); |
| 509 | 509 |
| 510 // Find the new browser. | 510 // Find the new browser. |
| 511 Browser* new_browser = NULL; | 511 Browser* new_browser = NULL; |
| 512 for (BrowserList::const_iterator i = BrowserList::begin(); | 512 for (BrowserList::const_iterator i = BrowserList::begin(); |
| 513 i != BrowserList::end() && !new_browser; ++i) { | 513 i != BrowserList::end() && !new_browser; ++i) { |
| 514 if (*i != browser()) | 514 if (*i != browser()) |
| 515 new_browser = *i; | 515 new_browser = *i; |
| 516 } | 516 } |
| 517 ASSERT_TRUE(new_browser); | 517 ASSERT_TRUE(new_browser); |
| 518 ASSERT_TRUE(new_browser != browser()); | 518 ASSERT_TRUE(new_browser != browser()); |
| 519 | 519 |
| 520 // We should get back an additional tab for the app. | 520 // We should get back an additional tab for the app. |
| 521 ASSERT_EQ(2, new_browser->tab_count()); | 521 ASSERT_EQ(2, new_browser->tab_count()); |
| 522 | 522 |
| 523 // Make sure the state matches. | 523 // Make sure the state matches. |
| 524 TabStripModel* new_model = new_browser->tabstrip_model(); | 524 TabStripModel* new_model = new_browser->tabstrip_model(); |
| 525 EXPECT_TRUE(new_model->IsAppTab(0)); | 525 EXPECT_TRUE(new_model->IsAppTab(0)); |
| 526 EXPECT_FALSE(new_model->IsAppTab(1)); | 526 EXPECT_FALSE(new_model->IsAppTab(1)); |
| 527 | 527 |
| 528 EXPECT_TRUE(new_model->IsTabPinned(0)); | 528 EXPECT_TRUE(new_model->IsTabPinned(0)); |
| 529 EXPECT_TRUE(new_model->IsTabPinned(1)); | 529 EXPECT_TRUE(new_model->IsTabPinned(1)); |
| 530 | 530 |
| 531 EXPECT_TRUE(new_model->GetTabContentsAt(0)->app_extension() == | 531 EXPECT_TRUE(new_model->GetTabContentsAt(0)->app_extension() == |
| 532 app_extension); | 532 app_extension); |
| 533 } | 533 } |
| 534 #endif | 534 #endif |
| OLD | NEW |