| 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 | 188 |
| 189 void DumpAccessibilityTestBase::RunTestForPlatform( | 189 void DumpAccessibilityTestBase::RunTestForPlatform( |
| 190 const base::FilePath file_path, const char* file_dir) { | 190 const base::FilePath file_path, const char* file_dir) { |
| 191 formatter_.reset(CreateAccessibilityTreeFormatter()); | 191 formatter_.reset(CreateAccessibilityTreeFormatter()); |
| 192 | 192 |
| 193 // Disable the "hot tracked" state (set when the mouse is hovering over | 193 // Disable the "hot tracked" state (set when the mouse is hovering over |
| 194 // an object) because it makes test output change based on the mouse position. | 194 // an object) because it makes test output change based on the mouse position. |
| 195 BrowserAccessibilityStateImpl::GetInstance()-> | 195 BrowserAccessibilityStateImpl::GetInstance()-> |
| 196 set_disable_hot_tracking_for_testing(true); | 196 set_disable_hot_tracking_for_testing(true); |
| 197 | 197 |
| 198 // Normally we avoid firing accessibility focus events when the containing | 198 // Normally some accessibility events that would be fired are suppressed or |
| 199 // native window isn't focused. Suppress this check to avoid flaky tests, | 199 // delayed, depending on what has focus or the type of event. For testing, |
| 200 // since we can't always control when a native window loses focus. | 200 // we want all events to fire immediately to make tests predictable and not |
| 201 BrowserAccessibilityManager::NeverSuppressFocusEventsForTesting(); | 201 // flaky. |
| 202 BrowserAccessibilityManager::NeverSuppressOrDelayEventsForTesting(); |
| 202 | 203 |
| 203 NavigateToURL(shell(), GURL(url::kAboutBlankURL)); | 204 NavigateToURL(shell(), GURL(url::kAboutBlankURL)); |
| 204 | 205 |
| 205 std::string html_contents; | 206 std::string html_contents; |
| 206 base::FilePath expected_file; | 207 base::FilePath expected_file; |
| 207 std::string expected_contents_raw; | 208 std::string expected_contents_raw; |
| 208 { | 209 { |
| 209 base::ThreadRestrictions::ScopedAllowIO allow_io_for_test_setup; | 210 base::ThreadRestrictions::ScopedAllowIO allow_io_for_test_setup; |
| 210 base::ReadFileToString(file_path, &html_contents); | 211 base::ReadFileToString(file_path, &html_contents); |
| 211 | 212 |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 static_cast<int>(actual_contents.size())); | 396 static_cast<int>(actual_contents.size())); |
| 396 LOG(INFO) << "Wrote expectations to: " | 397 LOG(INFO) << "Wrote expectations to: " |
| 397 << expected_file.LossyDisplayName(); | 398 << expected_file.LossyDisplayName(); |
| 398 } | 399 } |
| 399 } else { | 400 } else { |
| 400 LOG(INFO) << "Test output matches expectations."; | 401 LOG(INFO) << "Test output matches expectations."; |
| 401 } | 402 } |
| 402 } | 403 } |
| 403 | 404 |
| 404 } // namespace content | 405 } // namespace content |
| OLD | NEW |