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 "content/browser/accessibility/dump_accessibility_browsertest_base.h" | 5 #include "content/browser/accessibility/dump_accessibility_browsertest_base.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 } | 82 } |
83 | 83 |
84 // Actual file has been fully checked. | 84 // Actual file has been fully checked. |
85 return diff_lines; | 85 return diff_lines; |
86 } | 86 } |
87 | 87 |
88 void DumpAccessibilityTestBase::ParseHtmlForExtraDirectives( | 88 void DumpAccessibilityTestBase::ParseHtmlForExtraDirectives( |
89 const std::string& test_html, | 89 const std::string& test_html, |
90 std::vector<Filter>* filters, | 90 std::vector<Filter>* filters, |
91 std::string* wait_for) { | 91 std::string* wait_for) { |
92 std::vector<std::string> lines; | 92 for (const std::string& line : |
93 base::SplitString(test_html, '\n', &lines); | 93 base::SplitString(test_html, "\n", base::TRIM_WHITESPACE, |
94 for (std::vector<std::string>::const_iterator iter = lines.begin(); | 94 base::SPLIT_WANT_ALL)) { |
95 iter != lines.end(); | |
96 ++iter) { | |
97 const std::string& line = *iter; | |
98 const std::string& allow_empty_str = | 95 const std::string& allow_empty_str = |
99 AccessibilityTreeFormatter::GetAllowEmptyString(); | 96 AccessibilityTreeFormatter::GetAllowEmptyString(); |
100 const std::string& allow_str = | 97 const std::string& allow_str = |
101 AccessibilityTreeFormatter::GetAllowString(); | 98 AccessibilityTreeFormatter::GetAllowString(); |
102 const std::string& deny_str = | 99 const std::string& deny_str = |
103 AccessibilityTreeFormatter::GetDenyString(); | 100 AccessibilityTreeFormatter::GetDenyString(); |
104 const std::string& wait_str = "@WAIT-FOR:"; | 101 const std::string& wait_str = "@WAIT-FOR:"; |
105 if (base::StartsWith(line, allow_empty_str, | 102 if (base::StartsWith(line, allow_empty_str, |
106 base::CompareCase::SENSITIVE)) { | 103 base::CompareCase::SENSITIVE)) { |
107 filters->push_back( | 104 filters->push_back( |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 EXPECT_TRUE(base::WriteFile( | 239 EXPECT_TRUE(base::WriteFile( |
243 actual_file, actual_contents.c_str(), actual_contents.size())); | 240 actual_file, actual_contents.c_str(), actual_contents.size())); |
244 | 241 |
245 ADD_FAILURE() << "No expectation found. Create it by doing:\n" | 242 ADD_FAILURE() << "No expectation found. Create it by doing:\n" |
246 << "mv " << actual_file.LossyDisplayName() << " " | 243 << "mv " << actual_file.LossyDisplayName() << " " |
247 << expected_file.LossyDisplayName(); | 244 << expected_file.LossyDisplayName(); |
248 } | 245 } |
249 } | 246 } |
250 | 247 |
251 } // namespace content | 248 } // namespace content |
OLD | NEW |