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

Unified Diff: ppapi/tests/test_input_event.h

Issue 8413021: Add functions to generate input events to PPB_Testing_Dev. These make (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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: ppapi/tests/test_input_event.h
===================================================================
--- ppapi/tests/test_input_event.h (revision 0)
+++ ppapi/tests/test_input_event.h (revision 0)
@@ -0,0 +1,57 @@
+// Copyright (c) 2011 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 PPAPI_TESTS_TEST_INPUT_EVENT_H_
+#define PPAPI_TESTS_TEST_INPUT_EVENT_H_
+
+#include <string>
+#include <vector>
+
+#include "ppapi/cpp/input_event.h"
+#include "ppapi/cpp/point.h"
+#include "ppapi/cpp/rect.h"
+#include "ppapi/tests/test_case.h"
+
+struct PPB_InputEvent;
+struct PPB_MouseInputEvent;
+struct PPB_WheelInputEvent;
+struct PPB_KeyboardInputEvent;
+struct PPB_Testing_Dev;
+
+class TestInputEvent : public TestCase {
+ public:
+ explicit TestInputEvent(TestingInstance* instance);
+
+ bool HandleInputEvent(const pp::InputEvent& input_event);
+ void DidChangeView(const pp::Rect& position, const pp::Rect& clip);
+
+ // TestCase implementation.
+ virtual bool Init();
+ virtual void RunTest();
+
+ private:
+ pp::InputEvent CreateMouseEvent();
+ pp::InputEvent CreateWheelEvent();
+ pp::InputEvent CreateKeyEvent();
+ pp::InputEvent CreateCharEvent();
+
+ bool SimulateInputEvent(const pp::InputEvent& input_event);
+ bool AreEquivalentEvents(PP_Resource first, PP_Resource second);
+
+ std::string TestEvents();
+ std::string TestFiltering();
+
+ const struct PPB_InputEvent* input_event_interface_;
+ const struct PPB_MouseInputEvent* mouse_input_event_interface_;
+ const struct PPB_WheelInputEvent* wheel_input_event_interface_;
+ const struct PPB_KeyboardInputEvent* keyboard_input_event_interface_;
+ const struct PPB_Testing_Dev* testing_interface_;
+
+ pp::Rect view_rect_;
+ pp::InputEvent expected_input_event_;
+ bool received_expected_event_;
+};
+
+#endif // PPAPI_TESTS_TEST_INPUT_EVENT_H_
+
Property changes on: ppapi\tests\test_input_event.h
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698