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/common/content_switches.h" |
9 #include "content/public/test/render_view_test.h" | 10 #include "content/public/test/render_view_test.h" |
10 #include "content/renderer/accessibility/renderer_accessibility.h" | 11 #include "content/renderer/accessibility/renderer_accessibility.h" |
11 #include "content/renderer/render_frame_impl.h" | 12 #include "content/renderer/render_frame_impl.h" |
12 #include "content/renderer/render_view_impl.h" | 13 #include "content/renderer/render_view_impl.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
14 #include "third_party/WebKit/public/platform/WebSize.h" | 15 #include "third_party/WebKit/public/platform/WebSize.h" |
15 #include "third_party/WebKit/public/web/WebAXObject.h" | 16 #include "third_party/WebKit/public/web/WebAXObject.h" |
16 #include "third_party/WebKit/public/web/WebDocument.h" | 17 #include "third_party/WebKit/public/web/WebDocument.h" |
17 #include "third_party/WebKit/public/web/WebView.h" | 18 #include "third_party/WebKit/public/web/WebView.h" |
18 #include "ui/accessibility/ax_node_data.h" | 19 #include "ui/accessibility/ax_node_data.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 #if defined(OS_ANDROID) | 150 #if defined(OS_ANDROID) |
150 #define MAYBE_AccessibilityMessagesQueueWhileSwappedOut \ | 151 #define MAYBE_AccessibilityMessagesQueueWhileSwappedOut \ |
151 DISABLED_AccessibilityMessagesQueueWhileSwappedOut | 152 DISABLED_AccessibilityMessagesQueueWhileSwappedOut |
152 #else | 153 #else |
153 #define MAYBE_AccessibilityMessagesQueueWhileSwappedOut \ | 154 #define MAYBE_AccessibilityMessagesQueueWhileSwappedOut \ |
154 AccessibilityMessagesQueueWhileSwappedOut | 155 AccessibilityMessagesQueueWhileSwappedOut |
155 #endif | 156 #endif |
156 | 157 |
157 TEST_F(RendererAccessibilityTest, | 158 TEST_F(RendererAccessibilityTest, |
158 MAYBE_AccessibilityMessagesQueueWhileSwappedOut) { | 159 MAYBE_AccessibilityMessagesQueueWhileSwappedOut) { |
| 160 // This test breaks down in --site-per-process, as swapping out destroys |
| 161 // the main frame and it cannot be further navigated. |
| 162 // TODO(nasko): Figure out what this behavior looks like when swapped out |
| 163 // no longer exists. |
| 164 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 165 switches::kSitePerProcess)) { |
| 166 return; |
| 167 } |
159 std::string html = | 168 std::string html = |
160 "<body>" | 169 "<body>" |
161 " <p>Hello, world.</p>" | 170 " <p>Hello, world.</p>" |
162 "</body>"; | 171 "</body>"; |
163 LoadHTML(html.c_str()); | 172 LoadHTML(html.c_str()); |
164 static const int kProxyRoutingId = 13; | 173 static const int kProxyRoutingId = 13; |
165 | 174 |
166 // Creating a RendererAccessibility should send the tree to the browser. | 175 // Creating a RendererAccessibility should send the tree to the browser. |
167 scoped_ptr<TestRendererAccessibility> accessibility( | 176 scoped_ptr<TestRendererAccessibility> accessibility( |
168 new TestRendererAccessibility(frame())); | 177 new TestRendererAccessibility(frame())); |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 | 412 |
404 const IPC::Message* message = | 413 const IPC::Message* message = |
405 sink_->GetUniqueMessageMatching(AccessibilityHostMsg_Events::ID); | 414 sink_->GetUniqueMessageMatching(AccessibilityHostMsg_Events::ID); |
406 ASSERT_TRUE(message); | 415 ASSERT_TRUE(message); |
407 base::Tuple<std::vector<AccessibilityHostMsg_EventParams>, int> param; | 416 base::Tuple<std::vector<AccessibilityHostMsg_EventParams>, int> param; |
408 AccessibilityHostMsg_Events::Read(message, ¶m); | 417 AccessibilityHostMsg_Events::Read(message, ¶m); |
409 ASSERT_EQ(0U, base::get<0>(param).size()); | 418 ASSERT_EQ(0U, base::get<0>(param).size()); |
410 } | 419 } |
411 | 420 |
412 } // namespace content | 421 } // namespace content |
OLD | NEW |