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/memory/ptr_util.h" | 6 #include "base/memory/ptr_util.h" |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" | 9 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
10 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 10 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 attributes.alpha_size = -1; | 34 attributes.alpha_size = -1; |
35 attributes.depth_size = 0; | 35 attributes.depth_size = 0; |
36 attributes.stencil_size = 0; | 36 attributes.stencil_size = 0; |
37 attributes.samples = 0; | 37 attributes.samples = 0; |
38 attributes.sample_buffers = 0; | 38 attributes.sample_buffers = 0; |
39 attributes.bind_generates_resource = false; | 39 attributes.bind_generates_resource = false; |
40 bool automatic_flushes = false; | 40 bool automatic_flushes = false; |
41 return make_scoped_refptr(new content::ContextProviderCommandBuffer( | 41 return make_scoped_refptr(new content::ContextProviderCommandBuffer( |
42 base::WrapUnique(new content::WebGraphicsContext3DCommandBufferImpl( | 42 base::WrapUnique(new content::WebGraphicsContext3DCommandBufferImpl( |
43 gpu::kNullSurfaceHandle, GURL(), std::move(gpu_channel_host), | 43 gpu::kNullSurfaceHandle, GURL(), std::move(gpu_channel_host), |
44 gfx::PreferIntegratedGpu, automatic_flushes)), | 44 gfx::PreferIntegratedGpu, automatic_flushes, gpu::GPU_STREAM_DEFAULT, |
| 45 gpu::GpuStreamPriority::NORMAL)), |
45 gpu::SharedMemoryLimits(), attributes, nullptr, | 46 gpu::SharedMemoryLimits(), attributes, nullptr, |
46 content::command_buffer_metrics::OFFSCREEN_CONTEXT_FOR_TESTING)); | 47 content::command_buffer_metrics::OFFSCREEN_CONTEXT_FOR_TESTING)); |
47 } | 48 } |
48 | 49 |
49 class ContextTestBase : public content::ContentBrowserTest { | 50 class ContextTestBase : public content::ContentBrowserTest { |
50 public: | 51 public: |
51 void SetUpOnMainThread() override { | 52 void SetUpOnMainThread() override { |
52 // This may leave the provider_ null in some cases, so tests need to early | 53 // This may leave the provider_ null in some cases, so tests need to early |
53 // out. | 54 // out. |
54 if (!content::BrowserGpuChannelHostFactory::CanUseForTesting()) | 55 if (!content::BrowserGpuChannelHostFactory::CanUseForTesting()) |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 shim->SimulateCrash(); | 285 shim->SimulateCrash(); |
285 run_loop.Run(); | 286 run_loop.Run(); |
286 | 287 |
287 EXPECT_EQ(1, counter); | 288 EXPECT_EQ(1, counter); |
288 EXPECT_FALSE(IsChannelEstablished()); | 289 EXPECT_FALSE(IsChannelEstablished()); |
289 EstablishAndWait(); | 290 EstablishAndWait(); |
290 EXPECT_TRUE(IsChannelEstablished()); | 291 EXPECT_TRUE(IsChannelEstablished()); |
291 } | 292 } |
292 | 293 |
293 } // namespace content | 294 } // namespace content |
OLD | NEW |