| 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/view_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" |
| 11 #include "third_party/WebKit/public/platform/WebSize.h" | 11 #include "third_party/WebKit/public/platform/WebSize.h" |
| 12 #include "third_party/WebKit/public/web/WebAXObject.h" | 12 #include "third_party/WebKit/public/web/WebAXObject.h" |
| 13 #include "third_party/WebKit/public/web/WebDocument.h" | 13 #include "third_party/WebKit/public/web/WebDocument.h" |
| 14 #include "third_party/WebKit/public/web/WebView.h" | 14 #include "third_party/WebKit/public/web/WebView.h" |
| 15 #include "ui/accessibility/ax_node_data.h" | 15 #include "ui/accessibility/ax_node_data.h" |
| 16 | 16 |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 view()->OnSwapOut(); | 347 view()->OnSwapOut(); |
| 348 accessibility->SendPendingAccessibilityEvents(); | 348 accessibility->SendPendingAccessibilityEvents(); |
| 349 EXPECT_FALSE(sink_->GetUniqueMessageMatching( | 349 EXPECT_FALSE(sink_->GetUniqueMessageMatching( |
| 350 AccessibilityHostMsg_Events::ID)); | 350 AccessibilityHostMsg_Events::ID)); |
| 351 | 351 |
| 352 // Navigate, so we're not swapped out anymore. Now we should | 352 // Navigate, so we're not swapped out anymore. Now we should |
| 353 // send accessibility events again. Note that the | 353 // send accessibility events again. Note that the |
| 354 // message that was queued up before will be quickly discarded | 354 // message that was queued up before will be quickly discarded |
| 355 // because the element it was referring to no longer exists, | 355 // because the element it was referring to no longer exists, |
| 356 // so the event here is from loading this new page. | 356 // so the event here is from loading this new page. |
| 357 ViewMsg_Navigate_Params nav_params; | 357 FrameMsg_Navigate_Params nav_params; |
| 358 nav_params.url = GURL("data:text/html,<p>Hello, again.</p>"); | 358 nav_params.url = GURL("data:text/html,<p>Hello, again.</p>"); |
| 359 nav_params.navigation_type = ViewMsg_Navigate_Type::NORMAL; | 359 nav_params.navigation_type = FrameMsg_Navigate_Type::NORMAL; |
| 360 nav_params.transition = PAGE_TRANSITION_TYPED; | 360 nav_params.transition = PAGE_TRANSITION_TYPED; |
| 361 nav_params.current_history_list_length = 1; | 361 nav_params.current_history_list_length = 1; |
| 362 nav_params.current_history_list_offset = 0; | 362 nav_params.current_history_list_offset = 0; |
| 363 nav_params.pending_history_list_offset = 1; | 363 nav_params.pending_history_list_offset = 1; |
| 364 nav_params.page_id = -1; | 364 nav_params.page_id = -1; |
| 365 view()->OnNavigate(nav_params); | 365 view()->OnNavigate(nav_params); |
| 366 accessibility->SendPendingAccessibilityEvents(); | 366 accessibility->SendPendingAccessibilityEvents(); |
| 367 EXPECT_TRUE(sink_->GetUniqueMessageMatching( | 367 EXPECT_TRUE(sink_->GetUniqueMessageMatching( |
| 368 AccessibilityHostMsg_Events::ID)); | 368 AccessibilityHostMsg_Events::ID)); |
| 369 } | 369 } |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 GetLastAccEvent(&event); | 532 GetLastAccEvent(&event); |
| 533 ASSERT_EQ(5U, event.nodes.size()); | 533 ASSERT_EQ(5U, event.nodes.size()); |
| 534 | 534 |
| 535 EXPECT_EQ(body.axID(), event.nodes[0].id); | 535 EXPECT_EQ(body.axID(), event.nodes[0].id); |
| 536 EXPECT_EQ(text_1.axID(), event.nodes[1].id); | 536 EXPECT_EQ(text_1.axID(), event.nodes[1].id); |
| 537 // The third event is to update text_2, but its id changes | 537 // The third event is to update text_2, but its id changes |
| 538 // so we don't have a test expectation for it. | 538 // so we don't have a test expectation for it. |
| 539 } | 539 } |
| 540 | 540 |
| 541 } // namespace content | 541 } // namespace content |
| OLD | NEW |