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

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: Fixed the unittest issues. 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 flags;
11 EXPECT_EQ(flags.flags(), 0u);
12
13 // Test SetFlags().
14 GpuFeatureFlags flags2;
15 flags2.set_flags(GpuFeatureFlags::kGpuFeatureAcceleratedCompositing |
16 GpuFeatureFlags::kGpuFeatureWebgl);
17 EXPECT_EQ(flags2.flags(),
18 static_cast<uint32>(
19 GpuFeatureFlags::kGpuFeatureAcceleratedCompositing |
20 GpuFeatureFlags::kGpuFeatureWebgl));
21
22 // Test Combine() is basically OR operation per flag.
23 flags.set_flags(GpuFeatureFlags::kGpuFeatureAccelerated2dCanvas);
24 flags.Combine(flags2);
25 EXPECT_EQ(flags.flags(),
26 static_cast<uint32>(
27 GpuFeatureFlags::kGpuFeatureAccelerated2dCanvas |
28 GpuFeatureFlags::kGpuFeatureAcceleratedCompositing |
29 GpuFeatureFlags::kGpuFeatureWebgl));
30
31 // Test StringToGpuFeatureType.
32 EXPECT_EQ(GpuFeatureFlags::StringToGpuFeatureType("accelerated_2d_canvas"),
33 GpuFeatureFlags::kGpuFeatureAccelerated2dCanvas);
34 EXPECT_EQ(GpuFeatureFlags::StringToGpuFeatureType("accelerated_compositing"),
35 GpuFeatureFlags::kGpuFeatureAcceleratedCompositing);
36 EXPECT_EQ(GpuFeatureFlags::StringToGpuFeatureType("webgl"),
37 GpuFeatureFlags::kGpuFeatureWebgl);
38 EXPECT_EQ(GpuFeatureFlags::StringToGpuFeatureType("xxx"),
39 GpuFeatureFlags::kGpuFeatureUnknown);
40 }
41
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698