| 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_complete.h" | 10 #include "content/renderer/accessibility/renderer_accessibility_complete.h" |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 accessibility->SendPendingAccessibilityEvents(); | 328 accessibility->SendPendingAccessibilityEvents(); |
| 329 EXPECT_FALSE(sink_->GetUniqueMessageMatching( | 329 EXPECT_FALSE(sink_->GetUniqueMessageMatching( |
| 330 AccessibilityHostMsg_Events::ID)); | 330 AccessibilityHostMsg_Events::ID)); |
| 331 | 331 |
| 332 // Navigate, so we're not swapped out anymore. Now we should | 332 // Navigate, so we're not swapped out anymore. Now we should |
| 333 // send accessibility events again. Note that the | 333 // send accessibility events again. Note that the |
| 334 // message that was queued up before will be quickly discarded | 334 // message that was queued up before will be quickly discarded |
| 335 // because the element it was referring to no longer exists, | 335 // because the element it was referring to no longer exists, |
| 336 // so the event here is from loading this new page. | 336 // so the event here is from loading this new page. |
| 337 FrameMsg_Navigate_Params nav_params; | 337 FrameMsg_Navigate_Params nav_params; |
| 338 nav_params.url = GURL("data:text/html,<p>Hello, again.</p>"); | 338 nav_params.common_params.url = GURL("data:text/html,<p>Hello, again.</p>"); |
| 339 nav_params.navigation_type = FrameMsg_Navigate_Type::NORMAL; | 339 nav_params.common_params.navigation_type = FrameMsg_Navigate_Type::NORMAL; |
| 340 nav_params.transition = ui::PAGE_TRANSITION_TYPED; | 340 nav_params.common_params.transition = ui::PAGE_TRANSITION_TYPED; |
| 341 nav_params.current_history_list_length = 1; | 341 nav_params.current_history_list_length = 1; |
| 342 nav_params.current_history_list_offset = 0; | 342 nav_params.current_history_list_offset = 0; |
| 343 nav_params.pending_history_list_offset = 1; | 343 nav_params.pending_history_list_offset = 1; |
| 344 nav_params.page_id = -1; | 344 nav_params.page_id = -1; |
| 345 nav_params.browser_navigation_start = base::TimeTicks::FromInternalValue(1); | 345 nav_params.commit_params.browser_navigation_start = |
| 346 base::TimeTicks::FromInternalValue(1); |
| 346 frame()->OnNavigate(nav_params); | 347 frame()->OnNavigate(nav_params); |
| 347 accessibility->SendPendingAccessibilityEvents(); | 348 accessibility->SendPendingAccessibilityEvents(); |
| 348 EXPECT_TRUE(sink_->GetUniqueMessageMatching( | 349 EXPECT_TRUE(sink_->GetUniqueMessageMatching( |
| 349 AccessibilityHostMsg_Events::ID)); | 350 AccessibilityHostMsg_Events::ID)); |
| 350 } | 351 } |
| 351 | 352 |
| 352 TEST_F(RendererAccessibilityTest, HideAccessibilityObject) { | 353 TEST_F(RendererAccessibilityTest, HideAccessibilityObject) { |
| 353 // Test RendererAccessibilityComplete and make sure it sends the | 354 // Test RendererAccessibilityComplete and make sure it sends the |
| 354 // proper event to the browser when an object in the tree | 355 // proper event to the browser when an object in the tree |
| 355 // is hidden, but its children are not. | 356 // is hidden, but its children are not. |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 | 549 |
| 549 const IPC::Message* message = | 550 const IPC::Message* message = |
| 550 sink_->GetUniqueMessageMatching(AccessibilityHostMsg_Events::ID); | 551 sink_->GetUniqueMessageMatching(AccessibilityHostMsg_Events::ID); |
| 551 ASSERT_TRUE(message); | 552 ASSERT_TRUE(message); |
| 552 Tuple1<std::vector<AccessibilityHostMsg_EventParams> > param; | 553 Tuple1<std::vector<AccessibilityHostMsg_EventParams> > param; |
| 553 AccessibilityHostMsg_Events::Read(message, ¶m); | 554 AccessibilityHostMsg_Events::Read(message, ¶m); |
| 554 ASSERT_EQ(0U, param.a.size()); | 555 ASSERT_EQ(0U, param.a.size()); |
| 555 } | 556 } |
| 556 | 557 |
| 557 } // namespace content | 558 } // namespace content |
| OLD | NEW |