| Index: chrome/common/gpu_feature_flags_unittest.cc
 | 
| ===================================================================
 | 
| --- chrome/common/gpu_feature_flags_unittest.cc	(revision 0)
 | 
| +++ chrome/common/gpu_feature_flags_unittest.cc	(revision 0)
 | 
| @@ -0,0 +1,39 @@
 | 
| +// Copyright (c) 2010 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.
 | 
| +
 | 
| +#include "chrome/common/gpu_feature_flags.h"
 | 
| +#include "testing/gtest/include/gtest/gtest.h"
 | 
| +
 | 
| +TEST(GpuFeatureFlagsTest, GpuFeatureFlagsBasic) {
 | 
| +  // Test that by default all flags are set to false.
 | 
| +  GpuFeatureFlags gpu_feature_flags;
 | 
| +  EXPECT_FALSE(gpu_feature_flags.is_accelerated_2d_canvas_blacklisted());
 | 
| +  EXPECT_FALSE(gpu_feature_flags.is_accelerated_compositing_blacklisted());
 | 
| +  EXPECT_FALSE(gpu_feature_flags.is_webgl_blacklisted());
 | 
| +
 | 
| +  // Test SetFlags().
 | 
| +  GpuFeatureFlags gpu_feature_flags2;
 | 
| +  gpu_feature_flags2.SetFlags(false, true, true);
 | 
| +  EXPECT_FALSE(gpu_feature_flags2.is_accelerated_2d_canvas_blacklisted());
 | 
| +  EXPECT_TRUE(gpu_feature_flags2.is_accelerated_compositing_blacklisted());
 | 
| +  EXPECT_TRUE(gpu_feature_flags2.is_webgl_blacklisted());
 | 
| +
 | 
| +  // Test Combine() is basically OR operation per flag.
 | 
| +  gpu_feature_flags.Combine(gpu_feature_flags2);
 | 
| +  EXPECT_FALSE(gpu_feature_flags.is_accelerated_2d_canvas_blacklisted());
 | 
| +  EXPECT_TRUE(gpu_feature_flags.is_accelerated_compositing_blacklisted());
 | 
| +  EXPECT_TRUE(gpu_feature_flags.is_webgl_blacklisted());
 | 
| +
 | 
| +  // Test StringToGpuFeatureType.
 | 
| +  EXPECT_EQ(GpuFeatureFlags::StringToGpuFeatureType("accelerated_2d_canvas"),
 | 
| +            GpuFeatureFlags::kGpuFeatureAccelerated2dCanvas);
 | 
| +  EXPECT_EQ(GpuFeatureFlags::StringToGpuFeatureType("accelerated_compositing"),
 | 
| +            GpuFeatureFlags::kGpuFeatureAcceleratedCompositing);
 | 
| +  EXPECT_EQ(GpuFeatureFlags::StringToGpuFeatureType("webgl"),
 | 
| +            GpuFeatureFlags::kGpuFeatureWebgl);
 | 
| +  EXPECT_EQ(GpuFeatureFlags::StringToGpuFeatureType("any"),
 | 
| +            GpuFeatureFlags::kGpuFeatureAny);
 | 
| +  EXPECT_EQ(GpuFeatureFlags::StringToGpuFeatureType("xxx"),
 | 
| +            GpuFeatureFlags::kGpuFeatureUnknown);
 | 
| +}
 | 
| 
 |