| 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" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 urls.push_back(GURL("http://localhost")); | 116 urls.push_back(GURL("http://localhost")); |
| 117 | 117 |
| 118 // Note that in our testing we do not ever query the BrowserList for the "last | 118 // Note that in our testing we do not ever query the BrowserList for the "last |
| 119 // active" browser. That's because the browsers are set as "active" by | 119 // active" browser. That's because the browsers are set as "active" by |
| 120 // platform UI toolkit messages, and those messages are not sent during unit | 120 // platform UI toolkit messages, and those messages are not sent during unit |
| 121 // testing sessions. | 121 // testing sessions. |
| 122 | 122 |
| 123 OpenURLsPopupObserver observer; | 123 OpenURLsPopupObserver observer; |
| 124 BrowserList::AddObserver(&observer); | 124 BrowserList::AddObserver(&observer); |
| 125 | 125 |
| 126 Browser* popup = Browser::CreateForType(Browser::TYPE_POPUP, | 126 Browser* popup = Browser::CreateWithParams( |
| 127 browser()->profile()); | 127 Browser::CreateParams(Browser::TYPE_POPUP, browser()->profile())); |
| 128 ASSERT_TRUE(popup->is_type_popup()); | 128 ASSERT_TRUE(popup->is_type_popup()); |
| 129 ASSERT_EQ(popup, observer.added_browser_); | 129 ASSERT_EQ(popup, observer.added_browser_); |
| 130 | 130 |
| 131 CommandLine dummy(CommandLine::NO_PROGRAM); | 131 CommandLine dummy(CommandLine::NO_PROGRAM); |
| 132 BrowserInit::IsFirstRun first_run = first_run::IsChromeFirstRun() ? | 132 BrowserInit::IsFirstRun first_run = first_run::IsChromeFirstRun() ? |
| 133 BrowserInit::IS_FIRST_RUN : BrowserInit::IS_NOT_FIRST_RUN; | 133 BrowserInit::IS_FIRST_RUN : BrowserInit::IS_NOT_FIRST_RUN; |
| 134 BrowserInit::LaunchWithProfile launch(FilePath(), dummy, first_run); | 134 BrowserInit::LaunchWithProfile launch(FilePath(), dummy, first_run); |
| 135 // This should create a new window, but re-use the profile from |popup|. If | 135 // This should create a new window, but re-use the profile from |popup|. If |
| 136 // it used a NULL or invalid profile, it would crash. | 136 // it used a NULL or invalid profile, it would crash. |
| 137 launch.OpenURLsInBrowser(popup, false, urls); | 137 launch.OpenURLsInBrowser(popup, false, urls); |
| (...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 // the crash info bar). | 673 // the crash info bar). |
| 674 ASSERT_EQ(1u, BrowserList::GetBrowserCount(profile_urls)); | 674 ASSERT_EQ(1u, BrowserList::GetBrowserCount(profile_urls)); |
| 675 new_browser = FindOneOtherBrowserForProfile(profile_urls, NULL); | 675 new_browser = FindOneOtherBrowserForProfile(profile_urls, 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(urls[0], new_browser->GetWebContentsAt(0)->GetURL()); | 678 EXPECT_EQ(urls[0], new_browser->GetWebContentsAt(0)->GetURL()); |
| 679 EXPECT_EQ(1U, new_browser->GetTabContentsWrapperAt(0)->infobar_tab_helper()-> | 679 EXPECT_EQ(1U, new_browser->GetTabContentsWrapperAt(0)->infobar_tab_helper()-> |
| 680 infobar_count()); | 680 infobar_count()); |
| 681 } | 681 } |
| 682 #endif // !OS_CHROMEOS | 682 #endif // !OS_CHROMEOS |
| OLD | NEW |