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

Side by Side Diff: chrome/common/gpu_feature_flags_unittest.cc

Issue 5612002: Blacklist bad GPU drivers: currenly we disable all gpu related features if th... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: removing one garbage line in the code Created 10 years 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
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/common/gpu_feature_flags.h"
6 #include "testing/gtest/include/gtest/gtest.h"
7
8 TEST(GpuFeatureFlagsTest, GpuFeatureFlagsBasic) {
9 // Test that by default all flags are set to false.
10 GpuFeatureFlags gpu_feature_flags;
11 EXPECT_FALSE(gpu_feature_flags.is_accelerated_2d_canvas_blacklisted());
12 EXPECT_FALSE(gpu_feature_flags.is_accelerated_compositing_blacklisted());
13 EXPECT_FALSE(gpu_feature_flags.is_webgl_blacklisted());
14
15 // Test SetFlags().
16 GpuFeatureFlags gpu_feature_flags2;
17 gpu_feature_flags2.SetFlags(false, true, true);
18 EXPECT_FALSE(gpu_feature_flags2.is_accelerated_2d_canvas_blacklisted());
19 EXPECT_TRUE(gpu_feature_flags2.is_accelerated_compositing_blacklisted());
20 EXPECT_TRUE(gpu_feature_flags2.is_webgl_blacklisted());
21
22 // Test Combine() is basically OR operation per flag.
23 gpu_feature_flags.Combine(gpu_feature_flags2);
24 EXPECT_FALSE(gpu_feature_flags.is_accelerated_2d_canvas_blacklisted());
25 EXPECT_TRUE(gpu_feature_flags.is_accelerated_compositing_blacklisted());
26 EXPECT_TRUE(gpu_feature_flags.is_webgl_blacklisted());
27
28 // Test StringToGpuFeatureType.
29 EXPECT_EQ(GpuFeatureFlags::StringToGpuFeatureType("accelerated_2d_canvas"),
30 GpuFeatureFlags::kGpuFeatureAccelerated2dCanvas);
31 EXPECT_EQ(GpuFeatureFlags::StringToGpuFeatureType("accelerated_compositing"),
32 GpuFeatureFlags::kGpuFeatureAcceleratedCompositing);
33 EXPECT_EQ(GpuFeatureFlags::StringToGpuFeatureType("webgl"),
34 GpuFeatureFlags::kGpuFeatureWebgl);
35 EXPECT_EQ(GpuFeatureFlags::StringToGpuFeatureType("any"),
36 GpuFeatureFlags::kGpuFeatureAny);
37 EXPECT_EQ(GpuFeatureFlags::StringToGpuFeatureType("xxx"),
38 GpuFeatureFlags::kGpuFeatureUnknown);
39 }
40
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698