| 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/location.h" | 6 #include "base/location.h" |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "net/test/embedded_test_server/embedded_test_server.h" | 27 #include "net/test/embedded_test_server/embedded_test_server.h" |
| 28 #include "testing/gtest/include/gtest/gtest.h" | 28 #include "testing/gtest/include/gtest/gtest.h" |
| 29 #include "ui/accessibility/ax_node.h" | 29 #include "ui/accessibility/ax_node.h" |
| 30 #include "ui/accessibility/ax_serializable_tree.h" | 30 #include "ui/accessibility/ax_serializable_tree.h" |
| 31 #include "ui/accessibility/ax_tree.h" | 31 #include "ui/accessibility/ax_tree.h" |
| 32 #include "ui/accessibility/ax_tree_serializer.h" | 32 #include "ui/accessibility/ax_tree_serializer.h" |
| 33 #include "ui/accessibility/tree_generator.h" | 33 #include "ui/accessibility/tree_generator.h" |
| 34 | 34 |
| 35 #if defined(OS_CHROMEOS) | 35 #if defined(OS_CHROMEOS) |
| 36 #include "ash/common/accelerators/accelerator_controller.h" | 36 #include "ash/common/accelerators/accelerator_controller.h" |
| 37 #include "ash/common/wm_shell.h" | 37 #include "ash/shell.h" |
| 38 #include "chrome/browser/ui/aura/accessibility/automation_manager_aura.h" | 38 #include "chrome/browser/ui/aura/accessibility/automation_manager_aura.h" |
| 39 #endif | 39 #endif |
| 40 | 40 |
| 41 namespace extensions { | 41 namespace extensions { |
| 42 | 42 |
| 43 namespace { | 43 namespace { |
| 44 static const char kDomain[] = "a.com"; | 44 static const char kDomain[] = "a.com"; |
| 45 static const char kSitesDir[] = "automation/sites"; | 45 static const char kSitesDir[] = "automation/sites"; |
| 46 static const char kGotTree[] = "got_tree"; | 46 static const char kGotTree[] = "got_tree"; |
| 47 } // anonymous namespace | 47 } // anonymous namespace |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 IN_PROC_BROWSER_TEST_F(AutomationApiTest, DesktopFocusIframe) { | 196 IN_PROC_BROWSER_TEST_F(AutomationApiTest, DesktopFocusIframe) { |
| 197 StartEmbeddedTestServer(); | 197 StartEmbeddedTestServer(); |
| 198 ASSERT_TRUE( | 198 ASSERT_TRUE( |
| 199 RunExtensionSubtest("automation/tests/desktop", "focus_iframe.html")) | 199 RunExtensionSubtest("automation/tests/desktop", "focus_iframe.html")) |
| 200 << message_; | 200 << message_; |
| 201 } | 201 } |
| 202 | 202 |
| 203 IN_PROC_BROWSER_TEST_F(AutomationApiTest, DesktopFocusViews) { | 203 IN_PROC_BROWSER_TEST_F(AutomationApiTest, DesktopFocusViews) { |
| 204 AutomationManagerAura::GetInstance()->Enable(browser()->profile()); | 204 AutomationManagerAura::GetInstance()->Enable(browser()->profile()); |
| 205 // Trigger the shelf subtree to be computed. | 205 // Trigger the shelf subtree to be computed. |
| 206 ash::WmShell::Get()->accelerator_controller()->PerformActionIfEnabled( | 206 ash::Shell::Get()->accelerator_controller()->PerformActionIfEnabled( |
| 207 ash::FOCUS_SHELF); | 207 ash::FOCUS_SHELF); |
| 208 | 208 |
| 209 ASSERT_TRUE( | 209 ASSERT_TRUE( |
| 210 RunExtensionSubtest("automation/tests/desktop", "focus_views.html")) | 210 RunExtensionSubtest("automation/tests/desktop", "focus_views.html")) |
| 211 << message_; | 211 << message_; |
| 212 } | 212 } |
| 213 #endif | 213 #endif |
| 214 | 214 |
| 215 IN_PROC_BROWSER_TEST_F(AutomationApiTest, DesktopNotRequested) { | 215 IN_PROC_BROWSER_TEST_F(AutomationApiTest, DesktopNotRequested) { |
| 216 ASSERT_TRUE(RunExtensionSubtest("automation/tests/tabs", | 216 ASSERT_TRUE(RunExtensionSubtest("automation/tests/tabs", |
| 217 "desktop_not_requested.html")) << message_; | 217 "desktop_not_requested.html")) << message_; |
| 218 } | 218 } |
| 219 | 219 |
| 220 #if defined(OS_CHROMEOS) | 220 #if defined(OS_CHROMEOS) |
| 221 IN_PROC_BROWSER_TEST_F(AutomationApiTest, DesktopActions) { | 221 IN_PROC_BROWSER_TEST_F(AutomationApiTest, DesktopActions) { |
| 222 AutomationManagerAura::GetInstance()->Enable(browser()->profile()); | 222 AutomationManagerAura::GetInstance()->Enable(browser()->profile()); |
| 223 // Trigger the shelf subtree to be computed. | 223 // Trigger the shelf subtree to be computed. |
| 224 ash::WmShell::Get()->accelerator_controller()->PerformActionIfEnabled( | 224 ash::Shell::Get()->accelerator_controller()->PerformActionIfEnabled( |
| 225 ash::FOCUS_SHELF); | 225 ash::FOCUS_SHELF); |
| 226 | 226 |
| 227 ASSERT_TRUE(RunExtensionSubtest("automation/tests/desktop", "actions.html")) | 227 ASSERT_TRUE(RunExtensionSubtest("automation/tests/desktop", "actions.html")) |
| 228 << message_; | 228 << message_; |
| 229 } | 229 } |
| 230 | 230 |
| 231 // Flaky, see http://crbug.com/435449 | 231 // Flaky, see http://crbug.com/435449 |
| 232 IN_PROC_BROWSER_TEST_F(AutomationApiTest, DISABLED_DesktopLoadTabs) { | 232 IN_PROC_BROWSER_TEST_F(AutomationApiTest, DISABLED_DesktopLoadTabs) { |
| 233 ASSERT_TRUE(RunExtensionSubtest("automation/tests/desktop", "load_tabs.html")) | 233 ASSERT_TRUE(RunExtensionSubtest("automation/tests/desktop", "load_tabs.html")) |
| 234 << message_; | 234 << message_; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 } | 274 } |
| 275 | 275 |
| 276 IN_PROC_BROWSER_TEST_F(AutomationApiTest, DocumentSelection) { | 276 IN_PROC_BROWSER_TEST_F(AutomationApiTest, DocumentSelection) { |
| 277 StartEmbeddedTestServer(); | 277 StartEmbeddedTestServer(); |
| 278 ASSERT_TRUE( | 278 ASSERT_TRUE( |
| 279 RunExtensionSubtest("automation/tests/tabs", "document_selection.html")) | 279 RunExtensionSubtest("automation/tests/tabs", "document_selection.html")) |
| 280 << message_; | 280 << message_; |
| 281 } | 281 } |
| 282 | 282 |
| 283 } // namespace extensions | 283 } // namespace extensions |
| OLD | NEW |