| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 } | 86 } |
| 87 | 87 |
| 88 void DumpAccessibilityTestBase::SetUpOnMainThread() { | 88 void DumpAccessibilityTestBase::SetUpOnMainThread() { |
| 89 host_resolver()->AddRule("*", "127.0.0.1"); | 89 host_resolver()->AddRule("*", "127.0.0.1"); |
| 90 ASSERT_TRUE(embedded_test_server()->Start()); | 90 ASSERT_TRUE(embedded_test_server()->Start()); |
| 91 SetupCrossSiteRedirector(embedded_test_server()); | 91 SetupCrossSiteRedirector(embedded_test_server()); |
| 92 } | 92 } |
| 93 | 93 |
| 94 base::string16 | 94 base::string16 |
| 95 DumpAccessibilityTestBase::DumpUnfilteredAccessibilityTreeAsString() { | 95 DumpAccessibilityTestBase::DumpUnfilteredAccessibilityTreeAsString() { |
| 96 scoped_ptr<AccessibilityTreeFormatter> formatter( | 96 std::unique_ptr<AccessibilityTreeFormatter> formatter( |
| 97 CreateAccessibilityTreeFormatter()); | 97 CreateAccessibilityTreeFormatter()); |
| 98 std::vector<Filter> filters; | 98 std::vector<Filter> filters; |
| 99 filters.push_back(Filter(base::ASCIIToUTF16("*"), Filter::ALLOW)); | 99 filters.push_back(Filter(base::ASCIIToUTF16("*"), Filter::ALLOW)); |
| 100 formatter->SetFilters(filters); | 100 formatter->SetFilters(filters); |
| 101 formatter->set_show_ids(true); | 101 formatter->set_show_ids(true); |
| 102 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( | 102 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( |
| 103 shell()->web_contents()); | 103 shell()->web_contents()); |
| 104 base::string16 ax_tree_dump; | 104 base::string16 ax_tree_dump; |
| 105 formatter->FormatAccessibilityTree( | 105 formatter->FormatAccessibilityTree( |
| 106 web_contents->GetRootBrowserAccessibilityManager()->GetRoot(), | 106 web_contents->GetRootBrowserAccessibilityManager()->GetRoot(), |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 expected_file, actual_contents.c_str(), actual_contents.size())); | 386 expected_file, actual_contents.c_str(), actual_contents.size())); |
| 387 LOG(INFO) << "Wrote expectations to: " | 387 LOG(INFO) << "Wrote expectations to: " |
| 388 << expected_file.LossyDisplayName(); | 388 << expected_file.LossyDisplayName(); |
| 389 } | 389 } |
| 390 } else { | 390 } else { |
| 391 LOG(INFO) << "Test output matches expectations."; | 391 LOG(INFO) << "Test output matches expectations."; |
| 392 } | 392 } |
| 393 } | 393 } |
| 394 | 394 |
| 395 } // namespace content | 395 } // namespace content |
| OLD | NEW |