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

Side by Side Diff: ui/app_list/app_list_item_list_unittest.cc

Issue 667923002: Standardize usage of virtual/override/final in ui/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « ui/app_list/app_list_folder_item.cc ('k') | ui/app_list/app_list_menu.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ui/app_list/app_list_item_list.h" 5 #include "ui/app_list/app_list_item_list.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "ui/app_list/app_list_folder_item.h" 10 #include "ui/app_list/app_list_folder_item.h"
11 #include "ui/app_list/app_list_item.h" 11 #include "ui/app_list/app_list_item.h"
12 #include "ui/app_list/app_list_item_list_observer.h" 12 #include "ui/app_list/app_list_item_list_observer.h"
13 13
14 namespace app_list { 14 namespace app_list {
15 15
16 namespace { 16 namespace {
17 17
18 class TestObserver : public AppListItemListObserver { 18 class TestObserver : public AppListItemListObserver {
19 public: 19 public:
20 TestObserver() : items_added_(0), items_removed_(0), items_moved_(0) {} 20 TestObserver() : items_added_(0), items_removed_(0), items_moved_(0) {}
21 21
22 virtual ~TestObserver() { 22 ~TestObserver() override {}
23 }
24 23
25 // AppListItemListObserver overriden: 24 // AppListItemListObserver overriden:
26 virtual void OnListItemAdded(size_t index, AppListItem* item) override { 25 void OnListItemAdded(size_t index, AppListItem* item) override {
27 ++items_added_; 26 ++items_added_;
28 } 27 }
29 28
30 virtual void OnListItemRemoved(size_t index, AppListItem* item) override { 29 void OnListItemRemoved(size_t index, AppListItem* item) override {
31 ++items_removed_; 30 ++items_removed_;
32 } 31 }
33 32
34 virtual void OnListItemMoved(size_t from_index, 33 void OnListItemMoved(size_t from_index,
35 size_t to_index, 34 size_t to_index,
36 AppListItem* item) override { 35 AppListItem* item) override {
37 ++items_moved_; 36 ++items_moved_;
38 } 37 }
39 38
40 size_t items_added() const { return items_added_; } 39 size_t items_added() const { return items_added_; }
41 size_t items_removed() const { return items_removed_; } 40 size_t items_removed() const { return items_removed_; }
42 size_t items_moved() const { return items_moved_; } 41 size_t items_moved() const { return items_moved_; }
43 42
44 void ResetCounts() { 43 void ResetCounts() {
45 items_added_ = 0; 44 items_added_ = 0;
46 items_removed_ = 0; 45 items_removed_ = 0;
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 EXPECT_TRUE(VerifyItemListOrdinals()); 359 EXPECT_TRUE(VerifyItemListOrdinals());
361 EXPECT_TRUE(VerifyItemOrder4(2, 0, 3, 1)); 360 EXPECT_TRUE(VerifyItemOrder4(2, 0, 3, 1));
362 // last -> last 361 // last -> last
363 item_list_.SetItemPosition(item_list_.item_at(3), 362 item_list_.SetItemPosition(item_list_.item_at(3),
364 item_list_.item_at(3)->position().CreateAfter()); 363 item_list_.item_at(3)->position().CreateAfter());
365 EXPECT_TRUE(VerifyItemListOrdinals()); 364 EXPECT_TRUE(VerifyItemListOrdinals());
366 EXPECT_TRUE(VerifyItemOrder4(2, 0, 3, 1)); 365 EXPECT_TRUE(VerifyItemOrder4(2, 0, 3, 1));
367 } 366 }
368 367
369 } // namespace app_list 368 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/app_list_folder_item.cc ('k') | ui/app_list/app_list_menu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698