#include "src/libplatform/default-platform.h"
#include "src/base/platform/semaphore.h"
#include "src/base/platform/time.h"
#include "testing/gmock/include/gmock/gmock.h"
InSequence;
StrictMock;
namespace v8 {
namespace platform {
namespace default_platform_unittest {
namespace {
struct MockTask : public Task { … };
struct MockIdleTask : public IdleTask { … };
class DefaultPlatformWithMockTime : public DefaultPlatform { … };
double DefaultPlatformWithMockTime::mock_time_ = …;
template <typename Platform>
class PlatformTest : public ::testing::Test { … };
class DefaultPlatformTest : public PlatformTest<DefaultPlatform> { … };
class DefaultPlatformTestWithMockTime
: public PlatformTest<DefaultPlatformWithMockTime> { … };
}
TEST_F(DefaultPlatformTest, PumpMessageLoop) { … }
TEST_F(DefaultPlatformTest, PumpMessageLoopWithTaskRunner) { … }
TEST_F(DefaultPlatformTest, PumpMessageLoopNested) { … }
TEST_F(DefaultPlatformTestWithMockTime, PumpMessageLoopDelayed) { … }
TEST_F(DefaultPlatformTestWithMockTime, PumpMessageLoopNoStarvation) { … }
TEST_F(DefaultPlatformTestWithMockTime,
PendingDelayedTasksAreDestroyedOnShutdown) { … }
TEST_F(DefaultPlatformTestWithMockTime, RunIdleTasks) { … }
TEST_F(DefaultPlatformTestWithMockTime,
PendingIdleTasksAreDestroyedOnShutdown) { … }
namespace {
class TestBackgroundTask : public Task { … };
}
TEST(CustomDefaultPlatformTest, RunBackgroundTask) { … }
TEST(CustomDefaultPlatformTest, PostForegroundTaskAfterPlatformTermination) { … }
}
}
}