| 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 DCHECK(!IsChannelEstablished()); | 154 DCHECK(!IsChannelEstablished()); |
| 155 scoped_refptr<GpuChannelHost> gpu_channel = | 155 scoped_refptr<GpuChannelHost> gpu_channel = |
| 156 GetFactory()->EstablishGpuChannelSync(kInitCause); | 156 GetFactory()->EstablishGpuChannelSync(kInitCause); |
| 157 | 157 |
| 158 // Expect established callback immediately. | 158 // Expect established callback immediately. |
| 159 bool event = false; | 159 bool event = false; |
| 160 GetFactory()->EstablishGpuChannel( | 160 GetFactory()->EstablishGpuChannel( |
| 161 kInitCause, | 161 kInitCause, |
| 162 base::Bind(&BrowserGpuChannelHostFactoryTest::Signal, &event)); | 162 base::Bind(&BrowserGpuChannelHostFactoryTest::Signal, &event)); |
| 163 EXPECT_TRUE(event); | 163 EXPECT_TRUE(event); |
| 164 EXPECT_EQ(gpu_channel, GetGpuChannel()); | 164 EXPECT_EQ(gpu_channel.get(), GetGpuChannel()); |
| 165 } | 165 } |
| 166 | 166 |
| 167 // Fails since UI Compositor establishes a GpuChannel. | 167 // Fails since UI Compositor establishes a GpuChannel. |
| 168 IN_PROC_BROWSER_TEST_F(BrowserGpuChannelHostFactoryTest, | 168 IN_PROC_BROWSER_TEST_F(BrowserGpuChannelHostFactoryTest, |
| 169 DISABLED_CrashAndRecover) { | 169 DISABLED_CrashAndRecover) { |
| 170 DCHECK(!IsChannelEstablished()); | 170 DCHECK(!IsChannelEstablished()); |
| 171 EstablishAndWait(); | 171 EstablishAndWait(); |
| 172 scoped_refptr<GpuChannelHost> host = GetGpuChannel(); | 172 scoped_refptr<GpuChannelHost> host = GetGpuChannel(); |
| 173 | 173 |
| 174 scoped_refptr<ContextProviderCommandBuffer> provider = | 174 scoped_refptr<ContextProviderCommandBuffer> provider = |
| (...skipping 11 matching lines...) Expand all 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 |