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

Unified Diff: ppapi/tests/test_fullscreen.cc

Issue 8789005: Simulate a user gesture in Fullscreen test so it can run on bots. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Simulate a user gesture in Fullscreen test so it can run on bots. Created 9 years 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_fullscreen.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/test_fullscreen.cc
===================================================================
--- ppapi/tests/test_fullscreen.cc (revision 113618)
+++ ppapi/tests/test_fullscreen.cc (working copy)
@@ -85,6 +85,7 @@
// The transition is asynchronous and ends at the next DidChangeView().
// No graphics devices can be bound while in transition.
instance_->RequestInputEvents(PP_INPUTEVENT_CLASS_MOUSE);
+ SimulateUserGesture();
// HandleInputEvent() will call SetFullscreen(true).
// DidChangeView() will call the callback once in fullscreen mode.
fullscreen_callback_.WaitForResult();
@@ -136,6 +137,25 @@
PASS();
}
+void TestFullscreen::SimulateUserGesture() {
+ pp::Point plugin_center(
+ normal_position_.x() + normal_position_.width() / 2,
+ normal_position_.y() + normal_position_.height() / 2);
+ pp::Point mouse_movement;
+ pp::MouseInputEvent input_event(
+ instance_,
+ PP_INPUTEVENT_TYPE_MOUSEDOWN,
+ 0, // time_stamp
+ 0, // modifiers
+ PP_INPUTEVENT_MOUSEBUTTON_LEFT,
+ plugin_center,
+ 1, // click_count
+ mouse_movement);
+
+ testing_interface_->SimulateInputEvent(instance_->pp_instance(),
+ input_event.pp_resource());
+}
+
void TestFullscreen::FailFullscreenTest(const std::string& error) {
screen_mode_.SetFullscreen(false);
fullscreen_pending_ = false;
« no previous file with comments | « ppapi/tests/test_fullscreen.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698