Commit 9301ea6a authored by Hajime Hoshi's avatar Hajime Hoshi Committed by Commit Bot

Reset the platform at MockPlatform in the test

This CL fixes the problem that the platform was set at MockPlatform's
constructor but was not reset.

Bug: v8:8527
Change-Id: I21c3b19320885b1b38999161db7cc1b8f15d798e
Reviewed-on: https://chromium-review.googlesource.com/c/1397821Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Hajime Hoshi <hajimehoshi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58574}
parent c68c3c6b
......@@ -25032,11 +25032,11 @@ namespace {
class MockPlatform : public TestPlatform {
public:
MockPlatform() {
MockPlatform() : old_platform_(i::V8::GetCurrentPlatform()) {
// Now that it's completely constructed, make this the current platform.
i::V8::SetPlatformForTesting(this);
}
~MockPlatform() override = default;
~MockPlatform() override { i::V8::SetPlatformForTesting(old_platform_); }
bool dump_without_crashing_called() const {
return dump_without_crashing_called_;
......@@ -25045,6 +25045,7 @@ class MockPlatform : public TestPlatform {
void DumpWithoutCrashing() override { dump_without_crashing_called_ = true; }
private:
v8::Platform* old_platform_;
bool dump_without_crashing_called_ = false;
};
......
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