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 <algorithm> | 5 #include <algorithm> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "gpu/config/gpu_feature_type.h" | 9 #include "gpu/config/gpu_feature_type.h" |
10 #include "gpu/ipc/common/gpu_feature_info.mojom.h" | 10 #include "gpu/ipc/common/gpu_feature_info.mojom.h" |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 EXPECT_EQ(max_resolution, output.max_resolution); | 423 EXPECT_EQ(max_resolution, output.max_resolution); |
424 EXPECT_EQ(max_framerate_numerator, output.max_framerate_numerator); | 424 EXPECT_EQ(max_framerate_numerator, output.max_framerate_numerator); |
425 EXPECT_EQ(max_framerate_denominator, output.max_framerate_denominator); | 425 EXPECT_EQ(max_framerate_denominator, output.max_framerate_denominator); |
426 } | 426 } |
427 | 427 |
428 TEST_F(StructTraitsTest, GpuPreferences) { | 428 TEST_F(StructTraitsTest, GpuPreferences) { |
429 GpuPreferences prefs; | 429 GpuPreferences prefs; |
430 prefs.single_process = true; | 430 prefs.single_process = true; |
431 prefs.in_process_gpu = true; | 431 prefs.in_process_gpu = true; |
432 prefs.ui_prioritize_in_gpu_process = true; | 432 prefs.ui_prioritize_in_gpu_process = true; |
| 433 prefs.enable_gpu_scheduler = true; |
433 #if defined(OS_WIN) | 434 #if defined(OS_WIN) |
434 const GpuPreferences::VpxDecodeVendors vendor = | 435 const GpuPreferences::VpxDecodeVendors vendor = |
435 GpuPreferences::VPX_VENDOR_AMD; | 436 GpuPreferences::VPX_VENDOR_AMD; |
436 prefs.enable_accelerated_vpx_decode = vendor; | 437 prefs.enable_accelerated_vpx_decode = vendor; |
437 #endif | 438 #endif |
438 prefs.enable_gpu_driver_debug_logging = true; | 439 prefs.enable_gpu_driver_debug_logging = true; |
439 | 440 |
440 mojom::TraitsTestServicePtr proxy = GetTraitsTestProxy(); | 441 mojom::TraitsTestServicePtr proxy = GetTraitsTestProxy(); |
441 GpuPreferences echo; | 442 GpuPreferences echo; |
442 proxy->EchoGpuPreferences(prefs, &echo); | 443 proxy->EchoGpuPreferences(prefs, &echo); |
443 EXPECT_TRUE(echo.single_process); | 444 EXPECT_TRUE(echo.single_process); |
444 EXPECT_TRUE(echo.in_process_gpu); | 445 EXPECT_TRUE(echo.in_process_gpu); |
445 EXPECT_TRUE(echo.ui_prioritize_in_gpu_process); | 446 EXPECT_TRUE(echo.ui_prioritize_in_gpu_process); |
| 447 EXPECT_TRUE(echo.enable_gpu_scheduler); |
446 EXPECT_TRUE(echo.enable_gpu_driver_debug_logging); | 448 EXPECT_TRUE(echo.enable_gpu_driver_debug_logging); |
447 #if defined(OS_WIN) | 449 #if defined(OS_WIN) |
448 EXPECT_EQ(vendor, echo.enable_accelerated_vpx_decode); | 450 EXPECT_EQ(vendor, echo.enable_accelerated_vpx_decode); |
449 #endif | 451 #endif |
450 } | 452 } |
451 | 453 |
452 TEST_F(StructTraitsTest, GpuFeatureInfo) { | 454 TEST_F(StructTraitsTest, GpuFeatureInfo) { |
453 GpuFeatureInfo input; | 455 GpuFeatureInfo input; |
454 input.status_values[GPU_FEATURE_TYPE_FLASH3D] = | 456 input.status_values[GPU_FEATURE_TYPE_FLASH3D] = |
455 gpu::kGpuFeatureStatusBlacklisted; | 457 gpu::kGpuFeatureStatusBlacklisted; |
456 input.status_values[GPU_FEATURE_TYPE_PANEL_FITTING] = | 458 input.status_values[GPU_FEATURE_TYPE_PANEL_FITTING] = |
457 gpu::kGpuFeatureStatusUndefined; | 459 gpu::kGpuFeatureStatusUndefined; |
458 input.status_values[GPU_FEATURE_TYPE_GPU_RASTERIZATION] = | 460 input.status_values[GPU_FEATURE_TYPE_GPU_RASTERIZATION] = |
459 gpu::kGpuFeatureStatusDisabled; | 461 gpu::kGpuFeatureStatusDisabled; |
460 | 462 |
461 GpuFeatureInfo output; | 463 GpuFeatureInfo output; |
462 ASSERT_TRUE(mojom::GpuFeatureInfo::Deserialize( | 464 ASSERT_TRUE(mojom::GpuFeatureInfo::Deserialize( |
463 mojom::GpuFeatureInfo::Serialize(&input), &output)); | 465 mojom::GpuFeatureInfo::Serialize(&input), &output)); |
464 EXPECT_TRUE(std::equal(input.status_values, | 466 EXPECT_TRUE(std::equal(input.status_values, |
465 input.status_values + NUMBER_OF_GPU_FEATURE_TYPES, | 467 input.status_values + NUMBER_OF_GPU_FEATURE_TYPES, |
466 output.status_values)); | 468 output.status_values)); |
467 } | 469 } |
468 | 470 |
469 } // namespace gpu | 471 } // namespace gpu |
OLD | NEW |