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

Side by Side Diff: chrome/browser/extensions/api/automation/automation_apitest.cc

Issue 273423004: Migrate accessibility from RenderView to RenderFrame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix win & android compile Created 6 years, 7 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/files/file_path.h" 5 #include "base/files/file_path.h"
6 #include "base/path_service.h" 6 #include "base/path_service.h"
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "chrome/browser/extensions/extension_apitest.h" 8 #include "chrome/browser/extensions/extension_apitest.h"
9 #include "chrome/browser/extensions/extension_test_message_listener.h" 9 #include "chrome/browser/extensions/extension_test_message_listener.h"
10 #include "chrome/browser/ui/tabs/tab_strip_model.h" 10 #include "chrome/browser/ui/tabs/tab_strip_model.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); 59 ExtensionApiTest::SetUpInProcessBrowserTestFixture();
60 } 60 }
61 }; 61 };
62 62
63 IN_PROC_BROWSER_TEST_F(AutomationApiTest, TestRendererAccessibilityEnabled) { 63 IN_PROC_BROWSER_TEST_F(AutomationApiTest, TestRendererAccessibilityEnabled) {
64 LoadPage(); 64 LoadPage();
65 65
66 ASSERT_EQ(1, browser()->tab_strip_model()->count()); 66 ASSERT_EQ(1, browser()->tab_strip_model()->count());
67 content::WebContents* const tab = 67 content::WebContents* const tab =
68 browser()->tab_strip_model()->GetWebContentsAt(0); 68 browser()->tab_strip_model()->GetWebContentsAt(0);
69 content::RenderWidgetHost* rwh = 69 ASSERT_FALSE(tab->IsFullAccessibilityModeForTesting());
70 tab->GetRenderWidgetHostView()->GetRenderWidgetHost(); 70 ASSERT_FALSE(tab->IsTreeOnlyAccessibilityModeForTesting());
71 ASSERT_NE((content::RenderWidgetHost*)NULL, rwh)
72 << "Couldn't get RenderWidgetHost";
73 ASSERT_FALSE(rwh->IsFullAccessibilityModeForTesting());
74 ASSERT_FALSE(rwh->IsTreeOnlyAccessibilityModeForTesting());
75 71
76 base::FilePath extension_path = 72 base::FilePath extension_path =
77 test_data_dir_.AppendASCII("automation/basic"); 73 test_data_dir_.AppendASCII("automation/basic");
78 ExtensionTestMessageListener got_tree(kGotTree, false /* no reply */); 74 ExtensionTestMessageListener got_tree(kGotTree, false /* no reply */);
79 LoadExtension(extension_path); 75 LoadExtension(extension_path);
80 ASSERT_TRUE(got_tree.WaitUntilSatisfied()); 76 ASSERT_TRUE(got_tree.WaitUntilSatisfied());
81 77
82 rwh = tab->GetRenderWidgetHostView()->GetRenderWidgetHost(); 78 ASSERT_FALSE(tab->IsFullAccessibilityModeForTesting());
83 ASSERT_NE((content::RenderWidgetHost*)NULL, rwh) 79 ASSERT_TRUE(tab->IsTreeOnlyAccessibilityModeForTesting());
84 << "Couldn't get RenderWidgetHost";
85 ASSERT_FALSE(rwh->IsFullAccessibilityModeForTesting());
86 ASSERT_TRUE(rwh->IsTreeOnlyAccessibilityModeForTesting());
87 } 80 }
88 81
89 // TODO(dtseng): See crbug.com/360297. 82 // TODO(dtseng): See crbug.com/360297.
90 #if defined(OS_MACOSX) 83 #if defined(OS_MACOSX)
91 #define MAYBE_SanityCheck DISABLED_SanityCheck 84 #define MAYBE_SanityCheck DISABLED_SanityCheck
92 #else 85 #else
93 #define MAYBE_SanityCheck SanityCheck 86 #define MAYBE_SanityCheck SanityCheck
94 #endif // defined(OS_MACOSX) 87 #endif // defined(OS_MACOSX)
95 IN_PROC_BROWSER_TEST_F(AutomationApiTest, MAYBE_SanityCheck) { 88 IN_PROC_BROWSER_TEST_F(AutomationApiTest, MAYBE_SanityCheck) {
96 StartEmbeddedTestServer(); 89 StartEmbeddedTestServer();
(...skipping 30 matching lines...) Expand all
127 "desktop_not_requested.html")) << message_; 120 "desktop_not_requested.html")) << message_;
128 } 121 }
129 #else 122 #else
130 IN_PROC_BROWSER_TEST_F(AutomationApiTest, DesktopNotSupported) { 123 IN_PROC_BROWSER_TEST_F(AutomationApiTest, DesktopNotSupported) {
131 ASSERT_TRUE(RunExtensionSubtest("automation/tests/desktop", 124 ASSERT_TRUE(RunExtensionSubtest("automation/tests/desktop",
132 "desktop_not_supported.html")) << message_; 125 "desktop_not_supported.html")) << message_;
133 } 126 }
134 #endif 127 #endif
135 128
136 } // namespace extensions 129 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698