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/api/automation_internal/automation_util.h" | 8 #include "chrome/browser/extensions/api/automation_internal/automation_util.h" |
9 #include "chrome/browser/extensions/chrome_extension_function.h" | 9 #include "chrome/browser/extensions/chrome_extension_function.h" |
10 #include "chrome/browser/extensions/extension_apitest.h" | 10 #include "chrome/browser/extensions/extension_apitest.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); | 68 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); |
69 } | 69 } |
70 }; | 70 }; |
71 | 71 |
72 IN_PROC_BROWSER_TEST_F(AutomationApiTest, TestRendererAccessibilityEnabled) { | 72 IN_PROC_BROWSER_TEST_F(AutomationApiTest, TestRendererAccessibilityEnabled) { |
73 LoadPage(); | 73 LoadPage(); |
74 | 74 |
75 ASSERT_EQ(1, browser()->tab_strip_model()->count()); | 75 ASSERT_EQ(1, browser()->tab_strip_model()->count()); |
76 content::WebContents* const tab = | 76 content::WebContents* const tab = |
77 browser()->tab_strip_model()->GetWebContentsAt(0); | 77 browser()->tab_strip_model()->GetWebContentsAt(0); |
78 ASSERT_FALSE(tab->IsFullAccessibilityModeForTesting()); | 78 content::RenderWidgetHost* rwh = |
79 ASSERT_FALSE(tab->IsTreeOnlyAccessibilityModeForTesting()); | 79 tab->GetRenderWidgetHostView()->GetRenderWidgetHost(); |
| 80 ASSERT_NE((content::RenderWidgetHost*)NULL, rwh) |
| 81 << "Couldn't get RenderWidgetHost"; |
| 82 ASSERT_FALSE(rwh->IsFullAccessibilityModeForTesting()); |
| 83 ASSERT_FALSE(rwh->IsTreeOnlyAccessibilityModeForTesting()); |
80 | 84 |
81 base::FilePath extension_path = | 85 base::FilePath extension_path = |
82 test_data_dir_.AppendASCII("automation/tests/basic"); | 86 test_data_dir_.AppendASCII("automation/tests/basic"); |
83 ExtensionTestMessageListener got_tree(kGotTree, false /* no reply */); | 87 ExtensionTestMessageListener got_tree(kGotTree, false /* no reply */); |
84 LoadExtension(extension_path); | 88 LoadExtension(extension_path); |
85 ASSERT_TRUE(got_tree.WaitUntilSatisfied()); | 89 ASSERT_TRUE(got_tree.WaitUntilSatisfied()); |
86 | 90 |
87 ASSERT_FALSE(tab->IsFullAccessibilityModeForTesting()); | 91 rwh = tab->GetRenderWidgetHostView()->GetRenderWidgetHost(); |
88 ASSERT_TRUE(tab->IsTreeOnlyAccessibilityModeForTesting()); | 92 ASSERT_NE((content::RenderWidgetHost*)NULL, rwh) |
| 93 << "Couldn't get RenderWidgetHost"; |
| 94 ASSERT_FALSE(rwh->IsFullAccessibilityModeForTesting()); |
| 95 ASSERT_TRUE(rwh->IsTreeOnlyAccessibilityModeForTesting()); |
89 } | 96 } |
90 | 97 |
91 #if defined(ADDRESS_SANITIZER) | 98 #if defined(ADDRESS_SANITIZER) |
92 #define Maybe_SanityCheck DISABLED_SanityCheck | 99 #define Maybe_SanityCheck DISABLED_SanityCheck |
93 #else | 100 #else |
94 #define Maybe_SanityCheck SanityCheck | 101 #define Maybe_SanityCheck SanityCheck |
95 #endif | 102 #endif |
96 IN_PROC_BROWSER_TEST_F(AutomationApiTest, Maybe_SanityCheck) { | 103 IN_PROC_BROWSER_TEST_F(AutomationApiTest, Maybe_SanityCheck) { |
97 StartEmbeddedTestServer(); | 104 StartEmbeddedTestServer(); |
98 ASSERT_TRUE(RunExtensionSubtest("automation/tests/tabs", "sanity_check.html")) | 105 ASSERT_TRUE(RunExtensionSubtest("automation/tests/tabs", "sanity_check.html")) |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 "automationInternal.enableTab", | 528 "automationInternal.enableTab", |
522 FakeAutomationInternalEnableTabFunctionFactory)); | 529 FakeAutomationInternalEnableTabFunctionFactory)); |
523 ASSERT_TRUE(extensions::ExtensionFunctionDispatcher::OverrideFunction( | 530 ASSERT_TRUE(extensions::ExtensionFunctionDispatcher::OverrideFunction( |
524 "automationInternal.performAction", | 531 "automationInternal.performAction", |
525 FakeAutomationInternalPerformActionFunctionFactory)); | 532 FakeAutomationInternalPerformActionFunctionFactory)); |
526 ASSERT_TRUE(RunExtensionSubtest("automation/tests/generated", | 533 ASSERT_TRUE(RunExtensionSubtest("automation/tests/generated", |
527 "generated_trees.html")) << message_; | 534 "generated_trees.html")) << message_; |
528 } | 535 } |
529 | 536 |
530 } // namespace extensions | 537 } // namespace extensions |
OLD | NEW |