OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <set> | 5 #include <set> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 void SetUpCommandLine(base::CommandLine* command_line) override { | 59 void SetUpCommandLine(base::CommandLine* command_line) override { |
60 ContentBrowserTest::SetUpCommandLine(command_line); | 60 ContentBrowserTest::SetUpCommandLine(command_line); |
61 // Enable <dialog>, which is used in some tests. | 61 // Enable <dialog>, which is used in some tests. |
62 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 62 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
63 switches::kEnableExperimentalWebPlatformFeatures); | 63 switches::kEnableExperimentalWebPlatformFeatures); |
64 } | 64 } |
65 | 65 |
66 void RunAriaTest(const base::FilePath::CharType* file_path) { | 66 void RunAriaTest(const base::FilePath::CharType* file_path) { |
67 base::FilePath dir_test_data; | 67 base::FilePath dir_test_data; |
68 ASSERT_TRUE(PathService::Get(DIR_TEST_DATA, &dir_test_data)); | 68 ASSERT_TRUE(PathService::Get(DIR_TEST_DATA, &dir_test_data)); |
69 base::FilePath test_path( | 69 base::FilePath test_path(dir_test_data.AppendASCII("accessibility") |
70 dir_test_data.AppendASCII("accessibility/aria")); | 70 .AppendASCII("aria")); |
71 ASSERT_TRUE(base::PathExists(test_path)) | 71 ASSERT_TRUE(base::PathExists(test_path)) << test_path.LossyDisplayName(); |
72 << test_path.LossyDisplayName(); | |
73 | 72 |
74 base::FilePath aria_file = test_path.Append(base::FilePath(file_path)); | 73 base::FilePath aria_file = test_path.Append(base::FilePath(file_path)); |
75 RunTest(aria_file, "accessibility/aria"); | 74 RunTest(aria_file, "accessibility/aria"); |
76 } | 75 } |
77 | 76 |
78 void RunHtmlTest(const base::FilePath::CharType* file_path) { | 77 void RunHtmlTest(const base::FilePath::CharType* file_path) { |
79 base::FilePath dir_test_data; | 78 base::FilePath dir_test_data; |
80 ASSERT_TRUE(PathService::Get(DIR_TEST_DATA, &dir_test_data)); | 79 ASSERT_TRUE(PathService::Get(DIR_TEST_DATA, &dir_test_data)); |
81 base::FilePath test_path( | 80 base::FilePath test_path(dir_test_data.AppendASCII("accessibility") |
82 dir_test_data.AppendASCII("accessibility/html")); | 81 .AppendASCII("html")); |
83 ASSERT_TRUE(base::PathExists(test_path)) | 82 ASSERT_TRUE(base::PathExists(test_path)) << test_path.LossyDisplayName(); |
84 << test_path.LossyDisplayName(); | |
85 | 83 |
86 base::FilePath html_file = test_path.Append(base::FilePath(file_path)); | 84 base::FilePath html_file = test_path.Append(base::FilePath(file_path)); |
87 RunTest(html_file, "accessibility/html"); | 85 RunTest(html_file, "accessibility/html"); |
88 } | 86 } |
89 | 87 |
90 std::vector<std::string> Dump() override { | 88 std::vector<std::string> Dump() override { |
91 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( | 89 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( |
92 shell()->web_contents()); | 90 shell()->web_contents()); |
93 AccessibilityTreeFormatter formatter( | 91 AccessibilityTreeFormatter formatter( |
94 web_contents->GetRootBrowserAccessibilityManager()->GetRoot()); | 92 web_contents->GetRootBrowserAccessibilityManager()->GetRoot()); |
(...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1000 | 998 |
1001 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityVar) { | 999 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityVar) { |
1002 RunHtmlTest(FILE_PATH_LITERAL("var.html")); | 1000 RunHtmlTest(FILE_PATH_LITERAL("var.html")); |
1003 } | 1001 } |
1004 | 1002 |
1005 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityWbr) { | 1003 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityWbr) { |
1006 RunHtmlTest(FILE_PATH_LITERAL("wbr.html")); | 1004 RunHtmlTest(FILE_PATH_LITERAL("wbr.html")); |
1007 } | 1005 } |
1008 | 1006 |
1009 } // namespace content | 1007 } // namespace content |
OLD | NEW |