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

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

Issue 2606293002: Remove ScopedVector from chrome/browser/ui. (Closed)
Patch Set: view Created 3 years, 11 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 20 matching lines...) Expand all
31 namespace { 31 namespace {
32 32
33 // Verifies that the toolbar order matches for the given |actions_bar|. If the 33 // Verifies that the toolbar order matches for the given |actions_bar|. If the
34 // order matches, the return value is empty; otherwise, it contains the error. 34 // order matches, the return value is empty; otherwise, it contains the error.
35 std::string VerifyToolbarOrderForBar( 35 std::string VerifyToolbarOrderForBar(
36 const ToolbarActionsBar* actions_bar, 36 const ToolbarActionsBar* actions_bar,
37 BrowserActionTestUtil* browser_action_test_util, 37 BrowserActionTestUtil* browser_action_test_util,
38 const char* expected_names[], 38 const char* expected_names[],
39 size_t total_size, 39 size_t total_size,
40 size_t visible_count) { 40 size_t visible_count) {
41 const std::vector<ToolbarActionViewController*>& toolbar_actions = 41 const auto& toolbar_actions = actions_bar->toolbar_actions_unordered();
Nico 2017/01/03 18:12:35 i think style guide says that this should have an
Avi (use Gerrit) 2017/01/03 22:54:53 Done.
42 actions_bar->toolbar_actions_unordered();
43 // If the total size is wrong, we risk segfaulting by continuing. Abort now. 42 // If the total size is wrong, we risk segfaulting by continuing. Abort now.
44 if (total_size != toolbar_actions.size()) { 43 if (total_size != toolbar_actions.size()) {
45 return base::StringPrintf("Incorrect action count: expected %d, found %d", 44 return base::StringPrintf("Incorrect action count: expected %d, found %d",
46 static_cast<int>(total_size), 45 static_cast<int>(total_size),
47 static_cast<int>(toolbar_actions.size())); 46 static_cast<int>(toolbar_actions.size()));
48 } 47 }
49 48
50 // Check that the ToolbarActionsBar matches the expected state. 49 // Check that the ToolbarActionsBar matches the expected state.
51 std::string error; 50 std::string error;
52 for (size_t i = 0; i < total_size; ++i) { 51 for (size_t i = 0; i < total_size; ++i) {
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 extensions::extension_action_test_util::BROWSER_ACTION); 573 extensions::extension_action_test_util::BROWSER_ACTION);
575 toolbar_model()->SetVisibleIconCount(0u); 574 toolbar_model()->SetVisibleIconCount(0u);
576 { 575 {
577 base::RunLoop run_loop; 576 base::RunLoop run_loop;
578 toolbar_actions_bar()->PopOutAction(action, true, run_loop.QuitClosure()); 577 toolbar_actions_bar()->PopOutAction(action, true, run_loop.QuitClosure());
579 run_loop.Run(); 578 run_loop.Run();
580 } 579 }
581 EXPECT_EQ(1u, toolbar_actions_bar()->GetIconCount()); 580 EXPECT_EQ(1u, toolbar_actions_bar()->GetIconCount());
582 EXPECT_TRUE(toolbar_actions_bar()->NeedsOverflow()); 581 EXPECT_TRUE(toolbar_actions_bar()->NeedsOverflow());
583 } 582 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698