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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 // We should go back to normal after leaving highlight mode. | 241 // We should go back to normal after leaving highlight mode. |
242 toolbar_model()->StopHighlighting(); | 242 toolbar_model()->StopHighlighting(); |
243 EXPECT_EQ(3, browser_actions_bar()->VisibleBrowserActions()); | 243 EXPECT_EQ(3, browser_actions_bar()->VisibleBrowserActions()); |
244 EXPECT_EQ(3, browser_actions_bar()->NumberOfBrowserActions()); | 244 EXPECT_EQ(3, browser_actions_bar()->NumberOfBrowserActions()); |
245 action_view = container->GetToolbarActionViewAt(0); | 245 action_view = container->GetToolbarActionViewAt(0); |
246 EXPECT_TRUE(container->CanStartDragForView(action_view, point, point)); | 246 EXPECT_TRUE(container->CanStartDragForView(action_view, point, point)); |
247 } | 247 } |
248 | 248 |
249 // Test the behavior of the overflow container for Extension Actions. | 249 // Test the behavior of the overflow container for Extension Actions. |
250 class BrowserActionsContainerOverflowTest | 250 class BrowserActionsContainerOverflowTest |
251 : public BrowserActionsBarRedesignBrowserTest { | 251 : public BrowserActionsBarBrowserTest { |
252 public: | 252 public: |
253 BrowserActionsContainerOverflowTest() : main_bar_(nullptr), | 253 BrowserActionsContainerOverflowTest() : main_bar_(nullptr), |
254 overflow_bar_(nullptr) { | 254 overflow_bar_(nullptr) { |
255 } | 255 } |
256 ~BrowserActionsContainerOverflowTest() override {} | 256 ~BrowserActionsContainerOverflowTest() override {} |
257 | 257 |
258 protected: | 258 protected: |
259 // Returns true if the order of the ToolbarActionViews in |main_bar_| | 259 // Returns true if the order of the ToolbarActionViews in |main_bar_| |
260 // and |overflow_bar_| match. | 260 // and |overflow_bar_| match. |
261 bool ViewOrdersMatch(); | 261 bool ViewOrdersMatch(); |
(...skipping 195 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 |