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

Side by Side Diff: content/browser/gpu/gpu_util_unittest.cc

Issue 10909221: Implement blacklist's force GPU capability in dual GPU machines. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 3 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 | Annotate | Revision Log
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 "content/browser/gpu/gpu_util.h" 5 #include "content/browser/gpu/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"
7 8
8 using content::GpuFeatureType; 9 using content::GpuFeatureType;
9 10
10 TEST(GpuUtilsTest, GpuFeatureTypFromString) { 11 TEST(GpuUtilsTest, GpuFeatureTypFromString) {
11 // Test StringToGpuFeatureType. 12 // Test StringToGpuFeatureType.
12 EXPECT_EQ(gpu_util::StringToGpuFeatureType("accelerated_2d_canvas"), 13 EXPECT_EQ(gpu_util::StringToGpuFeatureType("accelerated_2d_canvas"),
13 content::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS); 14 content::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS);
14 EXPECT_EQ(gpu_util::StringToGpuFeatureType("accelerated_compositing"), 15 EXPECT_EQ(gpu_util::StringToGpuFeatureType("accelerated_compositing"),
15 content::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING); 16 content::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING);
16 EXPECT_EQ(gpu_util::StringToGpuFeatureType("webgl"), 17 EXPECT_EQ(gpu_util::StringToGpuFeatureType("webgl"),
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 EXPECT_STREQ( 82 EXPECT_STREQ(
82 gpu_util::GpuFeatureTypeToString( 83 gpu_util::GpuFeatureTypeToString(
83 static_cast<content::GpuFeatureType>( 84 static_cast<content::GpuFeatureType>(
84 content::GPU_FEATURE_TYPE_WEBGL | 85 content::GPU_FEATURE_TYPE_WEBGL |
85 content::GPU_FEATURE_TYPE_ALL)).c_str(), 86 content::GPU_FEATURE_TYPE_ALL)).c_str(),
86 "all"); 87 "all");
87 } 88 }
88 89
89 TEST(GpuUtilsTest, GpuSwitchingOptionFromString) { 90 TEST(GpuUtilsTest, GpuSwitchingOptionFromString) {
90 // Test StringToGpuSwitchingOption. 91 // Test StringToGpuSwitchingOption.
91 EXPECT_EQ(gpu_util::StringToGpuSwitchingOption("automatic"), 92 EXPECT_EQ(gpu_util::StringToGpuSwitchingOption(
92 content::GPU_SWITCHING_AUTOMATIC); 93 switches::kGpuSwitchingOptionNameAutomatic),
93 EXPECT_EQ(gpu_util::StringToGpuSwitchingOption("force_discrete"), 94 content::GPU_SWITCHING_OPTION_AUTOMATIC);
94 content::GPU_SWITCHING_FORCE_DISCRETE); 95 EXPECT_EQ(gpu_util::StringToGpuSwitchingOption(
95 EXPECT_EQ(gpu_util::StringToGpuSwitchingOption("force_integrated"), 96 switches::kGpuSwitchingOptionNameForceDiscrete),
96 content::GPU_SWITCHING_FORCE_INTEGRATED); 97 content::GPU_SWITCHING_OPTION_FORCE_DISCRETE);
98 EXPECT_EQ(gpu_util::StringToGpuSwitchingOption(
99 switches::kGpuSwitchingOptionNameForceIntegrated),
100 content::GPU_SWITCHING_OPTION_FORCE_INTEGRATED);
97 EXPECT_EQ(gpu_util::StringToGpuSwitchingOption("xxx"), 101 EXPECT_EQ(gpu_util::StringToGpuSwitchingOption("xxx"),
98 content::GPU_SWITCHING_UNKNOWN); 102 content::GPU_SWITCHING_OPTION_UNKNOWN);
99 } 103 }
100 104
105 TEST(GpuUtilsTest, GpuSwitchingOptionToString) {
106 // Test GpuSwitchingOptionToString.
107 EXPECT_STREQ(
108 gpu_util::GpuSwitchingOptionToString(
109 content::GPU_SWITCHING_OPTION_AUTOMATIC).c_str(),
110 switches::kGpuSwitchingOptionNameAutomatic);
111 EXPECT_STREQ(
112 gpu_util::GpuSwitchingOptionToString(
113 content::GPU_SWITCHING_OPTION_FORCE_DISCRETE).c_str(),
114 switches::kGpuSwitchingOptionNameForceDiscrete);
115 EXPECT_STREQ(
116 gpu_util::GpuSwitchingOptionToString(
117 content::GPU_SWITCHING_OPTION_FORCE_INTEGRATED).c_str(),
118 switches::kGpuSwitchingOptionNameForceIntegrated);
119 }
120
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698