| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 iter != lines.end(); | 95 iter != lines.end(); |
| 96 ++iter) { | 96 ++iter) { |
| 97 const std::string& line = *iter; | 97 const std::string& line = *iter; |
| 98 const std::string& allow_empty_str = | 98 const std::string& allow_empty_str = |
| 99 AccessibilityTreeFormatter::GetAllowEmptyString(); | 99 AccessibilityTreeFormatter::GetAllowEmptyString(); |
| 100 const std::string& allow_str = | 100 const std::string& allow_str = |
| 101 AccessibilityTreeFormatter::GetAllowString(); | 101 AccessibilityTreeFormatter::GetAllowString(); |
| 102 const std::string& deny_str = | 102 const std::string& deny_str = |
| 103 AccessibilityTreeFormatter::GetDenyString(); | 103 AccessibilityTreeFormatter::GetDenyString(); |
| 104 const std::string& wait_str = "@WAIT-FOR:"; | 104 const std::string& wait_str = "@WAIT-FOR:"; |
| 105 if (base::StartsWithASCII(line, allow_empty_str, true)) { | 105 if (base::StartsWith(line, allow_empty_str, |
| 106 base::CompareCase::SENSITIVE)) { |
| 106 filters->push_back( | 107 filters->push_back( |
| 107 Filter(base::UTF8ToUTF16(line.substr(allow_empty_str.size())), | 108 Filter(base::UTF8ToUTF16(line.substr(allow_empty_str.size())), |
| 108 Filter::ALLOW_EMPTY)); | 109 Filter::ALLOW_EMPTY)); |
| 109 } else if (base::StartsWithASCII(line, allow_str, true)) { | 110 } else if (base::StartsWith(line, allow_str, |
| 111 base::CompareCase::SENSITIVE)) { |
| 110 filters->push_back(Filter(base::UTF8ToUTF16( | 112 filters->push_back(Filter(base::UTF8ToUTF16( |
| 111 line.substr(allow_str.size())), | 113 line.substr(allow_str.size())), |
| 112 Filter::ALLOW)); | 114 Filter::ALLOW)); |
| 113 } else if (base::StartsWithASCII(line, deny_str, true)) { | 115 } else if (base::StartsWith(line, deny_str, |
| 116 base::CompareCase::SENSITIVE)) { |
| 114 filters->push_back(Filter(base::UTF8ToUTF16( | 117 filters->push_back(Filter(base::UTF8ToUTF16( |
| 115 line.substr(deny_str.size())), | 118 line.substr(deny_str.size())), |
| 116 Filter::DENY)); | 119 Filter::DENY)); |
| 117 } else if (base::StartsWithASCII(line, wait_str, true)) { | 120 } else if (base::StartsWith(line, wait_str, |
| 121 base::CompareCase::SENSITIVE)) { |
| 118 *wait_for = line.substr(wait_str.size()); | 122 *wait_for = line.substr(wait_str.size()); |
| 119 } | 123 } |
| 120 } | 124 } |
| 121 } | 125 } |
| 122 | 126 |
| 123 void DumpAccessibilityTestBase::RunTest( | 127 void DumpAccessibilityTestBase::RunTest( |
| 124 const base::FilePath file_path, const char* file_dir) { | 128 const base::FilePath file_path, const char* file_dir) { |
| 125 // Disable the "hot tracked" state (set when the mouse is hovering over | 129 // Disable the "hot tracked" state (set when the mouse is hovering over |
| 126 // an object) because it makes test output change based on the mouse position. | 130 // an object) because it makes test output change based on the mouse position. |
| 127 BrowserAccessibilityStateImpl::GetInstance()-> | 131 BrowserAccessibilityStateImpl::GetInstance()-> |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 EXPECT_TRUE(base::WriteFile( | 242 EXPECT_TRUE(base::WriteFile( |
| 239 actual_file, actual_contents.c_str(), actual_contents.size())); | 243 actual_file, actual_contents.c_str(), actual_contents.size())); |
| 240 | 244 |
| 241 ADD_FAILURE() << "No expectation found. Create it by doing:\n" | 245 ADD_FAILURE() << "No expectation found. Create it by doing:\n" |
| 242 << "mv " << actual_file.LossyDisplayName() << " " | 246 << "mv " << actual_file.LossyDisplayName() << " " |
| 243 << expected_file.LossyDisplayName(); | 247 << expected_file.LossyDisplayName(); |
| 244 } | 248 } |
| 245 } | 249 } |
| 246 | 250 |
| 247 } // namespace content | 251 } // namespace content |
| OLD | NEW |