Commit e91234c1 authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

[heap] Correctly restore platform in IncrementalMarkingUsingTasks test.

Bug: 
Change-Id: I9003407826865f1befb0ea7de60aa9fce2766da7
Reviewed-on: https://chromium-review.googlesource.com/814675Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49955}
parent 1614388f
......@@ -33,11 +33,14 @@ namespace heap {
class MockPlatform : public TestPlatform {
public:
MockPlatform() : task_(nullptr) {
MockPlatform() : task_(nullptr), old_platform_(i::V8::GetCurrentPlatform()) {
// Now that it's completely constructed, make this the current platform.
i::V8::SetPlatformForTesting(this);
}
virtual ~MockPlatform() { delete task_; }
virtual ~MockPlatform() {
delete task_;
i::V8::SetPlatformForTesting(old_platform_);
}
void CallOnForegroundThread(v8::Isolate* isolate, Task* task) override {
task_ = task;
......@@ -56,6 +59,7 @@ class MockPlatform : public TestPlatform {
private:
Task* task_;
v8::Platform* old_platform_;
};
TEST(IncrementalMarkingUsingTasks) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment