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/list_selection_model.h" | 5 #include "ui/base/models/list_selection_model.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 | 12 |
13 namespace ui { | 13 namespace ui { |
14 | 14 |
15 typedef testing::Test ListSelectionModelTest; | 15 typedef testing::Test ListSelectionModelTest; |
16 | 16 |
17 // Returns the state of the selection model as a string. The format is: | 17 // Returns the state of the selection model as a string. The format is: |
18 // 'active=X anchor=X selection=X X X...'. | 18 // 'active=X anchor=X selection=X X X...'. |
19 static std::string StateAsString(const ListSelectionModel& model) { | 19 static std::string StateAsString(const ListSelectionModel& model) { |
20 std::string result = "active=" + base::IntToString(model.active()) + | 20 std::string result = "active=" + base::IntToString(model.active()) + |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 | 188 |
189 EXPECT_TRUE(model1.Equals(model2)); | 189 EXPECT_TRUE(model1.Equals(model2)); |
190 EXPECT_TRUE(model2.Equals(model1)); | 190 EXPECT_TRUE(model2.Equals(model1)); |
191 | 191 |
192 model2.SetSelectedIndex(0); | 192 model2.SetSelectedIndex(0); |
193 EXPECT_FALSE(model1.Equals(model2)); | 193 EXPECT_FALSE(model1.Equals(model2)); |
194 EXPECT_FALSE(model2.Equals(model1)); | 194 EXPECT_FALSE(model2.Equals(model1)); |
195 } | 195 } |
196 | 196 |
197 } // namespace ui | 197 } // namespace ui |
OLD | NEW |