Commit d56ef452 authored by Anton Bikineev's avatar Anton Bikineev Committed by Commit Bot

heap: Disable concurrent sweeping for tests that don't support it

Bug: 967258
Change-Id: I3f7f7b7b8c75d330364f74849e22205e60c3d323
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1697605
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: default avatarMichael Lippautz <mlippautz@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#676386}
parent 4cef55cc
...@@ -38,8 +38,10 @@ ...@@ -38,8 +38,10 @@
#include "base/location.h" #include "base/location.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/synchronization/waitable_event.h" #include "base/synchronization/waitable_event.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/platform/platform.h" #include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/renderer/platform/bindings/buildflags.h" #include "third_party/blink/renderer/platform/bindings/buildflags.h"
#include "third_party/blink/renderer/platform/heap/address_cache.h" #include "third_party/blink/renderer/platform/heap/address_cache.h"
...@@ -1872,6 +1874,11 @@ TEST(HeapTest, LazySweepingPages) { ...@@ -1872,6 +1874,11 @@ TEST(HeapTest, LazySweepingPages) {
} }
TEST(HeapTest, LazySweepingLargeObjectPages) { TEST(HeapTest, LazySweepingLargeObjectPages) {
// Disable concurrent sweeping to check lazy sweeping on allocation.
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndDisableFeature(
blink::features::kBlinkHeapConcurrentSweeping);
ClearOutOldGarbage(); ClearOutOldGarbage();
// Create free lists that can be reused for IntWrappers created in // Create free lists that can be reused for IntWrappers created in
......
...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
#include <initializer_list> #include <initializer_list>
#include "base/bind.h" #include "base/bind.h"
#include "base/test/scoped_feature_list.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h" #include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/heap/heap.h" #include "third_party/blink/renderer/platform/heap/heap.h"
#include "third_party/blink/renderer/platform/heap/heap_allocator.h" #include "third_party/blink/renderer/platform/heap/heap_allocator.h"
...@@ -1901,6 +1903,11 @@ TEST(IncrementalMarkingTest, AdjustMarkedBytesOnMarkedBackingStore) { ...@@ -1901,6 +1903,11 @@ TEST(IncrementalMarkingTest, AdjustMarkedBytesOnMarkedBackingStore) {
// marked bytes when the page is actually about to be swept and marking is not // marked bytes when the page is actually about to be swept and marking is not
// in progress. // in progress.
// Disable concurrent sweeping to check that sweeping is not in progress after
// the FinishGC call.
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndDisableFeature(
blink::features::kBlinkHeapConcurrentSweeping);
using Container = HeapVector<Member<Object>>; using Container = HeapVector<Member<Object>>;
Persistent<Container> holder(MakeGarbageCollected<Container>()); Persistent<Container> holder(MakeGarbageCollected<Container>());
holder->push_back(MakeGarbageCollected<Object>()); holder->push_back(MakeGarbageCollected<Object>());
......
...@@ -143,8 +143,10 @@ TEST(LifecycleContextTest, ObserverRemovedDuringNotifyDestroyed) { ...@@ -143,8 +143,10 @@ TEST(LifecycleContextTest, ObserverRemovedDuringNotifyDestroyed) {
// This is a regression test for http://crbug.com/854639. // This is a regression test for http://crbug.com/854639.
TEST(LifecycleContextTest, ShouldNotHitCFICheckOnIncrementalMarking) { TEST(LifecycleContextTest, ShouldNotHitCFICheckOnIncrementalMarking) {
base::test::ScopedFeatureList scoped_feature_list; base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndEnableFeature( // Disable concurrent sweeping as worker_pool task environment is not set.
blink::features::kBlinkHeapIncrementalMarking); scoped_feature_list.InitWithFeatures(
{blink::features::kBlinkHeapIncrementalMarking},
{blink::features::kBlinkHeapConcurrentSweeping});
ThreadState* thread_state = ThreadState::Current(); ThreadState* thread_state = ThreadState::Current();
thread_state->IncrementalMarkingStart(BlinkGC::GCReason::kForcedGCForTesting); thread_state->IncrementalMarkingStart(BlinkGC::GCReason::kForcedGCForTesting);
......
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