OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/tree_node_model.h" | 5 #include "app/tree_node_model.h" |
6 #include "base/string16.h" | 6 #include "base/string16.h" |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 class TreeNodeModelTest : public testing::Test, public TreeModelObserver { | 10 class TreeNodeModelTest : public testing::Test, public TreeModelObserver { |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 // Makes sure that we are notified when the node is renamed, | 274 // Makes sure that we are notified when the node is renamed, |
275 // also makes sure the node is properly renamed. | 275 // also makes sure the node is properly renamed. |
276 TEST_F(TreeNodeModelTest, SetTitle) { | 276 TEST_F(TreeNodeModelTest, SetTitle) { |
277 TreeNodeWithValue<int>* root = | 277 TreeNodeWithValue<int>* root = |
278 new TreeNodeWithValue<int>(L"root", 0); | 278 new TreeNodeWithValue<int>(L"root", 0); |
279 TreeNodeModel<TreeNodeWithValue<int> > model(root); | 279 TreeNodeModel<TreeNodeWithValue<int> > model(root); |
280 model.AddObserver(this); | 280 model.AddObserver(this); |
281 ClearCounts(); | 281 ClearCounts(); |
282 | 282 |
283 const string16 title(ASCIIToUTF16("root2")); | 283 const string16 title(ASCIIToUTF16("root2")); |
284 model.SetTitle(root, UTF16ToWideHack(title)); | 284 model.SetTitle(root, title); |
285 AssertObserverCount(0, 0, 1); | 285 AssertObserverCount(0, 0, 1); |
286 EXPECT_EQ(title, root->GetTitleAsString16()); | 286 EXPECT_EQ(title, root->GetTitleAsString16()); |
287 } | 287 } |
OLD | NEW |