c1231d426f
BUG=none LOG=n R=marja@chromium.org Review URL: https://codereview.chromium.org/363303002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22187 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
31 lines
828 B
C++
31 lines
828 B
C++
// Copyright 2014 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#include "src/v8.h"
|
|
|
|
#include "src/libplatform/default-platform.h"
|
|
#include "test/cctest/cctest.h"
|
|
#include "test/cctest/test-libplatform.h"
|
|
|
|
using namespace v8::internal;
|
|
using namespace v8::platform;
|
|
|
|
|
|
TEST(DefaultPlatformMessagePump) {
|
|
TaskCounter task_counter;
|
|
|
|
DefaultPlatform platform;
|
|
|
|
TestTask* task = new TestTask(&task_counter, true);
|
|
|
|
CHECK(!platform.PumpMessageLoop(CcTest::isolate()));
|
|
|
|
platform.CallOnForegroundThread(CcTest::isolate(), task);
|
|
|
|
CHECK_EQ(1, task_counter.GetCount());
|
|
CHECK(platform.PumpMessageLoop(CcTest::isolate()));
|
|
CHECK_EQ(0, task_counter.GetCount());
|
|
CHECK(!platform.PumpMessageLoop(CcTest::isolate()));
|
|
}
|