diff options
author | dmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-09 02:33:27 +0000 |
---|---|---|
committer | dmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-09 02:33:27 +0000 |
commit | 30fdb36651388788b318cde3e9e86c29fd2bd79b (patch) | |
tree | c6f8d5411b084f8832fadc3192e52bd7744abf13 /content/browser/accessibility/browser_accessibility_state_impl.cc | |
parent | 2380c6bdf6dc0f4f6929f1b9702ec3ffce747e23 (diff) | |
download | chromium_src-30fdb36651388788b318cde3e9e86c29fd2bd79b.zip chromium_src-30fdb36651388788b318cde3e9e86c29fd2bd79b.tar.gz chromium_src-30fdb36651388788b318cde3e9e86c29fd2bd79b.tar.bz2 |
Add test for accessibility histograms.
The goal is just to make sure this code has test coverage, not to test
correctness. There was an issue in the past where the code that computed
the histograms crashed in debug mode, this will help prevent something like
that from landing in the future.
BUG=99504
Review URL: https://chromiumcodereview.appspot.com/11778045
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175677 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/accessibility/browser_accessibility_state_impl.cc')
-rw-r--r-- | content/browser/accessibility/browser_accessibility_state_impl.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/content/browser/accessibility/browser_accessibility_state_impl.cc b/content/browser/accessibility/browser_accessibility_state_impl.cc index 2f6e0c3..3cb73fe 100644 --- a/content/browser/accessibility/browser_accessibility_state_impl.cc +++ b/content/browser/accessibility/browser_accessibility_state_impl.cc @@ -50,12 +50,12 @@ BrowserAccessibilityStateImpl::BrowserAccessibilityStateImpl() } #if defined(OS_WIN) - // On Windows, UpdateHistogram calls some system functions with unknown + // On Windows, UpdateHistograms calls some system functions with unknown // runtime, so call it on the file thread to ensure there's no jank. // Everything in that method must be safe to call on another thread. BrowserThread::ID update_histogram_thread = BrowserThread::FILE; #else - // On all other platforms, UpdateHistogram should be called on the main + // On all other platforms, UpdateHistograms should be called on the main // thread. BrowserThread::ID update_histogram_thread = BrowserThread::UI; #endif @@ -65,7 +65,7 @@ BrowserAccessibilityStateImpl::BrowserAccessibilityStateImpl() AddRef(); BrowserThread::PostDelayedTask( update_histogram_thread, FROM_HERE, - base::Bind(&BrowserAccessibilityStateImpl::UpdateHistogram, this), + base::Bind(&BrowserAccessibilityStateImpl::UpdateHistograms, this), base::TimeDelta::FromSeconds(kAccessibilityHistogramDelaySecs)); } @@ -94,7 +94,11 @@ void BrowserAccessibilityStateImpl::AddHistogramCallback( histogram_callbacks_.push_back(callback); } -void BrowserAccessibilityStateImpl::UpdateHistogram() { +void BrowserAccessibilityStateImpl::UpdateHistogramsForTesting() { + UpdateHistograms(); +} + +void BrowserAccessibilityStateImpl::UpdateHistograms() { UpdatePlatformSpecificHistograms(); for (size_t i = 0; i < histogram_callbacks_.size(); ++i) |