| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include "gpu/ipc/common/gpu_messages.h" | 7 #include "gpu/ipc/common/gpu_messages.h" |
| 8 #include "gpu/ipc/service/gpu_channel.h" | 8 #include "gpu/ipc/service/gpu_channel.h" |
| 9 #include "gpu/ipc/service/gpu_channel_test_common.h" | 9 #include "gpu/ipc/service/gpu_channel_test_common.h" |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 ASSERT_TRUE(channel); | 25 ASSERT_TRUE(channel); |
| 26 | 26 |
| 27 SurfaceHandle surface_handle = kFakeSurfaceHandle; | 27 SurfaceHandle surface_handle = kFakeSurfaceHandle; |
| 28 DCHECK_NE(surface_handle, kNullSurfaceHandle); | 28 DCHECK_NE(surface_handle, kNullSurfaceHandle); |
| 29 | 29 |
| 30 int32_t kRouteId = 1; | 30 int32_t kRouteId = 1; |
| 31 GPUCreateCommandBufferConfig init_params; | 31 GPUCreateCommandBufferConfig init_params; |
| 32 init_params.surface_handle = surface_handle; | 32 init_params.surface_handle = surface_handle; |
| 33 init_params.share_group_id = MSG_ROUTING_NONE; | 33 init_params.share_group_id = MSG_ROUTING_NONE; |
| 34 init_params.stream_id = 0; | 34 init_params.stream_id = 0; |
| 35 init_params.stream_priority = GpuStreamPriority::NORMAL; | 35 init_params.stream_priority = SchedulingPriority::kNormal; |
| 36 init_params.attribs = gles2::ContextCreationAttribHelper(); | 36 init_params.attribs = gles2::ContextCreationAttribHelper(); |
| 37 init_params.active_url = GURL(); | 37 init_params.active_url = GURL(); |
| 38 bool result = false; | 38 bool result = false; |
| 39 gpu::Capabilities capabilities; | 39 gpu::Capabilities capabilities; |
| 40 HandleMessage(channel, new GpuChannelMsg_CreateCommandBuffer( | 40 HandleMessage(channel, new GpuChannelMsg_CreateCommandBuffer( |
| 41 init_params, kRouteId, GetSharedHandle(), &result, | 41 init_params, kRouteId, GetSharedHandle(), &result, |
| 42 &capabilities)); | 42 &capabilities)); |
| 43 EXPECT_TRUE(result); | 43 EXPECT_TRUE(result); |
| 44 | 44 |
| 45 GpuCommandBufferStub* stub = channel->LookupCommandBuffer(kRouteId); | 45 GpuCommandBufferStub* stub = channel->LookupCommandBuffer(kRouteId); |
| 46 ASSERT_TRUE(stub); | 46 ASSERT_TRUE(stub); |
| 47 } | 47 } |
| 48 | 48 |
| 49 TEST_F(GpuChannelTest, CreateViewCommandBufferDisallowed) { | 49 TEST_F(GpuChannelTest, CreateViewCommandBufferDisallowed) { |
| 50 int32_t kClientId = 1; | 50 int32_t kClientId = 1; |
| 51 bool is_gpu_host = false; | 51 bool is_gpu_host = false; |
| 52 GpuChannel* channel = CreateChannel(kClientId, is_gpu_host); | 52 GpuChannel* channel = CreateChannel(kClientId, is_gpu_host); |
| 53 ASSERT_TRUE(channel); | 53 ASSERT_TRUE(channel); |
| 54 | 54 |
| 55 SurfaceHandle surface_handle = kFakeSurfaceHandle; | 55 SurfaceHandle surface_handle = kFakeSurfaceHandle; |
| 56 DCHECK_NE(surface_handle, kNullSurfaceHandle); | 56 DCHECK_NE(surface_handle, kNullSurfaceHandle); |
| 57 | 57 |
| 58 int32_t kRouteId = 1; | 58 int32_t kRouteId = 1; |
| 59 GPUCreateCommandBufferConfig init_params; | 59 GPUCreateCommandBufferConfig init_params; |
| 60 init_params.surface_handle = surface_handle; | 60 init_params.surface_handle = surface_handle; |
| 61 init_params.share_group_id = MSG_ROUTING_NONE; | 61 init_params.share_group_id = MSG_ROUTING_NONE; |
| 62 init_params.stream_id = 0; | 62 init_params.stream_id = 0; |
| 63 init_params.stream_priority = GpuStreamPriority::NORMAL; | 63 init_params.stream_priority = SchedulingPriority::kNormal; |
| 64 init_params.attribs = gles2::ContextCreationAttribHelper(); | 64 init_params.attribs = gles2::ContextCreationAttribHelper(); |
| 65 init_params.active_url = GURL(); | 65 init_params.active_url = GURL(); |
| 66 bool result = false; | 66 bool result = false; |
| 67 gpu::Capabilities capabilities; | 67 gpu::Capabilities capabilities; |
| 68 HandleMessage(channel, new GpuChannelMsg_CreateCommandBuffer( | 68 HandleMessage(channel, new GpuChannelMsg_CreateCommandBuffer( |
| 69 init_params, kRouteId, GetSharedHandle(), &result, | 69 init_params, kRouteId, GetSharedHandle(), &result, |
| 70 &capabilities)); | 70 &capabilities)); |
| 71 EXPECT_FALSE(result); | 71 EXPECT_FALSE(result); |
| 72 | 72 |
| 73 GpuCommandBufferStub* stub = channel->LookupCommandBuffer(kRouteId); | 73 GpuCommandBufferStub* stub = channel->LookupCommandBuffer(kRouteId); |
| 74 EXPECT_FALSE(stub); | 74 EXPECT_FALSE(stub); |
| 75 } | 75 } |
| 76 | 76 |
| 77 TEST_F(GpuChannelTest, CreateOffscreenCommandBuffer) { | 77 TEST_F(GpuChannelTest, CreateOffscreenCommandBuffer) { |
| 78 int32_t kClientId = 1; | 78 int32_t kClientId = 1; |
| 79 GpuChannel* channel = CreateChannel(kClientId, true); | 79 GpuChannel* channel = CreateChannel(kClientId, true); |
| 80 ASSERT_TRUE(channel); | 80 ASSERT_TRUE(channel); |
| 81 | 81 |
| 82 int32_t kRouteId = 1; | 82 int32_t kRouteId = 1; |
| 83 GPUCreateCommandBufferConfig init_params; | 83 GPUCreateCommandBufferConfig init_params; |
| 84 init_params.surface_handle = kNullSurfaceHandle; | 84 init_params.surface_handle = kNullSurfaceHandle; |
| 85 init_params.share_group_id = MSG_ROUTING_NONE; | 85 init_params.share_group_id = MSG_ROUTING_NONE; |
| 86 init_params.stream_id = 0; | 86 init_params.stream_id = 0; |
| 87 init_params.stream_priority = GpuStreamPriority::NORMAL; | 87 init_params.stream_priority = SchedulingPriority::kNormal; |
| 88 init_params.attribs = gles2::ContextCreationAttribHelper(); | 88 init_params.attribs = gles2::ContextCreationAttribHelper(); |
| 89 init_params.active_url = GURL(); | 89 init_params.active_url = GURL(); |
| 90 bool result = false; | 90 bool result = false; |
| 91 gpu::Capabilities capabilities; | 91 gpu::Capabilities capabilities; |
| 92 HandleMessage(channel, new GpuChannelMsg_CreateCommandBuffer( | 92 HandleMessage(channel, new GpuChannelMsg_CreateCommandBuffer( |
| 93 init_params, kRouteId, GetSharedHandle(), &result, | 93 init_params, kRouteId, GetSharedHandle(), &result, |
| 94 &capabilities)); | 94 &capabilities)); |
| 95 EXPECT_TRUE(result); | 95 EXPECT_TRUE(result); |
| 96 | 96 |
| 97 GpuCommandBufferStub* stub = channel->LookupCommandBuffer(kRouteId); | 97 GpuCommandBufferStub* stub = channel->LookupCommandBuffer(kRouteId); |
| 98 EXPECT_TRUE(stub); | 98 EXPECT_TRUE(stub); |
| 99 } | 99 } |
| 100 | 100 |
| 101 TEST_F(GpuChannelTest, IncompatibleStreamIds) { | 101 TEST_F(GpuChannelTest, IncompatibleStreamIds) { |
| 102 int32_t kClientId = 1; | 102 int32_t kClientId = 1; |
| 103 GpuChannel* channel = CreateChannel(kClientId, true); | 103 GpuChannel* channel = CreateChannel(kClientId, true); |
| 104 ASSERT_TRUE(channel); | 104 ASSERT_TRUE(channel); |
| 105 | 105 |
| 106 // Create first context. | 106 // Create first context. |
| 107 int32_t kRouteId1 = 1; | 107 int32_t kRouteId1 = 1; |
| 108 int32_t kStreamId1 = 1; | 108 int32_t kStreamId1 = 1; |
| 109 GPUCreateCommandBufferConfig init_params; | 109 GPUCreateCommandBufferConfig init_params; |
| 110 init_params.surface_handle = kNullSurfaceHandle; | 110 init_params.surface_handle = kNullSurfaceHandle; |
| 111 init_params.share_group_id = MSG_ROUTING_NONE; | 111 init_params.share_group_id = MSG_ROUTING_NONE; |
| 112 init_params.stream_id = kStreamId1; | 112 init_params.stream_id = kStreamId1; |
| 113 init_params.stream_priority = GpuStreamPriority::NORMAL; | 113 init_params.stream_priority = SchedulingPriority::kNormal; |
| 114 init_params.attribs = gles2::ContextCreationAttribHelper(); | 114 init_params.attribs = gles2::ContextCreationAttribHelper(); |
| 115 init_params.active_url = GURL(); | 115 init_params.active_url = GURL(); |
| 116 bool result = false; | 116 bool result = false; |
| 117 gpu::Capabilities capabilities; | 117 gpu::Capabilities capabilities; |
| 118 HandleMessage(channel, new GpuChannelMsg_CreateCommandBuffer( | 118 HandleMessage(channel, new GpuChannelMsg_CreateCommandBuffer( |
| 119 init_params, kRouteId1, GetSharedHandle(), &result, | 119 init_params, kRouteId1, GetSharedHandle(), &result, |
| 120 &capabilities)); | 120 &capabilities)); |
| 121 EXPECT_TRUE(result); | 121 EXPECT_TRUE(result); |
| 122 | 122 |
| 123 GpuCommandBufferStub* stub = channel->LookupCommandBuffer(kRouteId1); | 123 GpuCommandBufferStub* stub = channel->LookupCommandBuffer(kRouteId1); |
| 124 EXPECT_TRUE(stub); | 124 EXPECT_TRUE(stub); |
| 125 | 125 |
| 126 // Create second context in same share group but different stream. | 126 // Create second context in same share group but different stream. |
| 127 int32_t kRouteId2 = 2; | 127 int32_t kRouteId2 = 2; |
| 128 int32_t kStreamId2 = 2; | 128 int32_t kStreamId2 = 2; |
| 129 | 129 |
| 130 init_params.share_group_id = kRouteId1; | 130 init_params.share_group_id = kRouteId1; |
| 131 init_params.stream_id = kStreamId2; | 131 init_params.stream_id = kStreamId2; |
| 132 init_params.stream_priority = GpuStreamPriority::NORMAL; | 132 init_params.stream_priority = SchedulingPriority::kNormal; |
| 133 init_params.attribs = gles2::ContextCreationAttribHelper(); | 133 init_params.attribs = gles2::ContextCreationAttribHelper(); |
| 134 init_params.active_url = GURL(); | 134 init_params.active_url = GURL(); |
| 135 HandleMessage(channel, new GpuChannelMsg_CreateCommandBuffer( | 135 HandleMessage(channel, new GpuChannelMsg_CreateCommandBuffer( |
| 136 init_params, kRouteId2, GetSharedHandle(), &result, | 136 init_params, kRouteId2, GetSharedHandle(), &result, |
| 137 &capabilities)); | 137 &capabilities)); |
| 138 EXPECT_FALSE(result); | 138 EXPECT_FALSE(result); |
| 139 | 139 |
| 140 stub = channel->LookupCommandBuffer(kRouteId2); | 140 stub = channel->LookupCommandBuffer(kRouteId2); |
| 141 EXPECT_FALSE(stub); | 141 EXPECT_FALSE(stub); |
| 142 } | 142 } |
| 143 | 143 |
| 144 TEST_F(GpuChannelTest, RealTimeStreamsDisallowed) { | 144 TEST_F(GpuChannelTest, HighPriorityStreamsDisallowed) { |
| 145 int32_t kClientId = 1; | 145 int32_t kClientId = 1; |
| 146 bool is_gpu_host = false; | 146 bool is_gpu_host = false; |
| 147 GpuChannel* channel = CreateChannel(kClientId, is_gpu_host); | 147 GpuChannel* channel = CreateChannel(kClientId, is_gpu_host); |
| 148 ASSERT_TRUE(channel); | 148 ASSERT_TRUE(channel); |
| 149 | 149 |
| 150 // Create first context. | 150 // Highest priority is disallowed. |
| 151 int32_t kRouteId = 1; | 151 int32_t kRouteId = 1; |
| 152 int32_t kStreamId = 1; | 152 int32_t kStreamId = 1; |
| 153 GpuStreamPriority kStreamPriority = GpuStreamPriority::REAL_TIME; | |
| 154 GPUCreateCommandBufferConfig init_params; | 153 GPUCreateCommandBufferConfig init_params; |
| 155 init_params.surface_handle = kNullSurfaceHandle; | 154 init_params.surface_handle = kNullSurfaceHandle; |
| 156 init_params.share_group_id = MSG_ROUTING_NONE; | 155 init_params.share_group_id = MSG_ROUTING_NONE; |
| 157 init_params.stream_id = kStreamId; | 156 init_params.stream_id = kStreamId; |
| 158 init_params.stream_priority = kStreamPriority; | 157 init_params.stream_priority = SchedulingPriority::kHighest; |
| 159 init_params.attribs = gles2::ContextCreationAttribHelper(); | 158 init_params.attribs = gles2::ContextCreationAttribHelper(); |
| 160 init_params.active_url = GURL(); | 159 init_params.active_url = GURL(); |
| 161 bool result = false; | 160 bool result = false; |
| 162 gpu::Capabilities capabilities; | 161 gpu::Capabilities capabilities; |
| 163 HandleMessage(channel, new GpuChannelMsg_CreateCommandBuffer( | 162 HandleMessage(channel, new GpuChannelMsg_CreateCommandBuffer( |
| 164 init_params, kRouteId, GetSharedHandle(), &result, | 163 init_params, kRouteId, GetSharedHandle(), &result, |
| 165 &capabilities)); | 164 &capabilities)); |
| 166 EXPECT_FALSE(result); | 165 EXPECT_FALSE(result); |
| 166 EXPECT_FALSE(channel->LookupCommandBuffer(kRouteId)); |
| 167 | 167 |
| 168 GpuCommandBufferStub* stub = channel->LookupCommandBuffer(kRouteId); | 168 // High priority is also disallowed. |
| 169 EXPECT_FALSE(stub); | 169 init_params.stream_priority = SchedulingPriority::kHigh; |
| 170 HandleMessage(channel, new GpuChannelMsg_CreateCommandBuffer( |
| 171 init_params, kRouteId, GetSharedHandle(), &result, |
| 172 &capabilities)); |
| 173 EXPECT_FALSE(result); |
| 174 EXPECT_FALSE(channel->LookupCommandBuffer(kRouteId)); |
| 170 } | 175 } |
| 171 | 176 |
| 172 TEST_F(GpuChannelTest, RealTimeStreamsAllowed) { | 177 TEST_F(GpuChannelTest, HighPriorityStreamsAllowed) { |
| 173 int32_t kClientId = 1; | 178 int32_t kClientId = 1; |
| 174 bool is_gpu_host = true; | 179 bool is_gpu_host = true; |
| 175 GpuChannel* channel = CreateChannel(kClientId, is_gpu_host); | 180 GpuChannel* channel = CreateChannel(kClientId, is_gpu_host); |
| 176 ASSERT_TRUE(channel); | 181 ASSERT_TRUE(channel); |
| 177 | 182 |
| 178 // Create first context. | 183 // Highest priority is allowed. |
| 179 int32_t kRouteId = 1; | 184 int32_t kRouteId1 = 1; |
| 180 int32_t kStreamId = 1; | |
| 181 GpuStreamPriority kStreamPriority = GpuStreamPriority::REAL_TIME; | |
| 182 GPUCreateCommandBufferConfig init_params; | 185 GPUCreateCommandBufferConfig init_params; |
| 183 init_params.surface_handle = kNullSurfaceHandle; | 186 init_params.surface_handle = kNullSurfaceHandle; |
| 184 init_params.share_group_id = MSG_ROUTING_NONE; | 187 init_params.share_group_id = MSG_ROUTING_NONE; |
| 185 init_params.stream_id = kStreamId; | 188 init_params.stream_id = 1; |
| 186 init_params.stream_priority = kStreamPriority; | 189 init_params.stream_priority = SchedulingPriority::kHighest; |
| 187 init_params.attribs = gles2::ContextCreationAttribHelper(); | 190 init_params.attribs = gles2::ContextCreationAttribHelper(); |
| 188 init_params.active_url = GURL(); | 191 init_params.active_url = GURL(); |
| 189 bool result = false; | 192 bool result = false; |
| 190 gpu::Capabilities capabilities; | 193 gpu::Capabilities capabilities; |
| 191 HandleMessage(channel, new GpuChannelMsg_CreateCommandBuffer( | 194 HandleMessage(channel, new GpuChannelMsg_CreateCommandBuffer( |
| 192 init_params, kRouteId, GetSharedHandle(), &result, | 195 init_params, kRouteId1, GetSharedHandle(), &result, |
| 193 &capabilities)); | 196 &capabilities)); |
| 194 EXPECT_TRUE(result); | 197 EXPECT_TRUE(result); |
| 198 EXPECT_TRUE(channel->LookupCommandBuffer(kRouteId1)); |
| 195 | 199 |
| 196 GpuCommandBufferStub* stub = channel->LookupCommandBuffer(kRouteId); | 200 // High priority is also allowed. |
| 197 EXPECT_TRUE(stub); | 201 int32_t kRouteId2 = 2; |
| 202 init_params.stream_id = 2; |
| 203 init_params.stream_priority = SchedulingPriority::kHigh; |
| 204 result = false; |
| 205 HandleMessage(channel, new GpuChannelMsg_CreateCommandBuffer( |
| 206 init_params, kRouteId2, GetSharedHandle(), &result, |
| 207 &capabilities)); |
| 208 EXPECT_TRUE(result); |
| 209 EXPECT_TRUE(channel->LookupCommandBuffer(kRouteId2)); |
| 198 } | 210 } |
| 199 | 211 |
| 200 TEST_F(GpuChannelTest, CreateFailsIfSharedContextIsLost) { | 212 TEST_F(GpuChannelTest, CreateFailsIfSharedContextIsLost) { |
| 201 int32_t kClientId = 1; | 213 int32_t kClientId = 1; |
| 202 GpuChannel* channel = CreateChannel(kClientId, false); | 214 GpuChannel* channel = CreateChannel(kClientId, false); |
| 203 ASSERT_TRUE(channel); | 215 ASSERT_TRUE(channel); |
| 204 | 216 |
| 205 // Create first context, we will share this one. | 217 // Create first context, we will share this one. |
| 206 int32_t kSharedRouteId = 1; | 218 int32_t kSharedRouteId = 1; |
| 207 { | 219 { |
| 208 SCOPED_TRACE("kSharedRouteId"); | 220 SCOPED_TRACE("kSharedRouteId"); |
| 209 GPUCreateCommandBufferConfig init_params; | 221 GPUCreateCommandBufferConfig init_params; |
| 210 init_params.surface_handle = kNullSurfaceHandle; | 222 init_params.surface_handle = kNullSurfaceHandle; |
| 211 init_params.share_group_id = MSG_ROUTING_NONE; | 223 init_params.share_group_id = MSG_ROUTING_NONE; |
| 212 init_params.stream_id = 0; | 224 init_params.stream_id = 0; |
| 213 init_params.stream_priority = GpuStreamPriority::NORMAL; | 225 init_params.stream_priority = SchedulingPriority::kNormal; |
| 214 init_params.attribs = gles2::ContextCreationAttribHelper(); | 226 init_params.attribs = gles2::ContextCreationAttribHelper(); |
| 215 init_params.active_url = GURL(); | 227 init_params.active_url = GURL(); |
| 216 bool result = false; | 228 bool result = false; |
| 217 gpu::Capabilities capabilities; | 229 gpu::Capabilities capabilities; |
| 218 HandleMessage(channel, new GpuChannelMsg_CreateCommandBuffer( | 230 HandleMessage(channel, new GpuChannelMsg_CreateCommandBuffer( |
| 219 init_params, kSharedRouteId, GetSharedHandle(), | 231 init_params, kSharedRouteId, GetSharedHandle(), |
| 220 &result, &capabilities)); | 232 &result, &capabilities)); |
| 221 EXPECT_TRUE(result); | 233 EXPECT_TRUE(result); |
| 222 } | 234 } |
| 223 EXPECT_TRUE(channel->LookupCommandBuffer(kSharedRouteId)); | 235 EXPECT_TRUE(channel->LookupCommandBuffer(kSharedRouteId)); |
| 224 | 236 |
| 225 // This context shares with the first one, this should be possible. | 237 // This context shares with the first one, this should be possible. |
| 226 int32_t kFriendlyRouteId = 2; | 238 int32_t kFriendlyRouteId = 2; |
| 227 { | 239 { |
| 228 SCOPED_TRACE("kFriendlyRouteId"); | 240 SCOPED_TRACE("kFriendlyRouteId"); |
| 229 GPUCreateCommandBufferConfig init_params; | 241 GPUCreateCommandBufferConfig init_params; |
| 230 init_params.surface_handle = kNullSurfaceHandle; | 242 init_params.surface_handle = kNullSurfaceHandle; |
| 231 init_params.share_group_id = kSharedRouteId; | 243 init_params.share_group_id = kSharedRouteId; |
| 232 init_params.stream_id = 0; | 244 init_params.stream_id = 0; |
| 233 init_params.stream_priority = GpuStreamPriority::NORMAL; | 245 init_params.stream_priority = SchedulingPriority::kNormal; |
| 234 init_params.attribs = gles2::ContextCreationAttribHelper(); | 246 init_params.attribs = gles2::ContextCreationAttribHelper(); |
| 235 init_params.active_url = GURL(); | 247 init_params.active_url = GURL(); |
| 236 bool result = false; | 248 bool result = false; |
| 237 gpu::Capabilities capabilities; | 249 gpu::Capabilities capabilities; |
| 238 HandleMessage(channel, new GpuChannelMsg_CreateCommandBuffer( | 250 HandleMessage(channel, new GpuChannelMsg_CreateCommandBuffer( |
| 239 init_params, kFriendlyRouteId, GetSharedHandle(), | 251 init_params, kFriendlyRouteId, GetSharedHandle(), |
| 240 &result, &capabilities)); | 252 &result, &capabilities)); |
| 241 EXPECT_TRUE(result); | 253 EXPECT_TRUE(result); |
| 242 } | 254 } |
| 243 EXPECT_TRUE(channel->LookupCommandBuffer(kFriendlyRouteId)); | 255 EXPECT_TRUE(channel->LookupCommandBuffer(kFriendlyRouteId)); |
| 244 | 256 |
| 245 // The shared context is lost. | 257 // The shared context is lost. |
| 246 channel->LookupCommandBuffer(kSharedRouteId)->MarkContextLost(); | 258 channel->LookupCommandBuffer(kSharedRouteId)->MarkContextLost(); |
| 247 | 259 |
| 248 // Meanwhile another context is being made pointing to the shared one. This | 260 // Meanwhile another context is being made pointing to the shared one. This |
| 249 // should fail. | 261 // should fail. |
| 250 int32_t kAnotherRouteId = 3; | 262 int32_t kAnotherRouteId = 3; |
| 251 { | 263 { |
| 252 SCOPED_TRACE("kAnotherRouteId"); | 264 SCOPED_TRACE("kAnotherRouteId"); |
| 253 GPUCreateCommandBufferConfig init_params; | 265 GPUCreateCommandBufferConfig init_params; |
| 254 init_params.surface_handle = kNullSurfaceHandle; | 266 init_params.surface_handle = kNullSurfaceHandle; |
| 255 init_params.share_group_id = kSharedRouteId; | 267 init_params.share_group_id = kSharedRouteId; |
| 256 init_params.stream_id = 0; | 268 init_params.stream_id = 0; |
| 257 init_params.stream_priority = GpuStreamPriority::NORMAL; | 269 init_params.stream_priority = SchedulingPriority::kNormal; |
| 258 init_params.attribs = gles2::ContextCreationAttribHelper(); | 270 init_params.attribs = gles2::ContextCreationAttribHelper(); |
| 259 init_params.active_url = GURL(); | 271 init_params.active_url = GURL(); |
| 260 bool result = false; | 272 bool result = false; |
| 261 gpu::Capabilities capabilities; | 273 gpu::Capabilities capabilities; |
| 262 HandleMessage(channel, new GpuChannelMsg_CreateCommandBuffer( | 274 HandleMessage(channel, new GpuChannelMsg_CreateCommandBuffer( |
| 263 init_params, kAnotherRouteId, GetSharedHandle(), | 275 init_params, kAnotherRouteId, GetSharedHandle(), |
| 264 &result, &capabilities)); | 276 &result, &capabilities)); |
| 265 EXPECT_FALSE(result); | 277 EXPECT_FALSE(result); |
| 266 } | 278 } |
| 267 EXPECT_FALSE(channel->LookupCommandBuffer(kAnotherRouteId)); | 279 EXPECT_FALSE(channel->LookupCommandBuffer(kAnotherRouteId)); |
| 268 | 280 |
| 269 // The lost context is still around though (to verify the failure happened due | 281 // The lost context is still around though (to verify the failure happened due |
| 270 // to the shared context being lost, not due to it being deleted). | 282 // to the shared context being lost, not due to it being deleted). |
| 271 EXPECT_TRUE(channel->LookupCommandBuffer(kSharedRouteId)); | 283 EXPECT_TRUE(channel->LookupCommandBuffer(kSharedRouteId)); |
| 272 | 284 |
| 273 // Destroy the command buffers we initialized before destoying GL. | 285 // Destroy the command buffers we initialized before destoying GL. |
| 274 HandleMessage(channel, | 286 HandleMessage(channel, |
| 275 new GpuChannelMsg_DestroyCommandBuffer(kFriendlyRouteId)); | 287 new GpuChannelMsg_DestroyCommandBuffer(kFriendlyRouteId)); |
| 276 HandleMessage(channel, | 288 HandleMessage(channel, |
| 277 new GpuChannelMsg_DestroyCommandBuffer(kSharedRouteId)); | 289 new GpuChannelMsg_DestroyCommandBuffer(kSharedRouteId)); |
| 278 } | 290 } |
| 279 | 291 |
| 280 } // namespace gpu | 292 } // namespace gpu |
| OLD | NEW |