Chromium Code Reviews| Index: content/common/gpu_feature_flags_unittest.cc |
| diff --git a/content/common/gpu_feature_flags_unittest.cc b/content/common/gpu_feature_flags_unittest.cc |
| index 3a676c32dafddbaebc52bc267104b53b854d64a5..1b382d53ebd308eb84b425461ef6eb9dd17d4533 100644 |
| --- a/content/common/gpu_feature_flags_unittest.cc |
| +++ b/content/common/gpu_feature_flags_unittest.cc |
| @@ -1,4 +1,4 @@ |
| -// Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| @@ -50,5 +50,42 @@ TEST(GpuFeatureFlagsTest, GpuFeatureFlagsBasic) { |
| GpuFeatureFlags::kGpuFeatureAll); |
| EXPECT_EQ(GpuFeatureFlags::StringToGpuFeatureType("xxx"), |
| GpuFeatureFlags::kGpuFeatureUnknown); |
| -} |
| + // Test GpuFeatureTypeToString for single-bit enums using the all enum |
|
zmo
2011/04/07 20:46:06
It would be better if this makes a separate test.
|
| + EXPECT_STREQ( |
| + GpuFeatureFlags::GpuFeatureTypeToUserFriendlyString( |
| + GpuFeatureFlags::kGpuFeatureAcceleratedCompositing).c_str(), |
| + "Accelerated Compositing"); |
| + EXPECT_STREQ( |
| + GpuFeatureFlags::GpuFeatureTypeToUserFriendlyString( |
| + GpuFeatureFlags::kGpuFeatureAccelerated2dCanvas).c_str(), |
| + "Accelerated 2D Canvas"); |
| + EXPECT_STREQ( |
| + GpuFeatureFlags::GpuFeatureTypeToUserFriendlyString( |
| + GpuFeatureFlags::kGpuFeatureWebgl).c_str(), |
| + "WebGL"); |
| + EXPECT_STREQ( |
| + GpuFeatureFlags::GpuFeatureTypeToUserFriendlyString( |
| + GpuFeatureFlags::kGpuFeatureMultisampling).c_str(), |
| + "WebGL + Canvas Multisampling"); |
| + EXPECT_STREQ( |
| + GpuFeatureFlags::GpuFeatureTypeToUserFriendlyString( |
| + GpuFeatureFlags::kGpuFeatureAll).c_str(), |
| + "All GPU features"); |
| + EXPECT_STREQ(GpuFeatureFlags::GpuFeatureTypeToUserFriendlyString( |
| + GpuFeatureFlags::kGpuFeatureUnknown).c_str(), |
| + "Unknown feature"); |
| + EXPECT_STREQ( |
| + GpuFeatureFlags::GpuFeatureTypeToUserFriendlyString( |
| + static_cast<GpuFeatureFlags::GpuFeatureType>( |
| + GpuFeatureFlags::kGpuFeatureWebgl | |
| + GpuFeatureFlags::kGpuFeatureMultisampling)).c_str(), |
| + "WebGL,WebGL + Canvas Multisampling"); |
| + |
| + std::string tmp; |
| + tmp = GpuFeatureFlags::GpuFeatureTypeToUserFriendlyString( |
| + static_cast<GpuFeatureFlags::GpuFeatureType>( |
| + GpuFeatureFlags::kGpuFeatureWebgl | |
| + GpuFeatureFlags::kGpuFeatureAll)); |
| + EXPECT_STREQ(tmp.c_str(), "All GPU features"); |
| +} |