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 for (const std::string& line : | 92 std::vector<std::string> lines; |
93 base::SplitString(test_html, "\n", base::TRIM_WHITESPACE, | 93 base::SplitString(test_html, '\n', &lines); |
94 base::SPLIT_WANT_ALL)) { | 94 for (std::vector<std::string>::const_iterator iter = lines.begin(); |
| 95 iter != lines.end(); |
| 96 ++iter) { |
| 97 const std::string& line = *iter; |
95 const std::string& allow_empty_str = | 98 const std::string& allow_empty_str = |
96 AccessibilityTreeFormatter::GetAllowEmptyString(); | 99 AccessibilityTreeFormatter::GetAllowEmptyString(); |
97 const std::string& allow_str = | 100 const std::string& allow_str = |
98 AccessibilityTreeFormatter::GetAllowString(); | 101 AccessibilityTreeFormatter::GetAllowString(); |
99 const std::string& deny_str = | 102 const std::string& deny_str = |
100 AccessibilityTreeFormatter::GetDenyString(); | 103 AccessibilityTreeFormatter::GetDenyString(); |
101 const std::string& wait_str = "@WAIT-FOR:"; | 104 const std::string& wait_str = "@WAIT-FOR:"; |
102 if (base::StartsWith(line, allow_empty_str, | 105 if (base::StartsWith(line, allow_empty_str, |
103 base::CompareCase::SENSITIVE)) { | 106 base::CompareCase::SENSITIVE)) { |
104 filters->push_back( | 107 filters->push_back( |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 EXPECT_TRUE(base::WriteFile( | 242 EXPECT_TRUE(base::WriteFile( |
240 actual_file, actual_contents.c_str(), actual_contents.size())); | 243 actual_file, actual_contents.c_str(), actual_contents.size())); |
241 | 244 |
242 ADD_FAILURE() << "No expectation found. Create it by doing:\n" | 245 ADD_FAILURE() << "No expectation found. Create it by doing:\n" |
243 << "mv " << actual_file.LossyDisplayName() << " " | 246 << "mv " << actual_file.LossyDisplayName() << " " |
244 << expected_file.LossyDisplayName(); | 247 << expected_file.LossyDisplayName(); |
245 } | 248 } |
246 } | 249 } |
247 | 250 |
248 } // namespace content | 251 } // namespace content |
OLD | NEW |