| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include "content/common/gpu/establish_channel_params.h" | 8 #include "content/common/gpu/establish_channel_params.h" |
| 9 #include "content/common/gpu/gpu_channel.h" | 9 #include "content/common/gpu/gpu_channel.h" |
| 10 #include "content/common/gpu/gpu_channel_manager.h" | 10 #include "content/common/gpu/gpu_channel_manager.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 uint64_t kClientTracingId = 1; | 29 uint64_t kClientTracingId = 1; |
| 30 | 30 |
| 31 ASSERT_TRUE(channel_manager()); | 31 ASSERT_TRUE(channel_manager()); |
| 32 | 32 |
| 33 EstablishChannelParams params; | 33 EstablishChannelParams params; |
| 34 params.client_id = kClientId; | 34 params.client_id = kClientId; |
| 35 params.client_tracing_id = kClientTracingId; | 35 params.client_tracing_id = kClientTracingId; |
| 36 params.preempts = false; | 36 params.preempts = false; |
| 37 params.allow_view_command_buffers = false; | 37 params.allow_view_command_buffers = false; |
| 38 params.allow_real_time_streams = false; | 38 params.allow_real_time_streams = false; |
| 39 IPC::ChannelHandle channel_handle = | 39 IPC::ChannelHandle handle = channel_manager()->EstablishChannel(params); |
| 40 channel_manager()->EstablishChannel(params); | 40 EXPECT_NE("", handle.name); |
| 41 EXPECT_NE("", channel_handle.name); | |
| 42 | 41 |
| 43 GpuChannel* channel = channel_manager()->LookupChannel(kClientId); | 42 GpuChannel* channel = channel_manager()->LookupChannel(kClientId); |
| 44 ASSERT_TRUE(channel); | 43 ASSERT_TRUE(channel); |
| 45 EXPECT_EQ(channel_handle.name, channel->channel_id()); | 44 EXPECT_EQ(handle.name, channel->channel_id()); |
| 46 } | 45 } |
| 47 | 46 |
| 48 TEST_F(GpuChannelManagerTest, SecureValueStateForwarding) { | 47 TEST_F(GpuChannelManagerTest, SecureValueStateForwarding) { |
| 49 int32_t kClientId1 = 111; | 48 int32_t kClientId1 = 111; |
| 50 uint64_t kClientTracingId1 = 11111; | 49 uint64_t kClientTracingId1 = 11111; |
| 51 int32_t kClientId2 = 222; | 50 int32_t kClientId2 = 222; |
| 52 uint64_t kClientTracingId2 = 22222; | 51 uint64_t kClientTracingId2 = 22222; |
| 53 ValueState value_state1; | 52 ValueState value_state1; |
| 54 value_state1.int_value[0] = 1111; | 53 value_state1.int_value[0] = 1111; |
| 55 value_state1.int_value[1] = 0; | 54 value_state1.int_value[1] = 0; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 const ValueState* state2 = | 98 const ValueState* state2 = |
| 100 pending_value_buffer_state2->GetState(GL_MOUSE_POSITION_CHROMIUM); | 99 pending_value_buffer_state2->GetState(GL_MOUSE_POSITION_CHROMIUM); |
| 101 EXPECT_NE(state1, state2); | 100 EXPECT_NE(state1, state2); |
| 102 | 101 |
| 103 EXPECT_EQ(state1->int_value[0], value_state1.int_value[0]); | 102 EXPECT_EQ(state1->int_value[0], value_state1.int_value[0]); |
| 104 EXPECT_EQ(state2->int_value[0], value_state2.int_value[0]); | 103 EXPECT_EQ(state2->int_value[0], value_state2.int_value[0]); |
| 105 EXPECT_NE(state1->int_value[0], state2->int_value[0]); | 104 EXPECT_NE(state1->int_value[0], state2->int_value[0]); |
| 106 } | 105 } |
| 107 | 106 |
| 108 } // namespace content | 107 } // namespace content |
| OLD | NEW |