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

Side by Side Diff: ppapi/tests/test_message_loop.h

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/shared_impl/resource_tracker.cc ('k') | ppapi/tests/test_message_loop.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef PAPPI_TESTS_TEST_MESSAGE_LOOP_H_
6 #define PAPPI_TESTS_TEST_MESSAGE_LOOP_H_
7
8 #include <string>
9
10 #include "ppapi/c/pp_stdint.h"
11 #include "ppapi/tests/test_case.h"
12 #include "ppapi/utility/completion_callback_factory.h"
13
14 namespace pp {
15 class MessageLoop;
16 }
17
18 class TestMessageLoop : public TestCase {
19 public:
20 explicit TestMessageLoop(TestingInstance* instance);
21 virtual ~TestMessageLoop();
22
23 private:
24 // TestCase implementation.
25 virtual void RunTests(const std::string& filter);
26
27 std::string TestBasics();
28 std::string TestPost();
29
30 // This just ensures we have a unique number for each little thing we test.
31 enum TestParam { kInvalid, kMainToMain, kBeforeStart, kAfterStart};
32
33 // A task to run on the main thread. It sets param_ and quits the main loop.
34 void SetParamAndQuitTask(int32_t result, TestParam param);
35
36 // A task to run on a background thread. It posts SetResultAndQuitTask to the
37 // main loop, echoing result.
38 void EchoParamToMainTask(int32_t result, TestParam param);
39
40 // The last test param we received in SetParamAndQuitTask (or kInvalid if
41 // none).
42 TestParam param_;
43 pp::CompletionCallbackFactory<TestMessageLoop> callback_factory_;
44 NestedEvent main_loop_task_ran_;
45 };
46
47 #endif // PAPPI_TESTS_TEST_MESSAGE_LOOP_H_
OLDNEW
« no previous file with comments | « ppapi/shared_impl/resource_tracker.cc ('k') | ppapi/tests/test_message_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698