Commit e6f505fe authored by Maggie Chen's avatar Maggie Chen Committed by Commit Bot

Should not create GpuDataManagerImpl in the IO thread in the content tests

Some content unit tests create GpuDataManagerImpl in the IO thread.
PeakGpuMemoryTrackerImpl needs GpuDataManagerImpl and GpuDataManagerImpl
is created it when PeakGpuMemoryTrackerImpl is running on the IO thread.

This will cause a crash (sequence checker) if the DisplayChange observer is
added. This CL makes sure GpuDataManagerImpl is created first in the test
setup so GpuDataManagerImpl will run on the main thread later.

Bug:1042989

Change-Id: I825937f800dfeeddf2d25b03e5e50bf418e6942e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2019882
Commit-Queue: Maggie Chen <magchen@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738217}
parent f75f6c3f
......@@ -16,6 +16,7 @@
#include "content/browser/frame_host/frame_tree_node.h"
#include "content/browser/frame_host/navigation_entry_impl.h"
#include "content/browser/frame_host/navigation_request.h"
#include "content/browser/gpu/gpu_data_manager_impl.h"
#include "content/browser/renderer_host/render_view_host_factory.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/site_instance_impl.h"
......@@ -263,6 +264,9 @@ void RenderViewHostTestHarness::SetUp() {
browser_context_ = CreateBrowserContext();
SetContents(CreateTestWebContents());
// Create GpuDataManagerImpl here so it always runs on the main thread.
GpuDataManagerImpl::GetInstance();
}
void RenderViewHostTestHarness::TearDown() {
......
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