summaryrefslogtreecommitdiffstats
path: root/chrome/browser/device_orientation/provider.h
diff options
context:
space:
mode:
authorhans@chromium.org <hans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-27 19:44:50 +0000
committerhans@chromium.org <hans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-27 19:44:50 +0000
commit58a020ec48902082f9ba8f47637b4e29a1ce6aa6 (patch)
tree887fe36d71e97711035c371316013d28f4754538 /chrome/browser/device_orientation/provider.h
parente5c621f13ac46ba5d45bf5a308edd3bd19b79a44 (diff)
downloadchromium_src-58a020ec48902082f9ba8f47637b4e29a1ce6aa6.zip
chromium_src-58a020ec48902082f9ba8f47637b4e29a1ce6aa6.tar.gz
chromium_src-58a020ec48902082f9ba8f47637b4e29a1ce6aa6.tar.bz2
Fix DeviceOrientationProviderTest.
There was a race that could potentially result in a reference to Provider being left after a test finished, causing the next test to fail. The test must not assume that the orientation update notification is posted on the message loop right away, but rather wait for it. I was not able to reproduce the bug, but I believe this should fix it. BUG=53468 TEST=unit_tests --gtest_filter=DeviceOrientationProviderTest* Review URL: http://codereview.chromium.org/3231003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57719 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/device_orientation/provider.h')
-rw-r--r--chrome/browser/device_orientation/provider.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/chrome/browser/device_orientation/provider.h b/chrome/browser/device_orientation/provider.h
index c6b1b7a..ce1b89d 100644
--- a/chrome/browser/device_orientation/provider.h
+++ b/chrome/browser/device_orientation/provider.h
@@ -33,6 +33,9 @@ class Provider : public base::RefCountedThreadSafe<Provider> {
// injected object's reference count.
static void SetInstanceForTests(Provider* provider);
+ // Get the current instance. Used for testing.
+ static Provider* GetInstanceForTests();
+
// Note: AddObserver may call back synchronously to the observer with
// orientation data.
virtual void AddObserver(Observer* observer) = 0;