OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" | 8 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
9 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 9 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
10 #include "content/common/gpu/client/context_provider_command_buffer.h" | 10 #include "content/common/gpu/client/context_provider_command_buffer.h" |
11 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 11 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
12 #include "content/common/gpu/gpu_process_launch_causes.h" | |
13 #include "content/public/browser/gpu_data_manager.h" | 12 #include "content/public/browser/gpu_data_manager.h" |
14 #include "content/public/common/content_switches.h" | 13 #include "content/public/common/content_switches.h" |
15 #include "content/public/test/content_browser_test.h" | 14 #include "content/public/test/content_browser_test.h" |
16 #include "gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.h" | 15 #include "gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.h" |
| 16 #include "gpu/ipc/common/gpu_process_launch_causes.h" |
17 #include "third_party/skia/include/core/SkCanvas.h" | 17 #include "third_party/skia/include/core/SkCanvas.h" |
18 #include "third_party/skia/include/core/SkSurface.h" | 18 #include "third_party/skia/include/core/SkSurface.h" |
19 #include "third_party/skia/include/gpu/GrContext.h" | 19 #include "third_party/skia/include/gpu/GrContext.h" |
20 #include "ui/gl/gl_switches.h" | 20 #include "ui/gl/gl_switches.h" |
21 | 21 |
22 namespace { | 22 namespace { |
23 | 23 |
24 using content::WebGraphicsContext3DCommandBufferImpl; | 24 using content::WebGraphicsContext3DCommandBufferImpl; |
25 | 25 |
26 const content::CauseForGpuLaunch kInitCause = | 26 const gpu::CauseForGpuLaunch kInitCause = |
27 content:: | 27 gpu::CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE; |
28 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE; | |
29 | 28 |
30 class ContextTestBase : public content::ContentBrowserTest { | 29 class ContextTestBase : public content::ContentBrowserTest { |
31 public: | 30 public: |
32 void SetUpOnMainThread() override { | 31 void SetUpOnMainThread() override { |
33 // This may leave the provider_ null in some cases, so tests need to early | 32 // This may leave the provider_ null in some cases, so tests need to early |
34 // out. | 33 // out. |
35 if (!content::BrowserGpuChannelHostFactory::CanUseForTesting()) | 34 if (!content::BrowserGpuChannelHostFactory::CanUseForTesting()) |
36 return; | 35 return; |
37 | 36 |
38 if (!content::BrowserGpuChannelHostFactory::instance()) | 37 if (!content::BrowserGpuChannelHostFactory::instance()) |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 shim->SimulateCrash(); | 278 shim->SimulateCrash(); |
280 run_loop.Run(); | 279 run_loop.Run(); |
281 | 280 |
282 EXPECT_EQ(1, counter); | 281 EXPECT_EQ(1, counter); |
283 EXPECT_FALSE(IsChannelEstablished()); | 282 EXPECT_FALSE(IsChannelEstablished()); |
284 EstablishAndWait(); | 283 EstablishAndWait(); |
285 EXPECT_TRUE(IsChannelEstablished()); | 284 EXPECT_TRUE(IsChannelEstablished()); |
286 } | 285 } |
287 | 286 |
288 } // namespace content | 287 } // namespace content |
OLD | NEW |