Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1790)

Side by Side Diff: content/renderer/accessibility/renderer_accessibility_browsertest.cc

Issue 15741009: Native Android accessibility. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/accessibility_node_data.h" 6 #include "content/common/accessibility_node_data.h"
7 #include "content/common/view_messages.h" 7 #include "content/common/view_messages.h"
8 #include "content/public/test/render_view_test.h" 8 #include "content/public/test/render_view_test.h"
9 #include "content/renderer/accessibility/renderer_accessibility_complete.h" 9 #include "content/renderer/accessibility/renderer_accessibility_complete.h"
10 #include "content/renderer/render_view_impl.h" 10 #include "content/renderer/render_view_impl.h"
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 sink_->ClearMessages(); 303 sink_->ClearMessages();
304 const WebAccessibilityObject& first_child = root_obj.childAt(0); 304 const WebAccessibilityObject& first_child = root_obj.childAt(0);
305 accessibility->HandleWebAccessibilityNotification( 305 accessibility->HandleWebAccessibilityNotification(
306 first_child, 306 first_child,
307 WebKit::WebAccessibilityNotificationLiveRegionChanged); 307 WebKit::WebAccessibilityNotificationLiveRegionChanged);
308 accessibility->SendPendingAccessibilityNotifications(); 308 accessibility->SendPendingAccessibilityNotifications();
309 EXPECT_EQ(4, accessibility->browser_tree_node_count()); 309 EXPECT_EQ(4, accessibility->browser_tree_node_count());
310 EXPECT_EQ(4, CountAccessibilityNodesSentToBrowser()); 310 EXPECT_EQ(4, CountAccessibilityNodesSentToBrowser());
311 } 311 }
312 312
313 TEST_F(RendererAccessibilityTest, AccessibilityMessagesQueueWhileSwappedOut) { 313 // http://crbug.com/253537
314 #if defined(OS_ANDROID)
315 #define MAYBE_AccessibilityMessagesQueueWhileSwappedOut \
316 DISABLED_AccessibilityMessagesQueueWhileSwappedOut
317 #else
318 #define MAYBE_AccessibilityMessagesQueueWhileSwappedOut \
319 AccessibilityMessagesQueueWhileSwappedOut
320 #endif
321
322 TEST_F(RendererAccessibilityTest,
323 MAYBE_AccessibilityMessagesQueueWhileSwappedOut) {
314 std::string html = 324 std::string html =
315 "<body>" 325 "<body>"
316 " <p>Hello, world.</p>" 326 " <p>Hello, world.</p>"
317 "</body>"; 327 "</body>";
318 LoadHTML(html.c_str()); 328 LoadHTML(html.c_str());
319 329
320 // Creating a RendererAccessibilityComplete should send the tree 330 // Creating a RendererAccessibilityComplete should send the tree
321 // to the browser. 331 // to the browser.
322 scoped_ptr<TestRendererAccessibilityComplete> accessibility( 332 scoped_ptr<TestRendererAccessibilityComplete> accessibility(
323 new TestRendererAccessibilityComplete(view())); 333 new TestRendererAccessibilityComplete(view()));
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 459
450 accessibility->SendPendingAccessibilityNotifications(); 460 accessibility->SendPendingAccessibilityNotifications();
451 EXPECT_EQ(4, accessibility->browser_tree_node_count()); 461 EXPECT_EQ(4, accessibility->browser_tree_node_count());
452 AccessibilityHostMsg_NotificationParams notification; 462 AccessibilityHostMsg_NotificationParams notification;
453 GetLastAccNotification(&notification); 463 GetLastAccNotification(&notification);
454 ASSERT_EQ(3U, notification.nodes.size()); 464 ASSERT_EQ(3U, notification.nodes.size());
455 EXPECT_EQ(3, CountAccessibilityNodesSentToBrowser()); 465 EXPECT_EQ(3, CountAccessibilityNodesSentToBrowser());
456 } 466 }
457 467
458 } // namespace content 468 } // namespace content
OLDNEW
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/accessibility/JellyBeanBrowserAccessibilityManager.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698