| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 last_opened_profiles); | 70 last_opened_profiles); |
| 71 | 71 |
| 72 while (!browser_creator.ActivatedProfile()) | 72 while (!browser_creator.ActivatedProfile()) |
| 73 base::MessageLoop::current()->RunUntilIdle(); | 73 base::MessageLoop::current()->RunUntilIdle(); |
| 74 | 74 |
| 75 Browser* new_browser = NULL; | 75 Browser* new_browser = NULL; |
| 76 | 76 |
| 77 // The last used profile (the profile_2 in this case) must be active. | 77 // The last used profile (the profile_2 in this case) must be active. |
| 78 ASSERT_EQ(1u, chrome::GetBrowserCount(profile_2, | 78 ASSERT_EQ(1u, chrome::GetBrowserCount(profile_2, |
| 79 browser()->host_desktop_type())); | 79 browser()->host_desktop_type())); |
| 80 new_browser = FindBrowserWithProfile(profile_2, | 80 new_browser = |
| 81 browser()->host_desktop_type()); | 81 chrome::FindBrowserWithProfile(profile_2, browser()->host_desktop_type()); |
| 82 ASSERT_TRUE(new_browser); | 82 ASSERT_TRUE(new_browser); |
| 83 EXPECT_TRUE(new_browser->window()->IsActive()); | 83 EXPECT_TRUE(new_browser->window()->IsActive()); |
| 84 | 84 |
| 85 // All other profiles browser should not be active. | 85 // All other profiles browser should not be active. |
| 86 ASSERT_EQ(1u, chrome::GetBrowserCount(profile_1, | 86 ASSERT_EQ(1u, chrome::GetBrowserCount(profile_1, |
| 87 browser()->host_desktop_type())); | 87 browser()->host_desktop_type())); |
| 88 new_browser = FindBrowserWithProfile(profile_1, | 88 new_browser = |
| 89 browser()->host_desktop_type()); | 89 chrome::FindBrowserWithProfile(profile_1, browser()->host_desktop_type()); |
| 90 ASSERT_TRUE(new_browser); | 90 ASSERT_TRUE(new_browser); |
| 91 EXPECT_FALSE(new_browser->window()->IsActive()); | 91 EXPECT_FALSE(new_browser->window()->IsActive()); |
| 92 | 92 |
| 93 ASSERT_EQ(1u, chrome::GetBrowserCount(profile_3, | 93 ASSERT_EQ(1u, chrome::GetBrowserCount(profile_3, |
| 94 browser()->host_desktop_type())); | 94 browser()->host_desktop_type())); |
| 95 new_browser = FindBrowserWithProfile(profile_3, | 95 new_browser = |
| 96 browser()->host_desktop_type()); | 96 chrome::FindBrowserWithProfile(profile_3, browser()->host_desktop_type()); |
| 97 ASSERT_TRUE(new_browser); | 97 ASSERT_TRUE(new_browser); |
| 98 EXPECT_FALSE(new_browser->window()->IsActive()); | 98 EXPECT_FALSE(new_browser->window()->IsActive()); |
| 99 | 99 |
| 100 ASSERT_EQ(1u, chrome::GetBrowserCount(profile_4, | 100 ASSERT_EQ(1u, chrome::GetBrowserCount(profile_4, |
| 101 browser()->host_desktop_type())); | 101 browser()->host_desktop_type())); |
| 102 new_browser = FindBrowserWithProfile(profile_4, | 102 new_browser = |
| 103 browser()->host_desktop_type()); | 103 chrome::FindBrowserWithProfile(profile_4, browser()->host_desktop_type()); |
| 104 ASSERT_TRUE(new_browser); | 104 ASSERT_TRUE(new_browser); |
| 105 EXPECT_FALSE(new_browser->window()->IsActive()); | 105 EXPECT_FALSE(new_browser->window()->IsActive()); |
| 106 } | 106 } |
| 107 #endif // !OS_MACOSX && !OS_CHROMEOS | 107 #endif // !OS_MACOSX && !OS_CHROMEOS |
| OLD | NEW |