OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/accessibility/ax_tree_combiner.h" |
| 6 |
5 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
6 #include "ui/accessibility/ax_tree_combiner.h" | 8 #include "ui/accessibility/ax_enums.h" |
7 | 9 |
8 namespace ui { | 10 namespace ui { |
9 | 11 |
10 TEST(CombineAXTreesTest, RenumberOneTree) { | 12 TEST(CombineAXTreesTest, RenumberOneTree) { |
11 AXTreeUpdate tree; | 13 AXTreeUpdate tree; |
12 tree.has_tree_data = true; | 14 tree.has_tree_data = true; |
13 tree.tree_data.tree_id = 1; | 15 tree.tree_data.tree_id = 1; |
14 tree.root_id = 2; | 16 tree.root_id = 2; |
15 tree.nodes.resize(3); | 17 tree.nodes.resize(3); |
16 tree.nodes[0].id = 2; | 18 tree.nodes[0].id = 2; |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 combiner.AddTree(child_tree, false); | 239 combiner.AddTree(child_tree, false); |
238 combiner.Combine(); | 240 combiner.Combine(); |
239 | 241 |
240 const AXTreeUpdate& combined = combiner.combined(); | 242 const AXTreeUpdate& combined = combiner.combined(); |
241 | 243 |
242 ASSERT_EQ(6U, combined.nodes.size()); | 244 ASSERT_EQ(6U, combined.nodes.size()); |
243 EXPECT_EQ(6, combined.tree_data.focus_id); | 245 EXPECT_EQ(6, combined.tree_data.focus_id); |
244 } | 246 } |
245 | 247 |
246 } // namespace ui | 248 } // namespace ui |
OLD | NEW |