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