Index: content/browser/gpu/gpu_ipc_browsertests.cc |
diff --git a/content/browser/gpu/gpu_ipc_browsertests.cc b/content/browser/gpu/gpu_ipc_browsertests.cc |
index 458e847d7a713c267ccd00e4f189f45cdcc67694..492ad85bdc730ff3654ff948a7cc1ff5cd54f572 100644 |
--- a/content/browser/gpu/gpu_ipc_browsertests.cc |
+++ b/content/browser/gpu/gpu_ipc_browsertests.cc |
@@ -10,6 +10,7 @@ |
#include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
#include "content/browser/gpu/gpu_process_host.h" |
#include "content/public/browser/gpu_data_manager.h" |
+#include "content/public/browser/gpu_utils.h" |
#include "content/public/common/content_switches.h" |
#include "content/public/test/content_browser_test.h" |
#include "services/ui/gpu/interfaces/gpu_service.mojom.h" |
@@ -284,9 +285,12 @@ IN_PROC_BROWSER_TEST_F(BrowserGpuChannelHostFactoryTest, |
base::Bind(&BrowserGpuChannelHostFactoryTest::OnContextLost, |
base::Unretained(this), run_loop.QuitClosure(), &counter)); |
EXPECT_TRUE(provider->BindToCurrentThread()); |
- GpuProcessHost::CallOnIO( |
- GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, false /* force_create */, |
- base::Bind([](GpuProcessHost* host) { host->gpu_service()->Crash(); })); |
+ GpuProcessHost::CallOnIO(GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, |
+ false /* force_create */, |
+ base::Bind([](GpuProcessHost* host) { |
+ if (host) |
+ host->gpu_service()->Crash(); |
+ })); |
run_loop.Run(); |
EXPECT_EQ(1, counter); |
@@ -295,4 +299,14 @@ IN_PROC_BROWSER_TEST_F(BrowserGpuChannelHostFactoryTest, |
EXPECT_TRUE(IsChannelEstablished()); |
} |
+using GpuProcessHostBrowserTest = BrowserGpuChannelHostFactoryTest; |
+ |
+IN_PROC_BROWSER_TEST_F(GpuProcessHostBrowserTest, Shutdown) { |
+ DCHECK(!IsChannelEstablished()); |
+ EstablishAndWait(); |
+ base::RunLoop run_loop; |
+ StopGpuProcess(run_loop.QuitClosure()); |
+ run_loop.Run(); |
+} |
+ |
} // namespace content |