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

Unified Diff: ui/ozone/public/ozone_platform.h

Issue 2795503002: mash: Don't synthesize extra key press events in the window server (Closed)
Patch Set: utility Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: ui/ozone/public/ozone_platform.h
diff --git a/ui/ozone/public/ozone_platform.h b/ui/ozone/public/ozone_platform.h
index 97cab2cfebd51b060fd9870d7c7b618cebb65500..d30d8e6f627dee69b05179a0a02e1cdc5c7abcd9 100644
--- a/ui/ozone/public/ozone_platform.h
+++ b/ui/ozone/public/ozone_platform.h
@@ -7,6 +7,7 @@
#include <memory>
+#include "base/auto_reset.h"
#include "base/macros.h"
#include "base/message_loop/message_loop.h"
#include "ui/ozone/ozone_export.h"
@@ -126,6 +127,8 @@ class OZONE_EXPORT OzonePlatform {
virtual void AddInterfaces(service_manager::InterfaceRegistry* registry);
private:
+ friend class ScopedOzonePlatformForTesting;
+
virtual void InitializeUI(const InitParams& params) = 0;
virtual void InitializeGPU(const InitParams& params) = 0;
@@ -134,6 +137,18 @@ class OZONE_EXPORT OzonePlatform {
DISALLOW_COPY_AND_ASSIGN(OzonePlatform);
};
+// Allows the ozone platform instance to be overridden in tests.
+class OZONE_EXPORT ScopedOzonePlatformForTesting {
+ public:
+ ScopedOzonePlatformForTesting(OzonePlatform* test_instance);
+ ~ScopedOzonePlatformForTesting();
+
+ private:
+ base::AutoReset<OzonePlatform*> auto_reset_;
+
+ DISALLOW_COPY_AND_ASSIGN(ScopedOzonePlatformForTesting);
+};
+
} // namespace ui
#endif // UI_OZONE_PUBLIC_OZONE_PLATFORM_H_

Powered by Google App Engine
This is Rietveld 408576698