Commit cc1ef743 authored by Igor Sheludko's avatar Igor Sheludko Committed by Commit Bot

[tsan] Avoid modifying flags back and forth for each microtask queue test

... but do it once for the whole group of tests instead.

Bug: v8:8929
Change-Id: I4c92a4cc29f8cf8a1011a563fe41972844c59972
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1511476Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60122}
parent 913efea6
......@@ -36,11 +36,11 @@ class BackgroundCompileTaskTest : public TestWithNativeContext {
static void SetUpTestCase() {
CHECK_NULL(save_flags_);
save_flags_ = new SaveFlags();
TestWithNativeContext ::SetUpTestCase();
TestWithNativeContext::SetUpTestCase();
}
static void TearDownTestCase() {
TestWithNativeContext ::TearDownTestCase();
TestWithNativeContext::TearDownTestCase();
CHECK_NOT_NULL(save_flags_);
delete save_flags_;
save_flags_ = nullptr;
......
......@@ -59,11 +59,11 @@ class CompilerDispatcherTest : public TestWithNativeContext {
static void SetUpTestCase() {
CompilerDispatcherTestFlags::SetFlagsForTest();
TestWithNativeContext ::SetUpTestCase();
TestWithNativeContext::SetUpTestCase();
}
static void TearDownTestCase() {
TestWithNativeContext ::TearDownTestCase();
TestWithNativeContext::TearDownTestCase();
CompilerDispatcherTestFlags::RestoreFlags();
}
......
......@@ -32,17 +32,33 @@ void RunStdFunction(void* data) {
template <typename TMixin>
class WithFinalizationGroupMixin : public TMixin {
public:
WithFinalizationGroupMixin() {
WithFinalizationGroupMixin() = default;
~WithFinalizationGroupMixin() override = default;
static void SetUpTestCase() {
CHECK_NULL(save_flags_);
save_flags_ = new SaveFlags();
FLAG_harmony_weak_refs = true;
FLAG_expose_gc = true;
TMixin::SetUpTestCase();
}
static void TearDownTestCase() {
TMixin::TearDownTestCase();
CHECK_NOT_NULL(save_flags_);
delete save_flags_;
save_flags_ = nullptr;
}
private:
SaveFlags save_flags_;
static SaveFlags* save_flags_;
DISALLOW_COPY_AND_ASSIGN(WithFinalizationGroupMixin);
};
template <typename TMixin>
SaveFlags* WithFinalizationGroupMixin<TMixin>::save_flags_ = nullptr;
using TestWithNativeContextAndFinalizationGroup = //
WithInternalIsolateMixin< //
WithContextMixin< //
......
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