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

Side by Side Diff: test/cctest/test-libplatform-default-platform.cc

Issue 363303002: Add an API to pump the message loop to libplatform (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« include/libplatform/libplatform.h ('K') | « test/cctest/cctest.gyp ('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
(Empty)
1 // Copyright 2014 the V8 project 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 #include "src/v8.h"
6
7 #include "src/libplatform/default-platform.h"
8 #include "test/cctest/cctest.h"
9 #include "test/cctest/test-libplatform.h"
10
11 using namespace v8::internal;
12 using namespace v8::platform;
13
14
15 TEST(DefaultPlatformMessagePump) {
16 TaskCounter task_counter;
17
18 DefaultPlatform* platform = new DefaultPlatform();
marja 2014/07/03 09:26:35 Nit: no need to allocate this on the heap really,
19
20 TestTask* task = new TestTask(&task_counter, true);
21
22 CHECK(!platform->PumpMessageLoop(CcTest::isolate()));
23
24 platform->CallOnForegroundThread(CcTest::isolate(), task);
25
26 CHECK_EQ(1, task_counter.GetCount());
27 CHECK(platform->PumpMessageLoop(CcTest::isolate()));
28 CHECK_EQ(0, task_counter.GetCount());
29 CHECK(!platform->PumpMessageLoop(CcTest::isolate()));
30 delete platform;
31 }
OLDNEW
« include/libplatform/libplatform.h ('K') | « test/cctest/cctest.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698