OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <atlbase.h> | 5 #include <atlbase.h> |
6 #include <atlcom.h> | 6 #include <atlcom.h> |
7 #include <oleacc.h> | 7 #include <oleacc.h> |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/win/scoped_bstr.h" | 10 #include "base/win/scoped_bstr.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 class AXPlatformNodeWinTest : public testing::Test { | 34 class AXPlatformNodeWinTest : public testing::Test { |
35 public: | 35 public: |
36 AXPlatformNodeWinTest() {} | 36 AXPlatformNodeWinTest() {} |
37 ~AXPlatformNodeWinTest() override {} | 37 ~AXPlatformNodeWinTest() override {} |
38 | 38 |
39 void SetUp() override { | 39 void SetUp() override { |
40 win::CreateATLModuleIfNeeded(); | 40 win::CreateATLModuleIfNeeded(); |
41 } | 41 } |
42 | 42 |
43 // Initialize given an AXTreeUpdate. | 43 // Initialize given an AXTreeUpdate. |
44 void Init(const AXTreeUpdate<AXNodeData>& initial_state) { | 44 void Init(const AXTreeUpdate& initial_state) { |
45 tree_.reset(new AXTree(initial_state)); | 45 tree_.reset(new AXTree(initial_state)); |
46 } | 46 } |
47 | 47 |
48 // Convenience functions to initialize directly from a few AXNodeDatas. | 48 // Convenience functions to initialize directly from a few AXNodeDatas. |
49 void Init(const AXNodeData& node1) { | 49 void Init(const AXNodeData& node1) { |
50 AXTreeUpdate<AXNodeData> update; | 50 AXTreeUpdate update; |
51 update.nodes.push_back(node1); | 51 update.nodes.push_back(node1); |
52 Init(update); | 52 Init(update); |
53 } | 53 } |
54 | 54 |
55 void Init(const AXNodeData& node1, | 55 void Init(const AXNodeData& node1, |
56 const AXNodeData& node2) { | 56 const AXNodeData& node2) { |
57 AXTreeUpdate<AXNodeData> update; | 57 AXTreeUpdate update; |
58 update.nodes.push_back(node1); | 58 update.nodes.push_back(node1); |
59 update.nodes.push_back(node2); | 59 update.nodes.push_back(node2); |
60 Init(update); | 60 Init(update); |
61 } | 61 } |
62 | 62 |
63 void Init(const AXNodeData& node1, | 63 void Init(const AXNodeData& node1, |
64 const AXNodeData& node2, | 64 const AXNodeData& node2, |
65 const AXNodeData& node3) { | 65 const AXNodeData& node3) { |
66 AXTreeUpdate<AXNodeData> update; | 66 AXTreeUpdate update; |
67 update.nodes.push_back(node1); | 67 update.nodes.push_back(node1); |
68 update.nodes.push_back(node2); | 68 update.nodes.push_back(node2); |
69 update.nodes.push_back(node3); | 69 update.nodes.push_back(node3); |
70 Init(update); | 70 Init(update); |
71 } | 71 } |
72 | 72 |
73 protected: | 73 protected: |
74 AXNode* GetRootNode() { | 74 AXNode* GetRootNode() { |
75 return tree_->root(); | 75 return tree_->root(); |
76 } | 76 } |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 ASSERT_EQ(E_FAIL, root_iaccessible2->get_indexInParent(&index)); | 399 ASSERT_EQ(E_FAIL, root_iaccessible2->get_indexInParent(&index)); |
400 | 400 |
401 ASSERT_EQ(S_OK, left_iaccessible2->get_indexInParent(&index)); | 401 ASSERT_EQ(S_OK, left_iaccessible2->get_indexInParent(&index)); |
402 EXPECT_EQ(0, index); | 402 EXPECT_EQ(0, index); |
403 | 403 |
404 ASSERT_EQ(S_OK, right_iaccessible2->get_indexInParent(&index)); | 404 ASSERT_EQ(S_OK, right_iaccessible2->get_indexInParent(&index)); |
405 EXPECT_EQ(1, index); | 405 EXPECT_EQ(1, index); |
406 } | 406 } |
407 | 407 |
408 } // namespace ui | 408 } // namespace ui |
OLD | NEW |