| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/browser.h" | 5 #include "chrome/browser/browser.h" |
| 6 #include "chrome/browser/browser_init.h" | 6 #include "chrome/browser/browser_init.h" |
| 7 #include "chrome/browser/browser_list.h" | 7 #include "chrome/browser/browser_list.h" |
| 8 #include "chrome/browser/browser_window.h" | 8 #include "chrome/browser/browser_window.h" |
| 9 #include "chrome/test/in_process_browser_test.h" | 9 #include "chrome/test/in_process_browser_test.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 // platform UI toolkit messages, and those messages are not sent during unit | 39 // platform UI toolkit messages, and those messages are not sent during unit |
| 40 // testing sessions. | 40 // testing sessions. |
| 41 | 41 |
| 42 OpenURLsPopupObserver observer; | 42 OpenURLsPopupObserver observer; |
| 43 BrowserList::AddObserver(&observer); | 43 BrowserList::AddObserver(&observer); |
| 44 | 44 |
| 45 Browser* popup = Browser::CreateForPopup(browser()->profile()); | 45 Browser* popup = Browser::CreateForPopup(browser()->profile()); |
| 46 ASSERT_EQ(popup->type(), Browser::TYPE_POPUP); | 46 ASSERT_EQ(popup->type(), Browser::TYPE_POPUP); |
| 47 ASSERT_EQ(popup, observer.added_browser_); | 47 ASSERT_EQ(popup, observer.added_browser_); |
| 48 | 48 |
| 49 CommandLine dummy((std::wstring())); | 49 CommandLine dummy(CommandLine::ARGUMENTS_ONLY); |
| 50 BrowserInit::LaunchWithProfile launch(std::wstring(), dummy); | 50 BrowserInit::LaunchWithProfile launch(std::wstring(), dummy); |
| 51 // This should create a new window, but re-use the profile from |popup|. If | 51 // This should create a new window, but re-use the profile from |popup|. If |
| 52 // it used a NULL or invalid profile, it would crash. | 52 // it used a NULL or invalid profile, it would crash. |
| 53 launch.OpenURLsInBrowser(popup, false, urls); | 53 launch.OpenURLsInBrowser(popup, false, urls); |
| 54 ASSERT_NE(popup, observer.added_browser_); | 54 ASSERT_NE(popup, observer.added_browser_); |
| 55 BrowserList::RemoveObserver(&observer); | 55 BrowserList::RemoveObserver(&observer); |
| 56 } | 56 } |
| 57 | 57 |
| 58 } // namespace | 58 } // namespace |
| OLD | NEW |