| 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 146 |
| 147 // Test that changes performed in one container affect containers in other | 147 // Test that changes performed in one container affect containers in other |
| 148 // windows so that it is consistent. | 148 // windows so that it is consistent. |
| 149 IN_PROC_BROWSER_TEST_F(BrowserActionsBarBrowserTest, MultipleWindows) { | 149 IN_PROC_BROWSER_TEST_F(BrowserActionsBarBrowserTest, MultipleWindows) { |
| 150 LoadExtensions(); | 150 LoadExtensions(); |
| 151 BrowserActionsContainer* first = | 151 BrowserActionsContainer* first = |
| 152 BrowserView::GetBrowserViewForBrowser(browser())->toolbar()-> | 152 BrowserView::GetBrowserViewForBrowser(browser())->toolbar()-> |
| 153 browser_actions(); | 153 browser_actions(); |
| 154 | 154 |
| 155 // Create a second browser. | 155 // Create a second browser. |
| 156 Browser* second_browser = new Browser(Browser::CreateParams(profile())); | 156 Browser* second_browser = new Browser(Browser::CreateParams(profile(), true)); |
| 157 BrowserActionsContainer* second = | 157 BrowserActionsContainer* second = |
| 158 BrowserView::GetBrowserViewForBrowser(second_browser)->toolbar()-> | 158 BrowserView::GetBrowserViewForBrowser(second_browser)->toolbar()-> |
| 159 browser_actions(); | 159 browser_actions(); |
| 160 | 160 |
| 161 // Both containers should have the same order and visible actions, which | 161 // Both containers should have the same order and visible actions, which |
| 162 // is right now A B C. | 162 // is right now A B C. |
| 163 EXPECT_EQ(3u, first->VisibleBrowserActions()); | 163 EXPECT_EQ(3u, first->VisibleBrowserActions()); |
| 164 EXPECT_EQ(3u, second->VisibleBrowserActions()); | 164 EXPECT_EQ(3u, second->VisibleBrowserActions()); |
| 165 EXPECT_EQ(extension_a()->id(), first->GetIdAt(0u)); | 165 EXPECT_EQ(extension_a()->id(), first->GetIdAt(0u)); |
| 166 EXPECT_EQ(extension_a()->id(), second->GetIdAt(0u)); | 166 EXPECT_EQ(extension_a()->id(), second->GetIdAt(0u)); |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 | 457 |
| 458 main_bar()->OnDragUpdated(target_event3); | 458 main_bar()->OnDragUpdated(target_event3); |
| 459 main_bar()->OnPerformDrop(target_event3); | 459 main_bar()->OnPerformDrop(target_event3); |
| 460 | 460 |
| 461 // Order should be A C B, and there should be no extensions in overflow. | 461 // Order should be A C B, and there should be no extensions in overflow. |
| 462 EXPECT_EQ(extension_a()->id(), main_bar()->GetIdAt(0u)); | 462 EXPECT_EQ(extension_a()->id(), main_bar()->GetIdAt(0u)); |
| 463 EXPECT_EQ(extension_c()->id(), main_bar()->GetIdAt(1u)); | 463 EXPECT_EQ(extension_c()->id(), main_bar()->GetIdAt(1u)); |
| 464 EXPECT_EQ(extension_b()->id(), main_bar()->GetIdAt(2u)); | 464 EXPECT_EQ(extension_b()->id(), main_bar()->GetIdAt(2u)); |
| 465 EXPECT_TRUE(VerifyVisibleCount(3u)); | 465 EXPECT_TRUE(VerifyVisibleCount(3u)); |
| 466 } | 466 } |
| OLD | NEW |