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

Side by Side Diff: ppapi/tests/test_utils.cc

Issue 10790078: PPAPI: Make PPB_MessageLoop_Dev::GetForMainThread work (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: review comments Created 8 years, 3 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 unified diff | Download patch
« no previous file with comments | « ppapi/tests/test_utils.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ppapi/tests/test_utils.h" 5 #include "ppapi/tests/test_utils.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 #if defined(_MSC_VER) 9 #if defined(_MSC_VER)
10 #include <windows.h> 10 #include <windows.h>
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 GetTestingInterface()->RunMessageLoop(instance_); 82 GetTestingInterface()->RunMessageLoop(instance_);
83 waiting_ = false; 83 waiting_ = false;
84 } 84 }
85 85
86 void NestedEvent::Signal() { 86 void NestedEvent::Signal() {
87 signalled_ = true; 87 signalled_ = true;
88 if (waiting_) 88 if (waiting_)
89 GetTestingInterface()->QuitMessageLoop(instance_); 89 GetTestingInterface()->QuitMessageLoop(instance_);
90 } 90 }
91 91
92 void NestedEvent::Reset() {
93 // It doesn't make sense to reset when we're still waiting.
94 PP_DCHECK(!waiting_);
95 // We must have already been Signalled().
96 PP_DCHECK(signalled_);
97 signalled_ = false;
98 }
99
92 TestCompletionCallback::TestCompletionCallback(PP_Instance instance) 100 TestCompletionCallback::TestCompletionCallback(PP_Instance instance)
93 : wait_for_result_called_(false), 101 : wait_for_result_called_(false),
94 have_result_(false), 102 have_result_(false),
95 result_(PP_OK_COMPLETIONPENDING), 103 result_(PP_OK_COMPLETIONPENDING),
96 // TODO(dmichael): The default should probably be PP_REQUIRED, but this is 104 // TODO(dmichael): The default should probably be PP_REQUIRED, but this is
97 // what the tests currently expect. 105 // what the tests currently expect.
98 callback_type_(PP_OPTIONAL), 106 callback_type_(PP_OPTIONAL),
99 post_quit_task_(false), 107 post_quit_task_(false),
100 run_count_(0), // TODO(dmichael): Remove when all tests are updated. 108 run_count_(0), // TODO(dmichael): Remove when all tests are updated.
101 instance_(instance), 109 instance_(instance),
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 callback->have_result_ = true; 226 callback->have_result_ = true;
219 callback->run_count_++; // TODO(dmichael): Remove when all tests are updated. 227 callback->run_count_++; // TODO(dmichael): Remove when all tests are updated.
220 if (callback->delegate_) 228 if (callback->delegate_)
221 callback->delegate_->OnCallback(user_data, result); 229 callback->delegate_->OnCallback(user_data, result);
222 if (callback->post_quit_task_) { 230 if (callback->post_quit_task_) {
223 callback->post_quit_task_ = false; 231 callback->post_quit_task_ = false;
224 GetTestingInterface()->QuitMessageLoop(callback->instance_); 232 GetTestingInterface()->QuitMessageLoop(callback->instance_);
225 } 233 }
226 } 234 }
227 235
OLDNEW
« no previous file with comments | « ppapi/tests/test_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698