Index: content/browser/accessibility/cross_platform_accessibility_browsertest.cc |
=================================================================== |
--- content/browser/accessibility/cross_platform_accessibility_browsertest.cc (revision 148517) |
+++ content/browser/accessibility/cross_platform_accessibility_browsertest.cc (working copy) |
@@ -6,15 +6,15 @@ |
#include <vector> |
#include "base/utf_string_conversions.h" |
-#include "chrome/browser/ui/browser.h" |
-#include "chrome/browser/ui/browser_tabstrip.h" |
-#include "chrome/test/base/in_process_browser_test.h" |
#include "content/browser/renderer_host/render_view_host_impl.h" |
#include "content/public/browser/notification_service.h" |
#include "content/public/browser/notification_types.h" |
#include "content/public/browser/render_widget_host_view.h" |
#include "content/public/browser/web_contents.h" |
#include "content/public/test/test_utils.h" |
+#include "content/test/content_browser_test.h" |
+#include "content/test/content_browser_test_utils.h" |
+#include "content/shell/shell.h" |
#if defined(OS_WIN) |
#include <atlbase.h> |
@@ -22,15 +22,9 @@ |
#include "ui/base/win/atl_module.h" |
#endif |
-using content::AccessibilityNodeData; |
-using content::OpenURLParams; |
-using content::RenderViewHostImpl; |
-using content::RenderWidgetHostImpl; |
-using content::Referrer; |
+namespace content { |
-namespace { |
- |
-class CrossPlatformAccessibilityBrowserTest : public InProcessBrowserTest { |
+class CrossPlatformAccessibilityBrowserTest : public ContentBrowserTest { |
public: |
CrossPlatformAccessibilityBrowserTest() {} |
@@ -38,11 +32,11 @@ |
// notification that it's been received. |
const AccessibilityNodeData& GetAccessibilityNodeDataTree( |
AccessibilityMode accessibility_mode = AccessibilityModeComplete) { |
- content::WindowedNotificationObserver tree_updated_observer( |
- content::NOTIFICATION_RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED, |
- content::NotificationService::AllSources()); |
- content::RenderWidgetHostView* host_view = |
- chrome::GetActiveWebContents(browser())->GetRenderWidgetHostView(); |
+ WindowedNotificationObserver tree_updated_observer( |
+ NOTIFICATION_RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED, |
+ NotificationService::AllSources()); |
+ RenderWidgetHostView* host_view = |
+ shell()->web_contents()->GetRenderWidgetHostView(); |
RenderWidgetHostImpl* host = |
RenderWidgetHostImpl::From(host_view->GetRenderWidgetHost()); |
RenderViewHostImpl* view_host = static_cast<RenderViewHostImpl*>(host); |
@@ -61,9 +55,9 @@ |
RecursiveAssertUniqueIds(node.children[i], ids); |
} |
- // InProcessBrowserTest |
- void SetUpInProcessBrowserTestFixture(); |
- void TearDownInProcessBrowserTestFixture(); |
+ // ContentBrowserTest |
+ virtual void SetUpInProcessBrowserTestFixture() OVERRIDE; |
+ virtual void TearDownInProcessBrowserTestFixture() OVERRIDE; |
protected: |
std::string GetAttr(const AccessibilityNodeData& node, |
@@ -138,8 +132,7 @@ |
"<body><input type='button' value='push' /><input type='checkbox' />" |
"</body></html>"; |
GURL url(url_str); |
- browser()->OpenURL(OpenURLParams( |
- url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false)); |
+ NavigateToURL(shell(), url); |
const AccessibilityNodeData& tree = GetAccessibilityNodeDataTree(); |
// Check properties of the root element of the tree. |
@@ -206,8 +199,7 @@ |
"<input value=\"Hello, world.\"/>" |
"</body></html>"; |
GURL url(url_str); |
- browser()->OpenURL(OpenURLParams( |
- url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false)); |
+ NavigateToURL(shell(), url); |
const AccessibilityNodeData& tree = GetAccessibilityNodeDataTree(); |
ASSERT_EQ(1U, tree.children.size()); |
@@ -236,8 +228,7 @@ |
"<input value=\"Hello, world.\"/>" |
"</body></html>"; |
GURL url(url_str); |
- browser()->OpenURL(OpenURLParams( |
- url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false)); |
+ NavigateToURL(shell(), url); |
const AccessibilityNodeData& tree = GetAccessibilityNodeDataTree(); |
ASSERT_EQ(1U, tree.children.size()); |
@@ -264,8 +255,7 @@ |
"<!doctype html>" |
"<table border=1><tr><td>1</td><td>2</td></tr></table>"; |
GURL url(url_str); |
- browser()->OpenURL(OpenURLParams( |
- url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false)); |
+ NavigateToURL(shell(), url); |
const AccessibilityNodeData& tree = GetAccessibilityNodeDataTree(); |
ASSERT_EQ(1U, tree.children.size()); |
@@ -304,8 +294,7 @@ |
" }, 1);\n" |
"</script>"; |
GURL url(url_str); |
- browser()->OpenURL(OpenURLParams( |
- url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false)); |
+ NavigateToURL(shell(), url); |
const AccessibilityNodeData& tree = GetAccessibilityNodeDataTree(); |
base::hash_set<int> ids; |
@@ -325,8 +314,7 @@ |
"<button>Button 3</button>" |
"</body></html>"; |
GURL url(url_str); |
- browser()->OpenURL(OpenURLParams( |
- url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false)); |
+ NavigateToURL(shell(), url); |
const AccessibilityNodeData& tree = GetAccessibilityNodeDataTree(); |
ASSERT_EQ(1U, tree.children.size()); |
@@ -372,8 +360,7 @@ |
"<!doctype html>" |
"<em><code ><h4 ></em>"; |
GURL url(url_str); |
- browser()->OpenURL(OpenURLParams( |
- url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false)); |
+ NavigateToURL(shell(), url); |
const AccessibilityNodeData& tree = GetAccessibilityNodeDataTree(); |
base::hash_set<int> ids; |
@@ -400,8 +387,7 @@ |
" </tr>" |
"</table>"; |
GURL url(url_str); |
- browser()->OpenURL(OpenURLParams( |
- url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false)); |
+ NavigateToURL(shell(), url); |
const AccessibilityNodeData& tree = GetAccessibilityNodeDataTree(); |
const AccessibilityNodeData& table = tree.children[0]; |
@@ -460,8 +446,7 @@ |
" Some text" |
"</div>"; |
GURL url(url_str); |
- browser()->OpenURL(OpenURLParams( |
- url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false)); |
+ NavigateToURL(shell(), url); |
const AccessibilityNodeData& tree = GetAccessibilityNodeDataTree(); |
ASSERT_EQ(1U, tree.children.size()); |
@@ -471,4 +456,4 @@ |
true, GetBoolAttr(textbox, AccessibilityNodeData::ATTR_CAN_SET_VALUE)); |
} |
-} // namespace |
+} // namespace content |