| OLD | NEW |
| 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 Loading... |
| 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 } |
| 100 |
| OLD | NEW |