OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/base/models/tree_node_model.h" | 5 #include "ui/base/models/tree_node_model.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 added_count_, removed_count_, changed_count_)); | 30 added_count_, removed_count_, changed_count_)); |
31 added_count_ = removed_count_ = changed_count_ = 0; | 31 added_count_ = removed_count_ = changed_count_ = 0; |
32 return result; | 32 return result; |
33 } | 33 } |
34 | 34 |
35 private: | 35 private: |
36 // Overridden from TreeModelObserver: | 36 // Overridden from TreeModelObserver: |
37 virtual void TreeNodesAdded(TreeModel* model, | 37 virtual void TreeNodesAdded(TreeModel* model, |
38 TreeModelNode* parent, | 38 TreeModelNode* parent, |
39 int start, | 39 int start, |
40 int count) OVERRIDE { | 40 int count) override { |
41 added_count_++; | 41 added_count_++; |
42 } | 42 } |
43 virtual void TreeNodesRemoved(TreeModel* model, | 43 virtual void TreeNodesRemoved(TreeModel* model, |
44 TreeModelNode* parent, | 44 TreeModelNode* parent, |
45 int start, | 45 int start, |
46 int count) OVERRIDE { | 46 int count) override { |
47 removed_count_++; | 47 removed_count_++; |
48 } | 48 } |
49 virtual void TreeNodeChanged(TreeModel* model, TreeModelNode* node) OVERRIDE { | 49 virtual void TreeNodeChanged(TreeModel* model, TreeModelNode* node) override { |
50 changed_count_++; | 50 changed_count_++; |
51 } | 51 } |
52 | 52 |
53 int added_count_; | 53 int added_count_; |
54 int removed_count_; | 54 int removed_count_; |
55 int changed_count_; | 55 int changed_count_; |
56 | 56 |
57 DISALLOW_COPY_AND_ASSIGN(TreeNodeModelTest); | 57 DISALLOW_COPY_AND_ASSIGN(TreeNodeModelTest); |
58 }; | 58 }; |
59 | 59 |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 TEST_F(TreeNodeModelTest, IsRoot) { | 314 TEST_F(TreeNodeModelTest, IsRoot) { |
315 TestNode root; | 315 TestNode root; |
316 EXPECT_TRUE(root.is_root()); | 316 EXPECT_TRUE(root.is_root()); |
317 | 317 |
318 TestNode* child1 = new TestNode; | 318 TestNode* child1 = new TestNode; |
319 root.Add(child1, root.child_count()); | 319 root.Add(child1, root.child_count()); |
320 EXPECT_FALSE(child1->is_root()); | 320 EXPECT_FALSE(child1->is_root()); |
321 } | 321 } |
322 | 322 |
323 } // namespace ui | 323 } // namespace ui |
OLD | NEW |