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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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.url = GURL("data:text/html,<p>Hello, again.</p>"); |
339 nav_params.navigation_type = FrameMsg_Navigate_Type::NORMAL; | 339 nav_params.navigation_type = FrameMsg_Navigate_Type::NORMAL; |
340 nav_params.transition = PAGE_TRANSITION_TYPED; | 340 nav_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.browser_navigation_start = base::TimeTicks::FromInternalValue(1); |
346 frame()->OnNavigate(nav_params); | 346 frame()->OnNavigate(nav_params); |
347 accessibility->SendPendingAccessibilityEvents(); | 347 accessibility->SendPendingAccessibilityEvents(); |
348 EXPECT_TRUE(sink_->GetUniqueMessageMatching( | 348 EXPECT_TRUE(sink_->GetUniqueMessageMatching( |
349 AccessibilityHostMsg_Events::ID)); | 349 AccessibilityHostMsg_Events::ID)); |
350 } | 350 } |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 | 548 |
549 const IPC::Message* message = | 549 const IPC::Message* message = |
550 sink_->GetUniqueMessageMatching(AccessibilityHostMsg_Events::ID); | 550 sink_->GetUniqueMessageMatching(AccessibilityHostMsg_Events::ID); |
551 ASSERT_TRUE(message); | 551 ASSERT_TRUE(message); |
552 Tuple1<std::vector<AccessibilityHostMsg_EventParams> > param; | 552 Tuple1<std::vector<AccessibilityHostMsg_EventParams> > param; |
553 AccessibilityHostMsg_Events::Read(message, ¶m); | 553 AccessibilityHostMsg_Events::Read(message, ¶m); |
554 ASSERT_EQ(0U, param.a.size()); | 554 ASSERT_EQ(0U, param.a.size()); |
555 } | 555 } |
556 | 556 |
557 } // namespace content | 557 } // namespace content |
OLD | NEW |