Commit 5562f2b6 authored by Hitoshi Yoshida's avatar Hitoshi Yoshida Committed by Commit Bot

Test: Ensure to run a GC after tests

ActivilyLoggerTest creates some GC objects like DOMWrapperWorld
which may be related to the global environment.
Without running a GC after the test, these objects are kept alive
and thus some statistics can show wrong values in the next test.
e.g. DOMWrapperWorld::NonMainWorldsExistInMainThread()


Bug: 1018970
Change-Id: Ib692c6593b121f187b6d70fa05a109135701b864
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1890373Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Hitoshi Yoshida <peria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711133}
parent cebb414b
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "third_party/blink/renderer/bindings/core/v8/script_controller.h" #include "third_party/blink/renderer/bindings/core/v8/script_controller.h"
#include "third_party/blink/renderer/bindings/core/v8/script_source_code.h" #include "third_party/blink/renderer/bindings/core/v8/script_source_code.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h" #include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_gc_controller.h"
#include "third_party/blink/renderer/core/frame/frame_test_helpers.h" #include "third_party/blink/renderer/core/frame/frame_test_helpers.h"
#include "third_party/blink/renderer/core/frame/web_local_frame_impl.h" #include "third_party/blink/renderer/core/frame/web_local_frame_impl.h"
#include "third_party/blink/renderer/platform/bindings/v8_dom_activity_logger.h" #include "third_party/blink/renderer/platform/bindings/v8_dom_activity_logger.h"
...@@ -84,7 +85,10 @@ class ActivityLoggerTest : public testing::Test { ...@@ -84,7 +85,10 @@ class ActivityLoggerTest : public testing::Test {
web_view_helper_.GetWebView()->MainFrameImpl(), "about:blank"); web_view_helper_.GetWebView()->MainFrameImpl(), "about:blank");
} }
~ActivityLoggerTest() override { WebCache::Clear(); } ~ActivityLoggerTest() override {
WebCache::Clear();
V8GCController::CollectAllGarbageForTesting(v8::Isolate::GetCurrent());
}
void ExecuteScriptInMainWorld(const String& script) const { void ExecuteScriptInMainWorld(const String& script) const {
v8::HandleScope scope(v8::Isolate::GetCurrent()); v8::HandleScope scope(v8::Isolate::GetCurrent());
......
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