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

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

Issue 2863833003: Fix primary cause of flakiness of DumpAccessibilityEvents tests on Win (Closed)
Patch Set: Fix logic Created 3 years, 7 months 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
« no previous file with comments | « content/browser/accessibility/browser_accessibility_manager.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
199 // native window isn't focused. Suppress this check to avoid flaky tests,
200 // since we can't always control when a native window loses focus.
201 BrowserAccessibilityManager::NeverSuppressFocusEventsForTesting();
202
198 NavigateToURL(shell(), GURL(url::kAboutBlankURL)); 203 NavigateToURL(shell(), GURL(url::kAboutBlankURL));
199 204
200 std::string html_contents; 205 std::string html_contents;
201 base::FilePath expected_file; 206 base::FilePath expected_file;
202 std::string expected_contents_raw; 207 std::string expected_contents_raw;
203 { 208 {
204 base::ThreadRestrictions::ScopedAllowIO allow_io_for_test_setup; 209 base::ThreadRestrictions::ScopedAllowIO allow_io_for_test_setup;
205 base::ReadFileToString(file_path, &html_contents); 210 base::ReadFileToString(file_path, &html_contents);
206 211
207 // Read the expected file. 212 // Read the expected file.
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 static_cast<int>(actual_contents.size())); 395 static_cast<int>(actual_contents.size()));
391 LOG(INFO) << "Wrote expectations to: " 396 LOG(INFO) << "Wrote expectations to: "
392 << expected_file.LossyDisplayName(); 397 << expected_file.LossyDisplayName();
393 } 398 }
394 } else { 399 } else {
395 LOG(INFO) << "Test output matches expectations."; 400 LOG(INFO) << "Test output matches expectations.";
396 } 401 }
397 } 402 }
398 403
399 } // namespace content 404 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/accessibility/browser_accessibility_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698