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

Side by Side Diff: gpu/config/gpu_util_unittest.cc

Issue 57633007: Merge gpu_switching_list into gpu_driver_bug_list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: final final Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « gpu/config/gpu_util.cc ('k') | gpu/gpu.gyp » ('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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "gpu/config/gpu_util.h" 5 #include "gpu/config/gpu_util.h"
6 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 #include "ui/gl/gl_switches.h"
8 7
9 namespace gpu { 8 namespace gpu {
10 9
11 TEST(GpuUtilTest, GpuSwitchingOptionFromString) {
12 // Test StringToGpuSwitchingOption.
13 EXPECT_EQ(StringToGpuSwitchingOption(
14 switches::kGpuSwitchingOptionNameAutomatic),
15 GPU_SWITCHING_OPTION_AUTOMATIC);
16 EXPECT_EQ(StringToGpuSwitchingOption(
17 switches::kGpuSwitchingOptionNameForceDiscrete),
18 GPU_SWITCHING_OPTION_FORCE_DISCRETE);
19 EXPECT_EQ(StringToGpuSwitchingOption(
20 switches::kGpuSwitchingOptionNameForceIntegrated),
21 GPU_SWITCHING_OPTION_FORCE_INTEGRATED);
22 EXPECT_EQ(StringToGpuSwitchingOption("xxx"), GPU_SWITCHING_OPTION_UNKNOWN);
23 }
24
25 TEST(GpuUtilTest, GpuSwitchingOptionToString) {
26 // Test GpuSwitchingOptionToString.
27 EXPECT_STREQ(
28 GpuSwitchingOptionToString(GPU_SWITCHING_OPTION_AUTOMATIC).c_str(),
29 switches::kGpuSwitchingOptionNameAutomatic);
30 EXPECT_STREQ(
31 GpuSwitchingOptionToString(GPU_SWITCHING_OPTION_FORCE_DISCRETE).c_str(),
32 switches::kGpuSwitchingOptionNameForceDiscrete);
33 EXPECT_STREQ(
34 GpuSwitchingOptionToString(GPU_SWITCHING_OPTION_FORCE_INTEGRATED).c_str(),
35 switches::kGpuSwitchingOptionNameForceIntegrated);
36 }
37
38 TEST(GpuUtilTest, MergeFeatureSets) { 10 TEST(GpuUtilTest, MergeFeatureSets) {
39 { 11 {
40 // Merge two empty sets. 12 // Merge two empty sets.
41 std::set<int> src; 13 std::set<int> src;
42 std::set<int> dst; 14 std::set<int> dst;
43 EXPECT_TRUE(dst.empty()); 15 EXPECT_TRUE(dst.empty());
44 MergeFeatureSets(&dst, src); 16 MergeFeatureSets(&dst, src);
45 EXPECT_TRUE(dst.empty()); 17 EXPECT_TRUE(dst.empty());
46 } 18 }
47 { 19 {
(...skipping 20 matching lines...) Expand all
68 std::set<int> src; 40 std::set<int> src;
69 std::set<int> dst; 41 std::set<int> dst;
70 src.insert(1); 42 src.insert(1);
71 dst.insert(2); 43 dst.insert(2);
72 EXPECT_EQ(1u, dst.size()); 44 EXPECT_EQ(1u, dst.size());
73 MergeFeatureSets(&dst, src); 45 MergeFeatureSets(&dst, src);
74 EXPECT_EQ(2u, dst.size()); 46 EXPECT_EQ(2u, dst.size());
75 } 47 }
76 } 48 }
77 49
50 TEST(GpuUtilTest, StringToFeatureSet) {
51 {
52 // zero feature.
53 std::set<int> features;
54 StringToFeatureSet("", &features);
55 EXPECT_EQ(0u, features.size());
56 }
57 {
58 // One features.
59 std::set<int> features;
60 StringToFeatureSet("4", &features);
61 EXPECT_EQ(1u, features.size());
62 }
63 {
64 // Multiple features.
65 std::set<int> features;
66 StringToFeatureSet("1,9", &features);
67 EXPECT_EQ(2u, features.size());
68 }
69 }
70
78 } // namespace gpu 71 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/config/gpu_util.cc ('k') | gpu/gpu.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698