| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 base::string16 | 41 base::string16 |
| 42 DumpAccessibilityTestBase::DumpUnfilteredAccessibilityTreeAsString() { | 42 DumpAccessibilityTestBase::DumpUnfilteredAccessibilityTreeAsString() { |
| 43 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( | 43 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( |
| 44 shell()->web_contents()); | 44 shell()->web_contents()); |
| 45 AccessibilityTreeFormatter formatter( | 45 AccessibilityTreeFormatter formatter( |
| 46 web_contents->GetRootBrowserAccessibilityManager()->GetRoot()); | 46 web_contents->GetRootBrowserAccessibilityManager()->GetRoot()); |
| 47 std::vector<Filter> filters; | 47 std::vector<Filter> filters; |
| 48 filters.push_back(Filter(base::ASCIIToUTF16("*"), Filter::ALLOW)); | 48 filters.push_back(Filter(base::ASCIIToUTF16("*"), Filter::ALLOW)); |
| 49 formatter.SetFilters(filters); | 49 formatter.SetFilters(filters); |
| 50 formatter.set_show_ids(true); |
| 50 base::string16 ax_tree_dump; | 51 base::string16 ax_tree_dump; |
| 51 formatter.FormatAccessibilityTree(&ax_tree_dump); | 52 formatter.FormatAccessibilityTree(&ax_tree_dump); |
| 52 return ax_tree_dump; | 53 return ax_tree_dump; |
| 53 } | 54 } |
| 54 | 55 |
| 55 std::vector<int> DumpAccessibilityTestBase::DiffLines( | 56 std::vector<int> DumpAccessibilityTestBase::DiffLines( |
| 56 const std::vector<std::string>& expected_lines, | 57 const std::vector<std::string>& expected_lines, |
| 57 const std::vector<std::string>& actual_lines) { | 58 const std::vector<std::string>& actual_lines) { |
| 58 int actual_lines_count = actual_lines.size(); | 59 int actual_lines_count = actual_lines.size(); |
| 59 int expected_lines_count = expected_lines.size(); | 60 int expected_lines_count = expected_lines.size(); |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 EXPECT_TRUE(base::WriteFile( | 235 EXPECT_TRUE(base::WriteFile( |
| 235 actual_file, actual_contents.c_str(), actual_contents.size())); | 236 actual_file, actual_contents.c_str(), actual_contents.size())); |
| 236 | 237 |
| 237 ADD_FAILURE() << "No expectation found. Create it by doing:\n" | 238 ADD_FAILURE() << "No expectation found. Create it by doing:\n" |
| 238 << "mv " << actual_file.LossyDisplayName() << " " | 239 << "mv " << actual_file.LossyDisplayName() << " " |
| 239 << expected_file.LossyDisplayName(); | 240 << expected_file.LossyDisplayName(); |
| 240 } | 241 } |
| 241 } | 242 } |
| 242 | 243 |
| 243 } // namespace content | 244 } // namespace content |
| OLD | NEW |