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

Unified Diff: ppapi/tests/test_input_event.cc

Issue 10665007: ppapi: Add test for touch-event support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: self-nits Created 8 years, 6 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
« no previous file with comments | « ppapi/tests/test_input_event.h ('k') | ppapi/tests/testing_instance.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/test_input_event.cc
diff --git a/ppapi/tests/test_input_event.cc b/ppapi/tests/test_input_event.cc
index 73b76355bb31ee70dc093e6a98820484c285dd42..c0b49d567749efaeeae7465ca6d1c3b1d9574c77 100644
--- a/ppapi/tests/test_input_event.cc
+++ b/ppapi/tests/test_input_event.cc
@@ -31,6 +31,10 @@ pp::Point GetCenter(const pp::Rect& rect) {
void TestInputEvent::RunTests(const std::string& filter) {
RUN_TEST(Events, filter);
+ RUN_TEST(AcceptTouchEvent_1, filter);
+ RUN_TEST(AcceptTouchEvent_2, filter);
+ RUN_TEST(AcceptTouchEvent_3, filter);
+ RUN_TEST(AcceptTouchEvent_4, filter);
}
TestInputEvent::TestInputEvent(TestingInstance* instance)
@@ -285,3 +289,47 @@ std::string TestInputEvent::TestEvents() {
PASS();
}
+std::string TestInputEvent::TestAcceptTouchEvent_1() {
brettw 2012/06/25 23:30:51 Can you add a comment above here explaining how th
sadrul 2012/06/28 16:38:04 Done.
+ instance_->set_remove_plugin(false);
+ input_event_interface_->RequestInputEvents(instance_->pp_instance(),
+ PP_INPUTEVENT_CLASS_MOUSE |
+ PP_INPUTEVENT_CLASS_WHEEL |
+ PP_INPUTEVENT_CLASS_KEYBOARD |
+ PP_INPUTEVENT_CLASS_TOUCH);
+ PASS();
+}
+
+std::string TestInputEvent::TestAcceptTouchEvent_2() {
+ instance_->set_remove_plugin(false);
+ input_event_interface_->RequestInputEvents(instance_->pp_instance(),
+ PP_INPUTEVENT_CLASS_MOUSE |
+ PP_INPUTEVENT_CLASS_WHEEL |
+ PP_INPUTEVENT_CLASS_KEYBOARD |
+ PP_INPUTEVENT_CLASS_TOUCH);
+ input_event_interface_->ClearInputEventRequest(instance_->pp_instance(),
+ PP_INPUTEVENT_CLASS_TOUCH);
+ PASS();
+}
+
+std::string TestInputEvent::TestAcceptTouchEvent_3() {
+ instance_->set_remove_plugin(false);
+ input_event_interface_->RequestInputEvents(instance_->pp_instance(),
+ PP_INPUTEVENT_CLASS_MOUSE |
+ PP_INPUTEVENT_CLASS_WHEEL |
+ PP_INPUTEVENT_CLASS_KEYBOARD);
+ input_event_interface_->RequestFilteringInputEvents(instance_->pp_instance(),
+ PP_INPUTEVENT_CLASS_TOUCH);
+ PASS();
+}
+
+std::string TestInputEvent::TestAcceptTouchEvent_4() {
+ instance_->set_remove_plugin(false);
+ input_event_interface_->RequestInputEvents(instance_->pp_instance(),
+ PP_INPUTEVENT_CLASS_MOUSE |
+ PP_INPUTEVENT_CLASS_WHEEL |
+ PP_INPUTEVENT_CLASS_KEYBOARD);
+ input_event_interface_->RequestInputEvents(instance_->pp_instance(),
+ PP_INPUTEVENT_CLASS_TOUCH);
+ PASS();
+}
+
« no previous file with comments | « ppapi/tests/test_input_event.h ('k') | ppapi/tests/testing_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698