Index: mojo/ui/associates/mock_hit_tester.h |
diff --git a/mojo/ui/associates/mock_hit_tester.h b/mojo/ui/associates/mock_hit_tester.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2ce5d7c45f253019dbacd6ab259cddf7a837357e |
--- /dev/null |
+++ b/mojo/ui/associates/mock_hit_tester.h |
@@ -0,0 +1,39 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef MOJO_UI_ASSOCIATES_MOCK_HIT_TESTER_H_ |
+#define MOJO_UI_ASSOCIATES_MOCK_HIT_TESTER_H_ |
+ |
+#include <unordered_map> |
+ |
+#include "base/macros.h" |
+#include "mojo/services/gfx/composition/interfaces/hit_tests.mojom.h" |
+ |
+namespace mojo { |
+namespace ui { |
+ |
+// TODO(jeffbrown): Move this someplace closer to mojo::gfx::composition |
+class MockHitTester : public mojo::gfx::composition::HitTester { |
+ public: |
+ MockHitTester(); |
+ ~MockHitTester() override; |
+ |
+ // Sets the next hit test result. |
+ void SetNextResult(mojo::PointPtr point, |
+ mojo::gfx::composition::HitTestResultPtr result); |
+ |
+ // |HitTester| |
+ void HitTest(mojo::PointPtr point, const HitTestCallback& callback) override; |
+ |
+ private: |
+ mojo::PointPtr point_; |
+ mojo::gfx::composition::HitTestResultPtr result_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(MockHitTester); |
+}; |
+ |
+} // namespace ui |
+} // namespace mojo |
+ |
+#endif // MOJO_UI_ASSOCIATES_MOCK_HIT_TESTER_H_ |