summaryrefslogtreecommitdiffstats
path: root/ui/ozone
diff options
context:
space:
mode:
authorafakhry <afakhry@chromium.org>2015-03-17 20:05:35 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-18 03:06:00 +0000
commit00e8cbeb43eb3cc99ffed3bc29a8a539dfece0a6 (patch)
tree368fe50de6b6fb1470be688bb1e3d7441f809fdf /ui/ozone
parentbeeac5732f89ff86b7e5482dc005016a52242290 (diff)
downloadchromium_src-00e8cbeb43eb3cc99ffed3bc29a8a539dfece0a6.zip
chromium_src-00e8cbeb43eb3cc99ffed3bc29a8a539dfece0a6.tar.gz
chromium_src-00e8cbeb43eb3cc99ffed3bc29a8a539dfece0a6.tar.bz2
Fix for menus blocking user activity detection (Retry).
Original CL reverted here: https://codereview.chromium.org/998603003/ Menus used to block detecting user activity. The fix works by making the UserActivityDetector a PlatformEventObserver rather than an EventHandler. Also made sure that PlatformEventSource has an instance in ozone_platform_test.cc TBR=oshima@chromium.org,jamescook@chromium.org R=sadrul@chromium.org,alexst@chromium.org BUG=462735 TEST=ui_base_unittests --gtest_filter=UserActivityDetectorTest.* Review URL: https://codereview.chromium.org/1013003002 Cr-Commit-Position: refs/heads/master@{#321066}
Diffstat (limited to 'ui/ozone')
-rw-r--r--ui/ozone/platform/test/ozone_platform_test.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/ui/ozone/platform/test/ozone_platform_test.cc b/ui/ozone/platform/test/ozone_platform_test.cc
index fce3a9d..d94fde9 100644
--- a/ui/ozone/platform/test/ozone_platform_test.cc
+++ b/ui/ozone/platform/test/ozone_platform_test.cc
@@ -25,6 +25,17 @@ namespace ui {
namespace {
+// A test implementation of PlatformEventSource that we can instantiate to make
+// sure that the PlatformEventSource has an instance while in unit tests.
+class TestPlatformEventSource : public ui::PlatformEventSource {
+ public:
+ TestPlatformEventSource() {}
+ ~TestPlatformEventSource() override {}
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TestPlatformEventSource);
+};
+
// OzonePlatform for testing
//
// This platform dumps images to a file for testing purposes.
@@ -67,7 +78,7 @@ class OzonePlatformTest : public OzonePlatform {
window_manager_->Initialize();
// This unbreaks tests that create their own.
if (!PlatformEventSource::GetInstance())
- platform_event_source_ = PlatformEventSource::CreateDefault();
+ platform_event_source_.reset(new TestPlatformEventSource);
KeyboardLayoutEngineManager::SetKeyboardLayoutEngine(
make_scoped_ptr(new StubKeyboardLayoutEngine()));