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

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

Issue 10959061: Revert 158076 - Implement blacklist's force GPU capability in dual GPU machines. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 2 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
« no previous file with comments | « content/browser/gpu/gpu_util.cc ('k') | content/content_common.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Deleted: svn:mergeinfo
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"
8 7
9 using content::GpuFeatureType; 8 using content::GpuFeatureType;
10 9
11 TEST(GpuUtilsTest, GpuFeatureTypFromString) { 10 TEST(GpuUtilsTest, GpuFeatureTypFromString) {
12 // Test StringToGpuFeatureType. 11 // Test StringToGpuFeatureType.
13 EXPECT_EQ(gpu_util::StringToGpuFeatureType("accelerated_2d_canvas"), 12 EXPECT_EQ(gpu_util::StringToGpuFeatureType("accelerated_2d_canvas"),
14 content::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS); 13 content::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS);
15 EXPECT_EQ(gpu_util::StringToGpuFeatureType("accelerated_compositing"), 14 EXPECT_EQ(gpu_util::StringToGpuFeatureType("accelerated_compositing"),
16 content::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING); 15 content::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING);
17 EXPECT_EQ(gpu_util::StringToGpuFeatureType("webgl"), 16 EXPECT_EQ(gpu_util::StringToGpuFeatureType("webgl"),
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 EXPECT_STREQ( 81 EXPECT_STREQ(
83 gpu_util::GpuFeatureTypeToString( 82 gpu_util::GpuFeatureTypeToString(
84 static_cast<content::GpuFeatureType>( 83 static_cast<content::GpuFeatureType>(
85 content::GPU_FEATURE_TYPE_WEBGL | 84 content::GPU_FEATURE_TYPE_WEBGL |
86 content::GPU_FEATURE_TYPE_ALL)).c_str(), 85 content::GPU_FEATURE_TYPE_ALL)).c_str(),
87 "all"); 86 "all");
88 } 87 }
89 88
90 TEST(GpuUtilsTest, GpuSwitchingOptionFromString) { 89 TEST(GpuUtilsTest, GpuSwitchingOptionFromString) {
91 // Test StringToGpuSwitchingOption. 90 // Test StringToGpuSwitchingOption.
92 EXPECT_EQ(gpu_util::StringToGpuSwitchingOption( 91 EXPECT_EQ(gpu_util::StringToGpuSwitchingOption("automatic"),
93 switches::kGpuSwitchingOptionNameAutomatic), 92 content::GPU_SWITCHING_AUTOMATIC);
94 content::GPU_SWITCHING_OPTION_AUTOMATIC); 93 EXPECT_EQ(gpu_util::StringToGpuSwitchingOption("force_discrete"),
95 EXPECT_EQ(gpu_util::StringToGpuSwitchingOption( 94 content::GPU_SWITCHING_FORCE_DISCRETE);
96 switches::kGpuSwitchingOptionNameForceDiscrete), 95 EXPECT_EQ(gpu_util::StringToGpuSwitchingOption("force_integrated"),
97 content::GPU_SWITCHING_OPTION_FORCE_DISCRETE); 96 content::GPU_SWITCHING_FORCE_INTEGRATED);
98 EXPECT_EQ(gpu_util::StringToGpuSwitchingOption(
99 switches::kGpuSwitchingOptionNameForceIntegrated),
100 content::GPU_SWITCHING_OPTION_FORCE_INTEGRATED);
101 EXPECT_EQ(gpu_util::StringToGpuSwitchingOption("xxx"), 97 EXPECT_EQ(gpu_util::StringToGpuSwitchingOption("xxx"),
102 content::GPU_SWITCHING_OPTION_UNKNOWN); 98 content::GPU_SWITCHING_UNKNOWN);
103 } 99 }
104 100
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
« no previous file with comments | « content/browser/gpu/gpu_util.cc ('k') | content/content_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698