| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "gpu/ipc/common/traits_test_service.mojom.h" | 8 #include "gpu/ipc/common/traits_test_service.mojom.h" |
| 9 #include "mojo/public/cpp/bindings/binding_set.h" | 9 #include "mojo/public/cpp/bindings/binding_set.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 TEST_F(StructTraitsTest, EmptyGpuInfo) { | 293 TEST_F(StructTraitsTest, EmptyGpuInfo) { |
| 294 gpu::GPUInfo input; | 294 gpu::GPUInfo input; |
| 295 mojom::TraitsTestServicePtr proxy = GetTraitsTestProxy(); | 295 mojom::TraitsTestServicePtr proxy = GetTraitsTestProxy(); |
| 296 gpu::GPUInfo output; | 296 gpu::GPUInfo output; |
| 297 proxy->EchoGpuInfo(input, &output); | 297 proxy->EchoGpuInfo(input, &output); |
| 298 EXPECT_FALSE(output.display_link_version.IsValid()); | 298 EXPECT_FALSE(output.display_link_version.IsValid()); |
| 299 } | 299 } |
| 300 | 300 |
| 301 TEST_F(StructTraitsTest, Mailbox) { | 301 TEST_F(StructTraitsTest, Mailbox) { |
| 302 const int8_t mailbox_name[GL_MAILBOX_SIZE_CHROMIUM] = { | 302 const int8_t mailbox_name[GL_MAILBOX_SIZE_CHROMIUM] = { |
| 303 0, 9, 8, 7, 6, 5, 4, 3, 2, 1, 9, 7, 5, 3, 1, 2, 4, 6, 8, 0, 0, 9, | 303 0, 9, 8, 7, 6, 5, 4, 3, 2, 1, 9, 7, 5, 3, 1, 2}; |
| 304 8, 7, 6, 5, 4, 3, 2, 1, 9, 7, 5, 3, 1, 2, 4, 6, 8, 0, 0, 9, 8, 7, | |
| 305 6, 5, 4, 3, 2, 1, 9, 7, 5, 3, 1, 2, 4, 6, 8, 0, 0, 9, 8, 7}; | |
| 306 gpu::Mailbox input; | 304 gpu::Mailbox input; |
| 307 input.SetName(mailbox_name); | 305 input.SetName(mailbox_name); |
| 308 mojom::TraitsTestServicePtr proxy = GetTraitsTestProxy(); | 306 mojom::TraitsTestServicePtr proxy = GetTraitsTestProxy(); |
| 309 gpu::Mailbox output; | 307 gpu::Mailbox output; |
| 310 proxy->EchoMailbox(input, &output); | 308 proxy->EchoMailbox(input, &output); |
| 311 gpu::Mailbox test_mailbox; | 309 gpu::Mailbox test_mailbox; |
| 312 test_mailbox.SetName(mailbox_name); | 310 test_mailbox.SetName(mailbox_name); |
| 313 EXPECT_EQ(test_mailbox, output); | 311 EXPECT_EQ(test_mailbox, output); |
| 314 } | 312 } |
| 315 | 313 |
| 316 TEST_F(StructTraitsTest, MailboxHolder) { | 314 TEST_F(StructTraitsTest, MailboxHolder) { |
| 317 gpu::MailboxHolder input; | 315 gpu::MailboxHolder input; |
| 318 const int8_t mailbox_name[GL_MAILBOX_SIZE_CHROMIUM] = { | 316 const int8_t mailbox_name[GL_MAILBOX_SIZE_CHROMIUM] = { |
| 319 0, 9, 8, 7, 6, 5, 4, 3, 2, 1, 9, 7, 5, 3, 1, 2, 4, 6, 8, 0, 0, 9, | 317 0, 9, 8, 7, 6, 5, 4, 3, 2, 1, 9, 7, 5, 3, 1, 2}; |
| 320 8, 7, 6, 5, 4, 3, 2, 1, 9, 7, 5, 3, 1, 2, 4, 6, 8, 0, 0, 9, 8, 7, | |
| 321 6, 5, 4, 3, 2, 1, 9, 7, 5, 3, 1, 2, 4, 6, 8, 0, 0, 9, 8, 7}; | |
| 322 gpu::Mailbox mailbox; | 318 gpu::Mailbox mailbox; |
| 323 mailbox.SetName(mailbox_name); | 319 mailbox.SetName(mailbox_name); |
| 324 const gpu::CommandBufferNamespace namespace_id = gpu::IN_PROCESS; | 320 const gpu::CommandBufferNamespace namespace_id = gpu::IN_PROCESS; |
| 325 const int32_t extra_data_field = 0xbeefbeef; | 321 const int32_t extra_data_field = 0xbeefbeef; |
| 326 const gpu::CommandBufferId command_buffer_id( | 322 const gpu::CommandBufferId command_buffer_id( |
| 327 gpu::CommandBufferId::FromUnsafeValue(0xdeadbeef)); | 323 gpu::CommandBufferId::FromUnsafeValue(0xdeadbeef)); |
| 328 const uint64_t release_count = 0xdeadbeefdeadL; | 324 const uint64_t release_count = 0xdeadbeefdeadL; |
| 329 const gpu::SyncToken sync_token(namespace_id, extra_data_field, | 325 const gpu::SyncToken sync_token(namespace_id, extra_data_field, |
| 330 command_buffer_id, release_count); | 326 command_buffer_id, release_count); |
| 331 const uint32_t texture_target = 1337; | 327 const uint32_t texture_target = 1337; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 mojom::TraitsTestServicePtr proxy = GetTraitsTestProxy(); | 409 mojom::TraitsTestServicePtr proxy = GetTraitsTestProxy(); |
| 414 gpu::VideoEncodeAcceleratorSupportedProfile output; | 410 gpu::VideoEncodeAcceleratorSupportedProfile output; |
| 415 proxy->EchoVideoEncodeAcceleratorSupportedProfile(input, &output); | 411 proxy->EchoVideoEncodeAcceleratorSupportedProfile(input, &output); |
| 416 EXPECT_EQ(profile, output.profile); | 412 EXPECT_EQ(profile, output.profile); |
| 417 EXPECT_EQ(max_resolution, output.max_resolution); | 413 EXPECT_EQ(max_resolution, output.max_resolution); |
| 418 EXPECT_EQ(max_framerate_numerator, output.max_framerate_numerator); | 414 EXPECT_EQ(max_framerate_numerator, output.max_framerate_numerator); |
| 419 EXPECT_EQ(max_framerate_denominator, output.max_framerate_denominator); | 415 EXPECT_EQ(max_framerate_denominator, output.max_framerate_denominator); |
| 420 } | 416 } |
| 421 | 417 |
| 422 } // namespace gpu | 418 } // namespace gpu |
| OLD | NEW |