| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 return *i; | 96 return *i; |
| 97 } | 97 } |
| 98 return NULL; | 98 return NULL; |
| 99 } | 99 } |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 class OpenURLsPopupObserver : public BrowserList::Observer { | 102 class OpenURLsPopupObserver : public BrowserList::Observer { |
| 103 public: | 103 public: |
| 104 OpenURLsPopupObserver() : added_browser_(NULL) { } | 104 OpenURLsPopupObserver() : added_browser_(NULL) { } |
| 105 | 105 |
| 106 virtual void OnBrowserAdded(const Browser* browser) { | 106 virtual void OnBrowserAdded(Browser* browser) { |
| 107 added_browser_ = browser; | 107 added_browser_ = browser; |
| 108 } | 108 } |
| 109 | 109 |
| 110 virtual void OnBrowserRemoved(const Browser* browser) { } | 110 virtual void OnBrowserRemoved(Browser* browser) { } |
| 111 | 111 |
| 112 const Browser* added_browser_; | 112 Browser* added_browser_; |
| 113 }; | 113 }; |
| 114 | 114 |
| 115 // Test that when there is a popup as the active browser any requests to | 115 // Test that when there is a popup as the active browser any requests to |
| 116 // StartupBrowserCreatorImpl::OpenURLsInBrowser don't crash because there's no | 116 // StartupBrowserCreatorImpl::OpenURLsInBrowser don't crash because there's no |
| 117 // explicit profile given. | 117 // explicit profile given. |
| 118 IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, OpenURLsPopup) { | 118 IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, OpenURLsPopup) { |
| 119 std::vector<GURL> urls; | 119 std::vector<GURL> urls; |
| 120 urls.push_back(GURL("http://localhost")); | 120 urls.push_back(GURL("http://localhost")); |
| 121 | 121 |
| 122 // Note that in our testing we do not ever query the BrowserList for the "last | 122 // Note that in our testing we do not ever query the BrowserList for the "last |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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->GetTabContentsWrapperAt(0)->infobar_tab_helper()-> |
| 691 infobar_count()); | 691 infobar_count()); |
| 692 } | 692 } |
| 693 #endif // !OS_CHROMEOS | 693 #endif // !OS_CHROMEOS |
| OLD | NEW |