Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(442)

Side by Side Diff: chrome/browser/ui/toolbar/toolbar_actions_bar_unittest.cc

Issue 1761913003: [Extensions] Default-enable the toolbar redesign on trunk (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/toolbar/app_menu_model.cc ('k') | chrome/browser/ui/toolbar/toolbar_actions_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698