Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Side by Side Diff: content/browser/accessibility/dump_accessibility_browsertest_base.cc

Issue 811213002: Revert of Add DumpAccessibilityEvents test framework. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dump_acc_events_1
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 base::string16 47 base::string16
48 DumpAccessibilityTestBase::DumpUnfilteredAccessibilityTreeAsString() { 48 DumpAccessibilityTestBase::DumpUnfilteredAccessibilityTreeAsString() {
49 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( 49 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(
50 shell()->web_contents()); 50 shell()->web_contents());
51 AccessibilityTreeFormatter formatter( 51 AccessibilityTreeFormatter formatter(
52 web_contents->GetRootBrowserAccessibilityManager()->GetRoot()); 52 web_contents->GetRootBrowserAccessibilityManager()->GetRoot());
53 std::vector<Filter> filters; 53 std::vector<Filter> filters;
54 filters.push_back(Filter(base::ASCIIToUTF16("*"), Filter::ALLOW)); 54 filters.push_back(Filter(base::ASCIIToUTF16("*"), Filter::ALLOW));
55 formatter.SetFilters(filters); 55 formatter.SetFilters(filters);
56 formatter.set_show_ids(true);
57 base::string16 ax_tree_dump; 56 base::string16 ax_tree_dump;
58 formatter.FormatAccessibilityTree(&ax_tree_dump); 57 formatter.FormatAccessibilityTree(&ax_tree_dump);
59 return ax_tree_dump; 58 return ax_tree_dump;
60 } 59 }
61 60
62 std::vector<int> DumpAccessibilityTestBase::DiffLines( 61 std::vector<int> DumpAccessibilityTestBase::DiffLines(
63 const std::vector<std::string>& expected_lines, 62 const std::vector<std::string>& expected_lines,
64 const std::vector<std::string>& actual_lines) { 63 const std::vector<std::string>& actual_lines) {
65 int actual_lines_count = actual_lines.size(); 64 int actual_lines_count = actual_lines.size();
66 int expected_lines_count = expected_lines.size(); 65 int expected_lines_count = expected_lines.size();
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 EXPECT_TRUE(base::WriteFile( 240 EXPECT_TRUE(base::WriteFile(
242 actual_file, actual_contents.c_str(), actual_contents.size())); 241 actual_file, actual_contents.c_str(), actual_contents.size()));
243 242
244 ADD_FAILURE() << "No expectation found. Create it by doing:\n" 243 ADD_FAILURE() << "No expectation found. Create it by doing:\n"
245 << "mv " << actual_file.LossyDisplayName() << " " 244 << "mv " << actual_file.LossyDisplayName() << " "
246 << expected_file.LossyDisplayName(); 245 << expected_file.LossyDisplayName();
247 } 246 }
248 } 247 }
249 248
250 } // namespace content 249 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698