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

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

Issue 10915219: Add capability for GPU blacklist to manage GPU switching. (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 7
8 using content::GpuFeatureType; 8 using content::GpuFeatureType;
9 9
10 TEST(GpuUtilsTest, GpuFeatureTypFromString) { 10 TEST(GpuUtilsTest, GpuFeatureTypFromString) {
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 content::GPU_FEATURE_TYPE_WEBGL | 78 content::GPU_FEATURE_TYPE_WEBGL |
79 content::GPU_FEATURE_TYPE_MULTISAMPLING)).c_str(), 79 content::GPU_FEATURE_TYPE_MULTISAMPLING)).c_str(),
80 "webgl,multisampling"); 80 "webgl,multisampling");
81 EXPECT_STREQ( 81 EXPECT_STREQ(
82 gpu_util::GpuFeatureTypeToString( 82 gpu_util::GpuFeatureTypeToString(
83 static_cast<content::GpuFeatureType>( 83 static_cast<content::GpuFeatureType>(
84 content::GPU_FEATURE_TYPE_WEBGL | 84 content::GPU_FEATURE_TYPE_WEBGL |
85 content::GPU_FEATURE_TYPE_ALL)).c_str(), 85 content::GPU_FEATURE_TYPE_ALL)).c_str(),
86 "all"); 86 "all");
87 } 87 }
88
89 TEST(GpuUtilsTest, GpuSwitchingOptionFromString) {
90 // Test StringToGpuSwitchingOption.
91 EXPECT_EQ(gpu_util::StringToGpuSwitchingOption("automatic"),
92 content::GPU_SWITCHING_AUTOMATIC);
93 EXPECT_EQ(gpu_util::StringToGpuSwitchingOption("force_discrete"),
94 content::GPU_SWITCHING_FORCE_DISCRETE);
95 EXPECT_EQ(gpu_util::StringToGpuSwitchingOption("force_integrated"),
96 content::GPU_SWITCHING_FORCE_INTEGRATED);
97 EXPECT_EQ(gpu_util::StringToGpuSwitchingOption("xxx"),
98 content::GPU_SWITCHING_UNKNOWN);
99 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698