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 <tuple> |
| 6 |
5 #include "base/macros.h" | 7 #include "base/macros.h" |
6 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
7 #include "base/time/time.h" | 9 #include "base/time/time.h" |
8 #include "build/build_config.h" | 10 #include "build/build_config.h" |
9 #include "content/common/accessibility_messages.h" | 11 #include "content/common/accessibility_messages.h" |
10 #include "content/common/frame_messages.h" | 12 #include "content/common/frame_messages.h" |
11 #include "content/common/site_isolation_policy.h" | 13 #include "content/common/site_isolation_policy.h" |
12 #include "content/common/view_message_enums.h" | 14 #include "content/common/view_message_enums.h" |
13 #include "content/public/common/content_switches.h" | 15 #include "content/public/common/content_switches.h" |
14 #include "content/public/test/render_view_test.h" | 16 #include "content/public/test/render_view_test.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 68 |
67 void SetMode(AccessibilityMode mode) { | 69 void SetMode(AccessibilityMode mode) { |
68 frame()->OnSetAccessibilityMode(mode); | 70 frame()->OnSetAccessibilityMode(mode); |
69 } | 71 } |
70 | 72 |
71 void GetAllAccEvents( | 73 void GetAllAccEvents( |
72 std::vector<AccessibilityHostMsg_EventParams>* param_list) { | 74 std::vector<AccessibilityHostMsg_EventParams>* param_list) { |
73 const IPC::Message* message = | 75 const IPC::Message* message = |
74 sink_->GetUniqueMessageMatching(AccessibilityHostMsg_Events::ID); | 76 sink_->GetUniqueMessageMatching(AccessibilityHostMsg_Events::ID); |
75 ASSERT_TRUE(message); | 77 ASSERT_TRUE(message); |
76 base::Tuple<std::vector<AccessibilityHostMsg_EventParams>, int> param; | 78 std::tuple<std::vector<AccessibilityHostMsg_EventParams>, int> param; |
77 AccessibilityHostMsg_Events::Read(message, ¶m); | 79 AccessibilityHostMsg_Events::Read(message, ¶m); |
78 *param_list = base::get<0>(param); | 80 *param_list = std::get<0>(param); |
79 } | 81 } |
80 | 82 |
81 void GetLastAccEvent( | 83 void GetLastAccEvent( |
82 AccessibilityHostMsg_EventParams* params) { | 84 AccessibilityHostMsg_EventParams* params) { |
83 std::vector<AccessibilityHostMsg_EventParams> param_list; | 85 std::vector<AccessibilityHostMsg_EventParams> param_list; |
84 GetAllAccEvents(¶m_list); | 86 GetAllAccEvents(¶m_list); |
85 ASSERT_GE(param_list.size(), 1U); | 87 ASSERT_GE(param_list.size(), 1U); |
86 *params = param_list[0]; | 88 *params = param_list[0]; |
87 } | 89 } |
88 | 90 |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 GetLastAccEvent(&event); | 333 GetLastAccEvent(&event); |
332 ASSERT_EQ(5U, event.update.nodes.size()); | 334 ASSERT_EQ(5U, event.update.nodes.size()); |
333 | 335 |
334 EXPECT_EQ(body.axID(), event.update.nodes[0].id); | 336 EXPECT_EQ(body.axID(), event.update.nodes[0].id); |
335 EXPECT_EQ(text_1.axID(), event.update.nodes[1].id); | 337 EXPECT_EQ(text_1.axID(), event.update.nodes[1].id); |
336 // The third event is to update text_2, but its id changes | 338 // The third event is to update text_2, but its id changes |
337 // so we don't have a test expectation for it. | 339 // so we don't have a test expectation for it. |
338 } | 340 } |
339 | 341 |
340 } // namespace content | 342 } // namespace content |
OLD | NEW |