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 "content/browser/gpu/browser_gpu_channel_host_factory.h" | 7 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
8 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 8 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
9 #include "content/common/gpu/client/context_provider_command_buffer.h" | 9 #include "content/common/gpu/client/context_provider_command_buffer.h" |
10 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 10 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 factory->EstablishGpuChannelSync(kInitCause)); | 40 factory->EstablishGpuChannelSync(kInitCause)); |
41 context_.reset( | 41 context_.reset( |
42 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( | 42 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( |
43 gpu_channel_host.get(), | 43 gpu_channel_host.get(), |
44 blink::WebGraphicsContext3D::Attributes(), | 44 blink::WebGraphicsContext3D::Attributes(), |
45 lose_context_when_out_of_memory, | 45 lose_context_when_out_of_memory, |
46 GURL(), | 46 GURL(), |
47 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits(), | 47 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits(), |
48 NULL)); | 48 NULL)); |
49 CHECK(context_.get()); | 49 CHECK(context_.get()); |
50 context_->makeContextCurrent(); | 50 context_->InitializeOnCurrentThread(); |
51 context_support_ = context_->GetContextSupport(); | 51 context_support_ = context_->GetContextSupport(); |
52 ContentBrowserTest::SetUpOnMainThread(); | 52 ContentBrowserTest::SetUpOnMainThread(); |
53 } | 53 } |
54 | 54 |
55 virtual void TearDownOnMainThread() OVERRIDE { | 55 virtual void TearDownOnMainThread() OVERRIDE { |
56 // Must delete the context first. | 56 // Must delete the context first. |
57 context_.reset(NULL); | 57 context_.reset(NULL); |
58 ContentBrowserTest::TearDownOnMainThread(); | 58 ContentBrowserTest::TearDownOnMainThread(); |
59 } | 59 } |
60 | 60 |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 shim->SimulateCrash(); | 186 shim->SimulateCrash(); |
187 run_loop.Run(); | 187 run_loop.Run(); |
188 | 188 |
189 EXPECT_EQ(1, counter); | 189 EXPECT_EQ(1, counter); |
190 EXPECT_FALSE(IsChannelEstablished()); | 190 EXPECT_FALSE(IsChannelEstablished()); |
191 EstablishAndWait(); | 191 EstablishAndWait(); |
192 EXPECT_TRUE(IsChannelEstablished()); | 192 EXPECT_TRUE(IsChannelEstablished()); |
193 } | 193 } |
194 | 194 |
195 } // namespace content | 195 } // namespace content |
OLD | NEW |