OLD | NEW |
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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); | 64 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); |
65 } | 65 } |
66 }; | 66 }; |
67 | 67 |
68 IN_PROC_BROWSER_TEST_F(AutomationApiTest, TestRendererAccessibilityEnabled) { | 68 IN_PROC_BROWSER_TEST_F(AutomationApiTest, TestRendererAccessibilityEnabled) { |
69 LoadPage(); | 69 LoadPage(); |
70 | 70 |
71 ASSERT_EQ(1, browser()->tab_strip_model()->count()); | 71 ASSERT_EQ(1, browser()->tab_strip_model()->count()); |
72 content::WebContents* const tab = | 72 content::WebContents* const tab = |
73 browser()->tab_strip_model()->GetWebContentsAt(0); | 73 browser()->tab_strip_model()->GetWebContentsAt(0); |
74 content::RenderWidgetHost* rwh = | 74 ASSERT_FALSE(tab->IsFullAccessibilityModeForTesting()); |
75 tab->GetRenderWidgetHostView()->GetRenderWidgetHost(); | 75 ASSERT_FALSE(tab->IsTreeOnlyAccessibilityModeForTesting()); |
76 ASSERT_NE((content::RenderWidgetHost*)NULL, rwh) | |
77 << "Couldn't get RenderWidgetHost"; | |
78 ASSERT_FALSE(rwh->IsFullAccessibilityModeForTesting()); | |
79 ASSERT_FALSE(rwh->IsTreeOnlyAccessibilityModeForTesting()); | |
80 | 76 |
81 base::FilePath extension_path = | 77 base::FilePath extension_path = |
82 test_data_dir_.AppendASCII("automation/basic"); | 78 test_data_dir_.AppendASCII("automation/basic"); |
83 ExtensionTestMessageListener got_tree(kGotTree, false /* no reply */); | 79 ExtensionTestMessageListener got_tree(kGotTree, false /* no reply */); |
84 LoadExtension(extension_path); | 80 LoadExtension(extension_path); |
85 ASSERT_TRUE(got_tree.WaitUntilSatisfied()); | 81 ASSERT_TRUE(got_tree.WaitUntilSatisfied()); |
86 | 82 |
87 rwh = tab->GetRenderWidgetHostView()->GetRenderWidgetHost(); | 83 ASSERT_FALSE(tab->IsFullAccessibilityModeForTesting()); |
88 ASSERT_NE((content::RenderWidgetHost*)NULL, rwh) | 84 ASSERT_TRUE(tab->IsTreeOnlyAccessibilityModeForTesting()); |
89 << "Couldn't get RenderWidgetHost"; | |
90 ASSERT_FALSE(rwh->IsFullAccessibilityModeForTesting()); | |
91 ASSERT_TRUE(rwh->IsTreeOnlyAccessibilityModeForTesting()); | |
92 } | 85 } |
93 | 86 |
94 // TODO(dtseng): See crbug.com/360297. | 87 // TODO(dtseng): See crbug.com/360297. |
95 #if defined(OS_MACOSX) | 88 #if defined(OS_MACOSX) |
96 #define MAYBE_SanityCheck DISABLED_SanityCheck | 89 #define MAYBE_SanityCheck DISABLED_SanityCheck |
97 #else | 90 #else |
98 #define MAYBE_SanityCheck SanityCheck | 91 #define MAYBE_SanityCheck SanityCheck |
99 #endif // defined(OS_MACOSX) | 92 #endif // defined(OS_MACOSX) |
100 IN_PROC_BROWSER_TEST_F(AutomationApiTest, MAYBE_SanityCheck) { | 93 IN_PROC_BROWSER_TEST_F(AutomationApiTest, MAYBE_SanityCheck) { |
101 StartEmbeddedTestServer(); | 94 StartEmbeddedTestServer(); |
(...skipping 20 matching lines...) Expand all Loading... |
122 } | 115 } |
123 | 116 |
124 #if defined(OS_CHROMEOS) | 117 #if defined(OS_CHROMEOS) |
125 IN_PROC_BROWSER_TEST_F(AutomationApiTest, Desktop) { | 118 IN_PROC_BROWSER_TEST_F(AutomationApiTest, Desktop) { |
126 ASSERT_TRUE(RunExtensionSubtest("automation/tests/desktop", "desktop.html")) | 119 ASSERT_TRUE(RunExtensionSubtest("automation/tests/desktop", "desktop.html")) |
127 << message_; | 120 << message_; |
128 } | 121 } |
129 #endif | 122 #endif |
130 | 123 |
131 } // namespace extensions | 124 } // namespace extensions |
OLD | NEW |