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

Side by Side Diff: content/browser/accessibility/cross_platform_accessibility_browsertest.cc

Issue 10807047: Create content\public\test\test_utils.h to hold common test classes that are used by unit and brows… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 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 | Annotate | Revision Log
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 <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/browser_tabstrip.h" 10 #include "chrome/browser/ui/browser_tabstrip.h"
11 #include "chrome/test/base/in_process_browser_test.h" 11 #include "chrome/test/base/in_process_browser_test.h"
12 #include "chrome/test/base/ui_test_utils.h"
13 #include "content/browser/renderer_host/render_view_host_impl.h" 12 #include "content/browser/renderer_host/render_view_host_impl.h"
14 #include "content/public/browser/notification_service.h" 13 #include "content/public/browser/notification_service.h"
15 #include "content/public/browser/notification_types.h" 14 #include "content/public/browser/notification_types.h"
16 #include "content/public/browser/render_widget_host_view.h" 15 #include "content/public/browser/render_widget_host_view.h"
17 #include "content/public/browser/web_contents.h" 16 #include "content/public/browser/web_contents.h"
17 #include "content/public/test/test_utils.h"
18 18
19 #if defined(OS_WIN) 19 #if defined(OS_WIN)
20 #include <atlbase.h> 20 #include <atlbase.h>
21 #include <atlcom.h> 21 #include <atlcom.h>
22 #include "ui/base/win/atl_module.h" 22 #include "ui/base/win/atl_module.h"
23 #endif 23 #endif
24 24
25 using content::AccessibilityNodeData; 25 using content::AccessibilityNodeData;
26 using content::OpenURLParams; 26 using content::OpenURLParams;
27 using content::RenderViewHostImpl; 27 using content::RenderViewHostImpl;
28 using content::RenderWidgetHostImpl; 28 using content::RenderWidgetHostImpl;
29 using content::Referrer; 29 using content::Referrer;
30 30
31 namespace { 31 namespace {
32 32
33 class CrossPlatformAccessibilityBrowserTest : public InProcessBrowserTest { 33 class CrossPlatformAccessibilityBrowserTest : public InProcessBrowserTest {
34 public: 34 public:
35 CrossPlatformAccessibilityBrowserTest() {} 35 CrossPlatformAccessibilityBrowserTest() {}
36 36
37 // Tell the renderer to send an accessibility tree, then wait for the 37 // Tell the renderer to send an accessibility tree, then wait for the
38 // notification that it's been received. 38 // notification that it's been received.
39 const AccessibilityNodeData& GetAccessibilityNodeDataTree( 39 const AccessibilityNodeData& GetAccessibilityNodeDataTree(
40 AccessibilityMode accessibility_mode = AccessibilityModeComplete) { 40 AccessibilityMode accessibility_mode = AccessibilityModeComplete) {
41 ui_test_utils::WindowedNotificationObserver tree_updated_observer( 41 content::WindowedNotificationObserver tree_updated_observer(
42 content::NOTIFICATION_RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED, 42 content::NOTIFICATION_RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED,
43 content::NotificationService::AllSources()); 43 content::NotificationService::AllSources());
44 content::RenderWidgetHostView* host_view = 44 content::RenderWidgetHostView* host_view =
45 chrome::GetActiveWebContents(browser())->GetRenderWidgetHostView(); 45 chrome::GetActiveWebContents(browser())->GetRenderWidgetHostView();
46 RenderWidgetHostImpl* host = 46 RenderWidgetHostImpl* host =
47 RenderWidgetHostImpl::From(host_view->GetRenderWidgetHost()); 47 RenderWidgetHostImpl::From(host_view->GetRenderWidgetHost());
48 RenderViewHostImpl* view_host = static_cast<RenderViewHostImpl*>(host); 48 RenderViewHostImpl* view_host = static_cast<RenderViewHostImpl*>(host);
49 view_host->set_save_accessibility_tree_for_testing(true); 49 view_host->set_save_accessibility_tree_for_testing(true);
50 view_host->SetAccessibilityMode(accessibility_mode); 50 view_host->SetAccessibilityMode(accessibility_mode);
51 tree_updated_observer.Wait(); 51 tree_updated_observer.Wait();
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 const AccessibilityNodeData& tree = GetAccessibilityNodeDataTree(); 465 const AccessibilityNodeData& tree = GetAccessibilityNodeDataTree();
466 466
467 ASSERT_EQ(1U, tree.children.size()); 467 ASSERT_EQ(1U, tree.children.size());
468 const AccessibilityNodeData& textbox = tree.children[0]; 468 const AccessibilityNodeData& textbox = tree.children[0];
469 469
470 EXPECT_EQ( 470 EXPECT_EQ(
471 true, GetBoolAttr(textbox, AccessibilityNodeData::ATTR_CAN_SET_VALUE)); 471 true, GetBoolAttr(textbox, AccessibilityNodeData::ATTR_CAN_SET_VALUE));
472 } 472 }
473 473
474 } // namespace 474 } // namespace
OLDNEW
« no previous file with comments | « chrome/test/perf/rendering/throughput_tests.cc ('k') | content/browser/accessibility/dump_accessibility_tree_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698