| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/toolbar/toolbar_actions_bar_unittest.h" | 5 #include "chrome/browser/ui/toolbar/toolbar_actions_bar_unittest.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 : toolbar_model_(nullptr), | 89 : toolbar_model_(nullptr), |
| 90 use_redesign_(false) {} | 90 use_redesign_(false) {} |
| 91 | 91 |
| 92 ToolbarActionsBarUnitTest::ToolbarActionsBarUnitTest(bool use_redesign) | 92 ToolbarActionsBarUnitTest::ToolbarActionsBarUnitTest(bool use_redesign) |
| 93 : toolbar_model_(nullptr), | 93 : toolbar_model_(nullptr), |
| 94 use_redesign_(use_redesign) {} | 94 use_redesign_(use_redesign) {} |
| 95 | 95 |
| 96 ToolbarActionsBarUnitTest::~ToolbarActionsBarUnitTest() {} | 96 ToolbarActionsBarUnitTest::~ToolbarActionsBarUnitTest() {} |
| 97 | 97 |
| 98 void ToolbarActionsBarUnitTest::SetUp() { | 98 void ToolbarActionsBarUnitTest::SetUp() { |
| 99 if (use_redesign_) { | 99 redesign_switch_.reset(new extensions::FeatureSwitch::ScopedOverride( |
| 100 redesign_switch_.reset(new extensions::FeatureSwitch::ScopedOverride( | 100 extensions::FeatureSwitch::extension_action_redesign(), use_redesign_)); |
| 101 extensions::FeatureSwitch::extension_action_redesign(), true)); | |
| 102 } | |
| 103 | 101 |
| 104 BrowserWithTestWindowTest::SetUp(); | 102 BrowserWithTestWindowTest::SetUp(); |
| 105 // The toolbar typically displays extension icons, so create some extension | 103 // The toolbar typically displays extension icons, so create some extension |
| 106 // test infrastructure. | 104 // test infrastructure. |
| 107 extensions::TestExtensionSystem* extension_system = | 105 extensions::TestExtensionSystem* extension_system = |
| 108 static_cast<extensions::TestExtensionSystem*>( | 106 static_cast<extensions::TestExtensionSystem*>( |
| 109 extensions::ExtensionSystem::Get(profile())); | 107 extensions::ExtensionSystem::Get(profile())); |
| 110 extension_system->CreateExtensionService( | 108 extension_system->CreateExtensionService( |
| 111 base::CommandLine::ForCurrentProcess(), | 109 base::CommandLine::ForCurrentProcess(), |
| 112 base::FilePath(), | 110 base::FilePath(), |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 // Set the width back to the preferred width. All should be back to normal. | 588 // Set the width back to the preferred width. All should be back to normal. |
| 591 browser_action_test_util()->SetWidth( | 589 browser_action_test_util()->SetWidth( |
| 592 toolbar_actions_bar()->GetPreferredSize().width()); | 590 toolbar_actions_bar()->GetPreferredSize().width()); |
| 593 EXPECT_EQ(3u, toolbar_actions_bar()->GetIconCount()); | 591 EXPECT_EQ(3u, toolbar_actions_bar()->GetIconCount()); |
| 594 EXPECT_EQ(0u, toolbar_actions_bar()->GetStartIndexInBounds()); | 592 EXPECT_EQ(0u, toolbar_actions_bar()->GetStartIndexInBounds()); |
| 595 EXPECT_EQ(3u, toolbar_actions_bar()->GetEndIndexInBounds()); | 593 EXPECT_EQ(3u, toolbar_actions_bar()->GetEndIndexInBounds()); |
| 596 EXPECT_EQ(3u, overflow_bar()->GetStartIndexInBounds()); | 594 EXPECT_EQ(3u, overflow_bar()->GetStartIndexInBounds()); |
| 597 EXPECT_EQ(3u, overflow_bar()->GetEndIndexInBounds()); | 595 EXPECT_EQ(3u, overflow_bar()->GetEndIndexInBounds()); |
| 598 EXPECT_FALSE(toolbar_actions_bar()->NeedsOverflow()); | 596 EXPECT_FALSE(toolbar_actions_bar()->NeedsOverflow()); |
| 599 } | 597 } |
| OLD | NEW |