| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chrome/browser/ui/views/toolbar/browser_actions_container.h" | 5 #include "chrome/browser/ui/views/toolbar/browser_actions_container.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" | 10 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 | 134 |
| 135 // Test that changes performed in one container affect containers in other | 135 // Test that changes performed in one container affect containers in other |
| 136 // windows so that it is consistent. | 136 // windows so that it is consistent. |
| 137 IN_PROC_BROWSER_TEST_F(BrowserActionsBarBrowserTest, MultipleWindows) { | 137 IN_PROC_BROWSER_TEST_F(BrowserActionsBarBrowserTest, MultipleWindows) { |
| 138 LoadExtensions(); | 138 LoadExtensions(); |
| 139 BrowserActionsContainer* first = | 139 BrowserActionsContainer* first = |
| 140 BrowserView::GetBrowserViewForBrowser(browser())->toolbar()-> | 140 BrowserView::GetBrowserViewForBrowser(browser())->toolbar()-> |
| 141 browser_actions(); | 141 browser_actions(); |
| 142 | 142 |
| 143 // Create a second browser. | 143 // Create a second browser. |
| 144 Browser* second_browser = new Browser( | 144 Browser* second_browser = new Browser(Browser::CreateParams(profile())); |
| 145 Browser::CreateParams(profile(), browser()->host_desktop_type())); | |
| 146 BrowserActionsContainer* second = | 145 BrowserActionsContainer* second = |
| 147 BrowserView::GetBrowserViewForBrowser(second_browser)->toolbar()-> | 146 BrowserView::GetBrowserViewForBrowser(second_browser)->toolbar()-> |
| 148 browser_actions(); | 147 browser_actions(); |
| 149 | 148 |
| 150 // Both containers should have the same order and visible actions, which | 149 // Both containers should have the same order and visible actions, which |
| 151 // is right now A B C. | 150 // is right now A B C. |
| 152 EXPECT_EQ(3u, first->VisibleBrowserActions()); | 151 EXPECT_EQ(3u, first->VisibleBrowserActions()); |
| 153 EXPECT_EQ(3u, second->VisibleBrowserActions()); | 152 EXPECT_EQ(3u, second->VisibleBrowserActions()); |
| 154 EXPECT_EQ(extension_a()->id(), first->GetIdAt(0u)); | 153 EXPECT_EQ(extension_a()->id(), first->GetIdAt(0u)); |
| 155 EXPECT_EQ(extension_a()->id(), second->GetIdAt(0u)); | 154 EXPECT_EQ(extension_a()->id(), second->GetIdAt(0u)); |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 | 449 |
| 451 main_bar()->OnDragUpdated(target_event3); | 450 main_bar()->OnDragUpdated(target_event3); |
| 452 main_bar()->OnPerformDrop(target_event3); | 451 main_bar()->OnPerformDrop(target_event3); |
| 453 | 452 |
| 454 // Order should be A C B, and there should be no extensions in overflow. | 453 // Order should be A C B, and there should be no extensions in overflow. |
| 455 EXPECT_EQ(extension_a()->id(), main_bar()->GetIdAt(0u)); | 454 EXPECT_EQ(extension_a()->id(), main_bar()->GetIdAt(0u)); |
| 456 EXPECT_EQ(extension_c()->id(), main_bar()->GetIdAt(1u)); | 455 EXPECT_EQ(extension_c()->id(), main_bar()->GetIdAt(1u)); |
| 457 EXPECT_EQ(extension_b()->id(), main_bar()->GetIdAt(2u)); | 456 EXPECT_EQ(extension_b()->id(), main_bar()->GetIdAt(2u)); |
| 458 EXPECT_TRUE(VerifyVisibleCount(3u)); | 457 EXPECT_TRUE(VerifyVisibleCount(3u)); |
| 459 } | 458 } |
| OLD | NEW |