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/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 dir_test_data.Append(FILE_PATH_LITERAL("accessibility"))); | 133 dir_test_data.Append(FILE_PATH_LITERAL("accessibility"))); |
134 ASSERT_TRUE(base::PathExists(test_path)) | 134 ASSERT_TRUE(base::PathExists(test_path)) |
135 << test_path.LossyDisplayName(); | 135 << test_path.LossyDisplayName(); |
136 | 136 |
137 base::FilePath html_file = test_path.Append(base::FilePath(file_path)); | 137 base::FilePath html_file = test_path.Append(base::FilePath(file_path)); |
138 // Output the test path to help anyone who encounters a failure and needs | 138 // Output the test path to help anyone who encounters a failure and needs |
139 // to know where to look. | 139 // to know where to look. |
140 printf("Testing: %s\n", html_file.MaybeAsASCII().c_str()); | 140 printf("Testing: %s\n", html_file.MaybeAsASCII().c_str()); |
141 | 141 |
142 std::string html_contents; | 142 std::string html_contents; |
143 file_util::ReadFileToString(html_file, &html_contents); | 143 base::ReadFileToString(html_file, &html_contents); |
144 | 144 |
145 // Read the expected file. | 145 // Read the expected file. |
146 std::string expected_contents_raw; | 146 std::string expected_contents_raw; |
147 base::FilePath expected_file = | 147 base::FilePath expected_file = |
148 base::FilePath(html_file.RemoveExtension().value() + | 148 base::FilePath(html_file.RemoveExtension().value() + |
149 AccessibilityTreeFormatter::GetExpectedFileSuffix()); | 149 AccessibilityTreeFormatter::GetExpectedFileSuffix()); |
150 file_util::ReadFileToString(expected_file, &expected_contents_raw); | 150 base::ReadFileToString(expected_file, &expected_contents_raw); |
151 | 151 |
152 // Tolerate Windows-style line endings (\r\n) in the expected file: | 152 // Tolerate Windows-style line endings (\r\n) in the expected file: |
153 // normalize by deleting all \r from the file (if any) to leave only \n. | 153 // normalize by deleting all \r from the file (if any) to leave only \n. |
154 std::string expected_contents; | 154 std::string expected_contents; |
155 RemoveChars(expected_contents_raw, "\r", &expected_contents); | 155 RemoveChars(expected_contents_raw, "\r", &expected_contents); |
156 | 156 |
157 if (!expected_contents.compare(0, strlen(kMarkSkipFile), kMarkSkipFile)) { | 157 if (!expected_contents.compare(0, strlen(kMarkSkipFile), kMarkSkipFile)) { |
158 printf("Skipping this test on this platform.\n"); | 158 printf("Skipping this test on this platform.\n"); |
159 return; | 159 return; |
160 } | 160 } |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 | 447 |
448 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityUl) { | 448 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityUl) { |
449 RunTest(FILE_PATH_LITERAL("ul.html")); | 449 RunTest(FILE_PATH_LITERAL("ul.html")); |
450 } | 450 } |
451 | 451 |
452 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityWbr) { | 452 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityWbr) { |
453 RunTest(FILE_PATH_LITERAL("wbr.html")); | 453 RunTest(FILE_PATH_LITERAL("wbr.html")); |
454 } | 454 } |
455 | 455 |
456 } // namespace content | 456 } // namespace content |
OLD | NEW |