Chromium Code Reviews| Index: gpu/config/gpu_util_unittest.cc |
| diff --git a/gpu/config/gpu_util_unittest.cc b/gpu/config/gpu_util_unittest.cc |
| index f3e3f8f73a0e44bedbb7150c188662e91afe7ba5..e1264dbf95bf8deb79991af2f30fb82164d55285 100644 |
| --- a/gpu/config/gpu_util_unittest.cc |
| +++ b/gpu/config/gpu_util_unittest.cc |
| @@ -4,37 +4,9 @@ |
| #include "gpu/config/gpu_util.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| -#include "ui/gl/gl_switches.h" |
| namespace gpu { |
| -TEST(GpuUtilTest, GpuSwitchingOptionFromString) { |
| - // Test StringToGpuSwitchingOption. |
| - EXPECT_EQ(StringToGpuSwitchingOption( |
| - switches::kGpuSwitchingOptionNameAutomatic), |
| - GPU_SWITCHING_OPTION_AUTOMATIC); |
| - EXPECT_EQ(StringToGpuSwitchingOption( |
| - switches::kGpuSwitchingOptionNameForceDiscrete), |
| - GPU_SWITCHING_OPTION_FORCE_DISCRETE); |
| - EXPECT_EQ(StringToGpuSwitchingOption( |
| - switches::kGpuSwitchingOptionNameForceIntegrated), |
| - GPU_SWITCHING_OPTION_FORCE_INTEGRATED); |
| - EXPECT_EQ(StringToGpuSwitchingOption("xxx"), GPU_SWITCHING_OPTION_UNKNOWN); |
| -} |
| - |
| -TEST(GpuUtilTest, GpuSwitchingOptionToString) { |
| - // Test GpuSwitchingOptionToString. |
| - EXPECT_STREQ( |
| - GpuSwitchingOptionToString(GPU_SWITCHING_OPTION_AUTOMATIC).c_str(), |
| - switches::kGpuSwitchingOptionNameAutomatic); |
| - EXPECT_STREQ( |
| - GpuSwitchingOptionToString(GPU_SWITCHING_OPTION_FORCE_DISCRETE).c_str(), |
| - switches::kGpuSwitchingOptionNameForceDiscrete); |
| - EXPECT_STREQ( |
| - GpuSwitchingOptionToString(GPU_SWITCHING_OPTION_FORCE_INTEGRATED).c_str(), |
| - switches::kGpuSwitchingOptionNameForceIntegrated); |
| -} |
| - |
| TEST(GpuUtilTest, MergeFeatureSets) { |
| { |
| // Merge two empty sets. |
| @@ -75,4 +47,25 @@ TEST(GpuUtilTest, MergeFeatureSets) { |
| } |
| } |
| +TEST(GpuUtilTest, StringToFeatureSet) { |
| + { |
| + // zero feature. |
|
Ken Russell (switch to Gerrit)
2013/11/05 02:31:56
Zero features.
|
| + std::set<int> features; |
| + StringToFeatureSet("", &features); |
| + EXPECT_EQ(0u, features.size()); |
| + } |
| + { |
| + // One features. |
|
Ken Russell (switch to Gerrit)
2013/11/05 02:31:56
One feature.
|
| + std::set<int> features; |
| + StringToFeatureSet("4", &features); |
| + EXPECT_EQ(1u, features.size()); |
| + } |
| + { |
| + // Multiple features. |
| + std::set<int> features; |
| + StringToFeatureSet("1,9", &features); |
| + EXPECT_EQ(2u, features.size()); |
| + } |
| +} |
| + |
| } // namespace gpu |