Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Side by Side Diff: gpu/ipc/common/struct_traits_unittest.cc

Issue 2579873002: gpu: Add missing entries for GPUInfo mojom. (Closed)
Patch Set: test Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gpu/ipc/common/gpu_info_struct_traits.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 EXPECT_EQ(max_resolution, output.max_resolution); 382 EXPECT_EQ(max_resolution, output.max_resolution);
383 EXPECT_EQ(min_resolution, output.min_resolution); 383 EXPECT_EQ(min_resolution, output.min_resolution);
384 EXPECT_FALSE(output.encrypted_only); 384 EXPECT_FALSE(output.encrypted_only);
385 } 385 }
386 386
387 TEST_F(StructTraitsTest, VideoDecodeAcceleratorCapabilities) { 387 TEST_F(StructTraitsTest, VideoDecodeAcceleratorCapabilities) {
388 const uint32_t flags = 1234; 388 const uint32_t flags = 1234;
389 389
390 gpu::VideoDecodeAcceleratorCapabilities input; 390 gpu::VideoDecodeAcceleratorCapabilities input;
391 input.flags = flags; 391 input.flags = flags;
392 input.supported_profiles.push_back(
393 gpu::VideoDecodeAcceleratorSupportedProfile());
394 input.supported_profiles.push_back(
395 gpu::VideoDecodeAcceleratorSupportedProfile());
sadrul 2016/12/15 21:28:53 I didn't set any attributes of these VideoDecodeAc
392 396
393 mojom::TraitsTestServicePtr proxy = GetTraitsTestProxy(); 397 mojom::TraitsTestServicePtr proxy = GetTraitsTestProxy();
394 gpu::VideoDecodeAcceleratorCapabilities output; 398 gpu::VideoDecodeAcceleratorCapabilities output;
395 proxy->EchoVideoDecodeAcceleratorCapabilities(input, &output); 399 proxy->EchoVideoDecodeAcceleratorCapabilities(input, &output);
396 EXPECT_EQ(flags, output.flags); 400 EXPECT_EQ(flags, output.flags);
401 EXPECT_EQ(input.supported_profiles.size(), output.supported_profiles.size());
397 } 402 }
398 403
399 TEST_F(StructTraitsTest, VideoEncodeAcceleratorSupportedProfile) { 404 TEST_F(StructTraitsTest, VideoEncodeAcceleratorSupportedProfile) {
400 const gpu::VideoCodecProfile profile = 405 const gpu::VideoCodecProfile profile =
401 gpu::VideoCodecProfile::H264PROFILE_MAIN; 406 gpu::VideoCodecProfile::H264PROFILE_MAIN;
402 const gfx::Size max_resolution(1920, 1080); 407 const gfx::Size max_resolution(1920, 1080);
403 const uint32_t max_framerate_numerator = 144; 408 const uint32_t max_framerate_numerator = 144;
404 const uint32_t max_framerate_denominator = 12; 409 const uint32_t max_framerate_denominator = 12;
405 410
406 gpu::VideoEncodeAcceleratorSupportedProfile input; 411 gpu::VideoEncodeAcceleratorSupportedProfile input;
407 input.profile = profile; 412 input.profile = profile;
408 input.max_resolution = max_resolution; 413 input.max_resolution = max_resolution;
409 input.max_framerate_numerator = max_framerate_numerator; 414 input.max_framerate_numerator = max_framerate_numerator;
410 input.max_framerate_denominator = max_framerate_denominator; 415 input.max_framerate_denominator = max_framerate_denominator;
411 416
412 mojom::TraitsTestServicePtr proxy = GetTraitsTestProxy(); 417 mojom::TraitsTestServicePtr proxy = GetTraitsTestProxy();
413 gpu::VideoEncodeAcceleratorSupportedProfile output; 418 gpu::VideoEncodeAcceleratorSupportedProfile output;
414 proxy->EchoVideoEncodeAcceleratorSupportedProfile(input, &output); 419 proxy->EchoVideoEncodeAcceleratorSupportedProfile(input, &output);
415 EXPECT_EQ(profile, output.profile); 420 EXPECT_EQ(profile, output.profile);
416 EXPECT_EQ(max_resolution, output.max_resolution); 421 EXPECT_EQ(max_resolution, output.max_resolution);
417 EXPECT_EQ(max_framerate_numerator, output.max_framerate_numerator); 422 EXPECT_EQ(max_framerate_numerator, output.max_framerate_numerator);
418 EXPECT_EQ(max_framerate_denominator, output.max_framerate_denominator); 423 EXPECT_EQ(max_framerate_denominator, output.max_framerate_denominator);
419 } 424 }
420 425
421 } // namespace gpu 426 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/ipc/common/gpu_info_struct_traits.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698