Chromium Code Reviews| 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 event_file = test_path.Append(base::FilePath(file_path)); |
|
dmazzoni
2015/01/14 18:13:53
nit: this should be aria_file, not event_file
| |
| 75 RunTest(aria_file, "accessibility/aria"); | 74 RunTest(event_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 event_file = test_path.Append(base::FilePath(file_path)); |
|
dmazzoni
2015/01/14 18:13:53
should be html_file
| |
| 87 RunTest(html_file, "accessibility/html"); | 85 RunTest(event_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()); |
| 95 formatter.SetFilters(filters_); | 93 formatter.SetFilters(filters_); |
| 96 base::string16 actual_contents_utf16; | 94 base::string16 actual_contents_utf16; |
| 97 formatter.FormatAccessibilityTree(&actual_contents_utf16); | 95 formatter.FormatAccessibilityTree(&actual_contents_utf16); |
| (...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1001 | 999 |
| 1002 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityVar) { | 1000 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityVar) { |
| 1003 RunHtmlTest(FILE_PATH_LITERAL("var.html")); | 1001 RunHtmlTest(FILE_PATH_LITERAL("var.html")); |
| 1004 } | 1002 } |
| 1005 | 1003 |
| 1006 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityWbr) { | 1004 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityWbr) { |
| 1007 RunHtmlTest(FILE_PATH_LITERAL("wbr.html")); | 1005 RunHtmlTest(FILE_PATH_LITERAL("wbr.html")); |
| 1008 } | 1006 } |
| 1009 | 1007 |
| 1010 } // namespace content | 1008 } // namespace content |
| OLD | NEW |