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

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

Issue 2781553002: gpu: Introduce separate mojo api for failed initialization. (Closed)
Patch Set: . Created 3 years, 8 months 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_feature_info_struct_traits.h ('k') | gpu/ipc/common/typemaps.gni » ('j') | 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 <algorithm>
5 #include <string> 6 #include <string>
6 7
7 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "gpu/config/gpu_feature_type.h"
10 #include "gpu/ipc/common/gpu_feature_info.mojom.h"
11 #include "gpu/ipc/common/gpu_feature_info_struct_traits.h"
8 #include "gpu/ipc/common/traits_test_service.mojom.h" 12 #include "gpu/ipc/common/traits_test_service.mojom.h"
9 #include "mojo/public/cpp/bindings/binding_set.h" 13 #include "mojo/public/cpp/bindings/binding_set.h"
10 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
11 15
12 namespace gpu { 16 namespace gpu {
13 17
14 namespace { 18 namespace {
15 19
16 class StructTraitsTest : public testing::Test, public mojom::TraitsTestService { 20 class StructTraitsTest : public testing::Test, public mojom::TraitsTestService {
17 public: 21 public:
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 proxy->EchoGpuPreferences(prefs, &echo); 439 proxy->EchoGpuPreferences(prefs, &echo);
436 EXPECT_TRUE(echo.single_process); 440 EXPECT_TRUE(echo.single_process);
437 EXPECT_TRUE(echo.in_process_gpu); 441 EXPECT_TRUE(echo.in_process_gpu);
438 EXPECT_TRUE(echo.ui_prioritize_in_gpu_process); 442 EXPECT_TRUE(echo.ui_prioritize_in_gpu_process);
439 EXPECT_TRUE(echo.enable_gpu_driver_debug_logging); 443 EXPECT_TRUE(echo.enable_gpu_driver_debug_logging);
440 #if defined(OS_WIN) 444 #if defined(OS_WIN)
441 EXPECT_EQ(vendor, echo.enable_accelerated_vpx_decode); 445 EXPECT_EQ(vendor, echo.enable_accelerated_vpx_decode);
442 #endif 446 #endif
443 } 447 }
444 448
449 TEST_F(StructTraitsTest, GpuFeatureInfo) {
450 GpuFeatureInfo input;
451 input.status_values[GPU_FEATURE_TYPE_FLASH3D] =
452 gpu::kGpuFeatureStatusBlacklisted;
453 input.status_values[GPU_FEATURE_TYPE_PANEL_FITTING] =
454 gpu::kGpuFeatureStatusUndefined;
455 input.status_values[GPU_FEATURE_TYPE_GPU_RASTERIZATION] =
456 gpu::kGpuFeatureStatusDisabled;
457
458 GpuFeatureInfo output;
459 ASSERT_TRUE(mojom::GpuFeatureInfo::Deserialize(
460 mojom::GpuFeatureInfo::Serialize(&input), &output));
461 EXPECT_TRUE(std::equal(input.status_values,
462 input.status_values + NUMBER_OF_GPU_FEATURE_TYPES,
463 output.status_values));
464 }
465
445 } // namespace gpu 466 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/ipc/common/gpu_feature_info_struct_traits.h ('k') | gpu/ipc/common/typemaps.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698