| 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 "content/common/frame_messages.h" | 6 #include "content/common/frame_messages.h" |
| 7 #include "content/public/test/render_view_test.h" | 7 #include "content/public/test/render_view_test.h" |
| 8 #include "content/renderer/accessibility/renderer_accessibility_complete.h" | 8 #include "content/renderer/accessibility/renderer_accessibility_complete.h" |
| 9 #include "content/renderer/render_view_impl.h" | 9 #include "content/renderer/render_view_impl.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 | 342 |
| 343 // Post a "value changed" event, but then swap out | 343 // Post a "value changed" event, but then swap out |
| 344 // before sending it. It shouldn't send the event while | 344 // before sending it. It shouldn't send the event while |
| 345 // swapped out. | 345 // swapped out. |
| 346 sink_->ClearMessages(); | 346 sink_->ClearMessages(); |
| 347 WebDocument document = view()->GetWebView()->mainFrame()->document(); | 347 WebDocument document = view()->GetWebView()->mainFrame()->document(); |
| 348 WebAXObject root_obj = document.accessibilityObject(); | 348 WebAXObject root_obj = document.accessibilityObject(); |
| 349 accessibility->HandleAXEvent( | 349 accessibility->HandleAXEvent( |
| 350 root_obj, | 350 root_obj, |
| 351 ui::AX_EVENT_VALUE_CHANGED); | 351 ui::AX_EVENT_VALUE_CHANGED); |
| 352 view()->OnSwapOut(); | 352 view()->main_render_frame()->OnSwapOut(); |
| 353 accessibility->SendPendingAccessibilityEvents(); | 353 accessibility->SendPendingAccessibilityEvents(); |
| 354 EXPECT_FALSE(sink_->GetUniqueMessageMatching( | 354 EXPECT_FALSE(sink_->GetUniqueMessageMatching( |
| 355 AccessibilityHostMsg_Events::ID)); | 355 AccessibilityHostMsg_Events::ID)); |
| 356 | 356 |
| 357 // Navigate, so we're not swapped out anymore. Now we should | 357 // Navigate, so we're not swapped out anymore. Now we should |
| 358 // send accessibility events again. Note that the | 358 // send accessibility events again. Note that the |
| 359 // message that was queued up before will be quickly discarded | 359 // message that was queued up before will be quickly discarded |
| 360 // because the element it was referring to no longer exists, | 360 // because the element it was referring to no longer exists, |
| 361 // so the event here is from loading this new page. | 361 // so the event here is from loading this new page. |
| 362 FrameMsg_Navigate_Params nav_params; | 362 FrameMsg_Navigate_Params nav_params; |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 GetLastAccEvent(&event); | 537 GetLastAccEvent(&event); |
| 538 ASSERT_EQ(5U, event.nodes.size()); | 538 ASSERT_EQ(5U, event.nodes.size()); |
| 539 | 539 |
| 540 EXPECT_EQ(body.axID(), event.nodes[0].id); | 540 EXPECT_EQ(body.axID(), event.nodes[0].id); |
| 541 EXPECT_EQ(text_1.axID(), event.nodes[1].id); | 541 EXPECT_EQ(text_1.axID(), event.nodes[1].id); |
| 542 // The third event is to update text_2, but its id changes | 542 // The third event is to update text_2, but its id changes |
| 543 // so we don't have a test expectation for it. | 543 // so we don't have a test expectation for it. |
| 544 } | 544 } |
| 545 | 545 |
| 546 } // namespace content | 546 } // namespace content |
| OLD | NEW |