OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <vector> | 6 #include <vector> |
7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" |
8 #include "base/win/scoped_comptr.h" | 9 #include "base/win/scoped_comptr.h" |
9 #include "chrome/browser/automation/ui_controls.h" | 10 #include "chrome/browser/automation/ui_controls.h" |
10 #include "chrome/browser/renderer_host/render_widget_host_view_win.h" | 11 #include "chrome/browser/renderer_host/render_widget_host_view_win.h" |
11 #include "chrome/browser/ui/browser.h" | 12 #include "chrome/browser/ui/browser.h" |
12 #include "chrome/browser/ui/browser_window.h" | 13 #include "chrome/browser/ui/browser_window.h" |
13 #include "chrome/test/in_process_browser_test.h" | 14 #include "chrome/test/in_process_browser_test.h" |
14 #include "chrome/test/ui_test_utils.h" | 15 #include "chrome/test/ui_test_utils.h" |
15 #include "content/browser/renderer_host/render_view_host.h" | 16 #include "content/browser/renderer_host/render_view_host.h" |
16 #include "content/browser/tab_contents/tab_contents.h" | 17 #include "content/browser/tab_contents/tab_contents.h" |
17 #include "content/common/notification_type.h" | 18 #include "content/common/notification_type.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 break; | 162 break; |
162 } | 163 } |
163 } | 164 } |
164 | 165 |
165 LONG child_count; | 166 LONG child_count; |
166 hr = accessible->get_accChildCount(&child_count); | 167 hr = accessible->get_accChildCount(&child_count); |
167 ASSERT_EQ(S_OK, hr); | 168 ASSERT_EQ(S_OK, hr); |
168 if (child_count == 0) | 169 if (child_count == 0) |
169 continue; | 170 continue; |
170 | 171 |
171 auto_ptr<VARIANT> child_array(new VARIANT[child_count]); | 172 scoped_array<VARIANT> child_array(new VARIANT[child_count]); |
172 LONG obtained_count = 0; | 173 LONG obtained_count = 0; |
173 hr = AccessibleChildren( | 174 hr = AccessibleChildren( |
174 accessible, 0, child_count, child_array.get(), &obtained_count); | 175 accessible, 0, child_count, child_array.get(), &obtained_count); |
175 ASSERT_EQ(S_OK, hr); | 176 ASSERT_EQ(S_OK, hr); |
176 ASSERT_EQ(child_count, obtained_count); | 177 ASSERT_EQ(child_count, obtained_count); |
177 | 178 |
178 for (int index = 0; index < obtained_count; index++) { | 179 for (int index = 0; index < obtained_count; index++) { |
179 base::win::ScopedComPtr<IAccessible> child_accessible( | 180 base::win::ScopedComPtr<IAccessible> child_accessible( |
180 GetAccessibleFromResultVariant(accessible, &child_array.get()[index])); | 181 GetAccessibleFromResultVariant(accessible, &child_array.get()[index])); |
181 if (child_accessible.get()) { | 182 if (child_accessible.get()) { |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 ASSERT_EQ(S_OK, hr); | 711 ASSERT_EQ(S_OK, hr); |
711 hr = checkbox_isimpledomnode->get_nodeInfo( | 712 hr = checkbox_isimpledomnode->get_nodeInfo( |
712 &node_name, &name_space_id, &node_value, &num_children, &unique_id, | 713 &node_name, &name_space_id, &node_value, &num_children, &unique_id, |
713 &node_type); | 714 &node_type); |
714 ASSERT_EQ(S_OK, hr); | 715 ASSERT_EQ(S_OK, hr); |
715 EXPECT_STREQ(L"input", wstring(node_name, SysStringLen(node_name)).c_str()); | 716 EXPECT_STREQ(L"input", wstring(node_name, SysStringLen(node_name)).c_str()); |
716 EXPECT_EQ(NODETYPE_ELEMENT, node_type); | 717 EXPECT_EQ(NODETYPE_ELEMENT, node_type); |
717 EXPECT_EQ(0, num_children); | 718 EXPECT_EQ(0, num_children); |
718 } | 719 } |
719 } // namespace. | 720 } // namespace. |
OLD | NEW |