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

Unified Diff: ppapi/tests/test_fullscreen.cc

Issue 9937001: PPAPI: Refactor ppapi test callbacks to ease testing blocking callbacks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 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
« no previous file with comments | « ppapi/tests/test_fullscreen.h ('k') | ppapi/tests/test_network_monitor_private.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/test_fullscreen.cc
diff --git a/ppapi/tests/test_fullscreen.cc b/ppapi/tests/test_fullscreen.cc
index 2a6edcd711d4b2400fc97c64728c9f7ceed9b596..2fddbdf9371e3234fffe64722913c2b1044249c2 100644
--- a/ppapi/tests/test_fullscreen.cc
+++ b/ppapi/tests/test_fullscreen.cc
@@ -56,9 +56,8 @@ TestFullscreen::TestFullscreen(TestingInstance* instance)
painted_color_(0),
fullscreen_pending_(false),
normal_pending_(false),
- set_fullscreen_true_callback_(instance->pp_instance()),
- fullscreen_callback_(instance->pp_instance()),
- normal_callback_(instance->pp_instance()) {
+ fullscreen_event_(instance->pp_instance()),
+ normal_event_(instance->pp_instance()) {
screen_mode_.GetScreenSize(&screen_size_);
}
@@ -115,7 +114,7 @@ std::string TestFullscreen::TestNormalToFullscreenToNormal() {
instance_->RequestInputEvents(PP_INPUTEVENT_CLASS_MOUSE);
SimulateUserGesture();
// DidChangeView() will call the callback once in fullscreen mode.
- fullscreen_callback_.WaitForResult();
+ fullscreen_event_.Wait();
if (GotError())
return Error();
if (fullscreen_pending_)
@@ -135,8 +134,8 @@ std::string TestFullscreen::TestNormalToFullscreenToNormal() {
normal_pending_ = true;
if (!screen_mode_.SetFullscreen(false))
return ReportError("SetFullscreen(false) in fullscreen", false);
- // DidChangeView() will call the callback once out of fullscreen mode.
- normal_callback_.WaitForResult();
+ // DidChangeView() will signal once out of fullscreen mode.
+ normal_event_.Wait();
if (GotError())
return Error();
if (normal_pending_)
@@ -174,20 +173,20 @@ void TestFullscreen::SimulateUserGesture() {
void TestFullscreen::FailFullscreenTest(const std::string& error) {
error_ = error;
- pp::Module::Get()->core()->CallOnMainThread(0, fullscreen_callback_);
+ fullscreen_event_.Signal();
}
void TestFullscreen::FailNormalTest(const std::string& error) {
error_ = error;
- pp::Module::Get()->core()->CallOnMainThread(0, normal_callback_);
+ normal_event_.Signal();
}
void TestFullscreen::PassFullscreenTest() {
- pp::Module::Get()->core()->CallOnMainThread(0, fullscreen_callback_);
+ fullscreen_event_.Signal();
}
void TestFullscreen::PassNormalTest() {
- pp::Module::Get()->core()->CallOnMainThread(0, normal_callback_);
+ normal_event_.Signal();
}
// Transition to fullscreen can only happen when processing a user gesture.
« no previous file with comments | « ppapi/tests/test_fullscreen.h ('k') | ppapi/tests/test_network_monitor_private.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698