OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <oleacc.h> | 5 #include <oleacc.h> |
6 | 6 |
7 #include "base/win/scoped_bstr.h" | 7 #include "base/win/scoped_bstr.h" |
8 #include "base/win/scoped_comptr.h" | 8 #include "base/win/scoped_comptr.h" |
9 #include "base/win/scoped_variant.h" | 9 #include "base/win/scoped_variant.h" |
10 #include "ui/views/accessibility/native_view_accessibility.h" | 10 #include "ui/views/accessibility/native_view_accessibility.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 ASSERT_STREQ(L"Name", name); | 52 ASSERT_STREQ(L"Name", name); |
53 | 53 |
54 base::win::ScopedBstr value; | 54 base::win::ScopedBstr value; |
55 ASSERT_EQ(S_OK, textfield_accessible->get_accValue( | 55 ASSERT_EQ(S_OK, textfield_accessible->get_accValue( |
56 childid_self, value.Receive())); | 56 childid_self, value.Receive())); |
57 ASSERT_STREQ(L"Value", value); | 57 ASSERT_STREQ(L"Value", value); |
58 | 58 |
59 base::win::ScopedBstr new_value(L"New value"); | 59 base::win::ScopedBstr new_value(L"New value"); |
60 ASSERT_EQ(S_OK, textfield_accessible->put_accValue(childid_self, new_value)); | 60 ASSERT_EQ(S_OK, textfield_accessible->put_accValue(childid_self, new_value)); |
61 | 61 |
62 ASSERT_STREQ(L"New value", textfield->text().c_str()); | 62 ASSERT_STREQ(L"New value", textfield->GetText().c_str()); |
63 } | 63 } |
64 | 64 |
65 TEST_F(NativeViewAcccessibilityWinTest, UnattachedWebView) { | 65 TEST_F(NativeViewAcccessibilityWinTest, UnattachedWebView) { |
66 // This is a regression test. Calling get_accChild on the native accessible | 66 // This is a regression test. Calling get_accChild on the native accessible |
67 // object for a WebView with no attached WebContents was causing an | 67 // object for a WebView with no attached WebContents was causing an |
68 // infinite loop and crash. This test simulates that with an ordinary | 68 // infinite loop and crash. This test simulates that with an ordinary |
69 // View that registers itself as a web view with NativeViewAcccessibility. | 69 // View that registers itself as a web view with NativeViewAcccessibility. |
70 | 70 |
71 Widget widget; | 71 Widget widget; |
72 Widget::InitParams init_params = | 72 Widget::InitParams init_params = |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 owned_widget.Init(owned_init_params); | 115 owned_widget.Init(owned_init_params); |
116 owned_widget.Show(); | 116 owned_widget.Show(); |
117 | 117 |
118 ASSERT_EQ(S_OK, root_view_accessible->get_accChildCount(&child_count)); | 118 ASSERT_EQ(S_OK, root_view_accessible->get_accChildCount(&child_count)); |
119 ASSERT_EQ(2L, child_count); | 119 ASSERT_EQ(2L, child_count); |
120 } | 120 } |
121 #endif | 121 #endif |
122 | 122 |
123 } // namespace test | 123 } // namespace test |
124 } // namespace views | 124 } // namespace views |
OLD | NEW |