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 "base/strings/utf_string_conversions.h" | 5 #include "base/strings/utf_string_conversions.h" |
6 #include "base/time/time.h" | 6 #include "base/time/time.h" |
7 #include "content/common/frame_messages.h" | 7 #include "content/common/frame_messages.h" |
8 #include "content/common/view_message_enums.h" | 8 #include "content/common/view_message_enums.h" |
9 #include "content/public/test/render_view_test.h" | 9 #include "content/public/test/render_view_test.h" |
10 #include "content/renderer/accessibility/renderer_accessibility.h" | 10 #include "content/renderer/accessibility/renderer_accessibility.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 171 |
172 // Post a "value changed" event, but then swap out | 172 // Post a "value changed" event, but then swap out |
173 // before sending it. It shouldn't send the event while | 173 // before sending it. It shouldn't send the event while |
174 // swapped out. | 174 // swapped out. |
175 sink_->ClearMessages(); | 175 sink_->ClearMessages(); |
176 WebDocument document = view()->GetWebView()->mainFrame()->document(); | 176 WebDocument document = view()->GetWebView()->mainFrame()->document(); |
177 WebAXObject root_obj = document.accessibilityObject(); | 177 WebAXObject root_obj = document.accessibilityObject(); |
178 accessibility->HandleAXEvent( | 178 accessibility->HandleAXEvent( |
179 root_obj, | 179 root_obj, |
180 ui::AX_EVENT_VALUE_CHANGED); | 180 ui::AX_EVENT_VALUE_CHANGED); |
181 view()->GetMainRenderFrame()->OnSwapOut(kProxyRoutingId); | 181 view()->GetMainRenderFrame()->OnSwapOut(kProxyRoutingId, |
| 182 content::FrameReplicationState()); |
182 accessibility->SendPendingAccessibilityEvents(); | 183 accessibility->SendPendingAccessibilityEvents(); |
183 EXPECT_FALSE(sink_->GetUniqueMessageMatching( | 184 EXPECT_FALSE(sink_->GetUniqueMessageMatching( |
184 AccessibilityHostMsg_Events::ID)); | 185 AccessibilityHostMsg_Events::ID)); |
185 | 186 |
186 // Navigate, so we're not swapped out anymore. Now we should | 187 // Navigate, so we're not swapped out anymore. Now we should |
187 // send accessibility events again. Note that the | 188 // send accessibility events again. Note that the |
188 // message that was queued up before will be quickly discarded | 189 // message that was queued up before will be quickly discarded |
189 // because the element it was referring to no longer exists, | 190 // because the element it was referring to no longer exists, |
190 // so the event here is from loading this new page. | 191 // so the event here is from loading this new page. |
191 FrameMsg_Navigate_Params nav_params; | 192 FrameMsg_Navigate_Params nav_params; |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 | 404 |
404 const IPC::Message* message = | 405 const IPC::Message* message = |
405 sink_->GetUniqueMessageMatching(AccessibilityHostMsg_Events::ID); | 406 sink_->GetUniqueMessageMatching(AccessibilityHostMsg_Events::ID); |
406 ASSERT_TRUE(message); | 407 ASSERT_TRUE(message); |
407 Tuple2<std::vector<AccessibilityHostMsg_EventParams>, int> param; | 408 Tuple2<std::vector<AccessibilityHostMsg_EventParams>, int> param; |
408 AccessibilityHostMsg_Events::Read(message, ¶m); | 409 AccessibilityHostMsg_Events::Read(message, ¶m); |
409 ASSERT_EQ(0U, param.a.size()); | 410 ASSERT_EQ(0U, param.a.size()); |
410 } | 411 } |
411 | 412 |
412 } // namespace content | 413 } // namespace content |
OLD | NEW |