| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "gpu/config/gpu_control_list.h" | 8 #include "gpu/config/gpu_control_list.h" |
| 9 #include "gpu/config/gpu_info.h" | 9 #include "gpu/config/gpu_info.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 | 11 |
| 12 const char kOsVersion[] = "10.6.4"; | 12 const char kOsVersion[] = "10.6.4"; |
| 13 const uint32 kIntelVendorId = 0x8086; | 13 const uint32 kIntelVendorId = 0x8086; |
| 14 const uint32 kIntelDeviceId = 0x0166; // 3rd Gen Core Graphics | |
| 15 const uint32 kNvidiaVendorId = 0x10de; | 14 const uint32 kNvidiaVendorId = 0x10de; |
| 16 const uint32 kNvidiaDeviceId = 0x0fd5; // GeForce GT 650M | |
| 17 | 15 |
| 18 #define LONG_STRING_CONST(...) #__VA_ARGS__ | 16 #define LONG_STRING_CONST(...) #__VA_ARGS__ |
| 19 | 17 |
| 20 #define EXPECT_EMPTY_SET(feature_set) EXPECT_EQ(0u, feature_set.size()) | 18 #define EXPECT_EMPTY_SET(feature_set) EXPECT_EQ(0u, feature_set.size()) |
| 21 #define EXPECT_SINGLE_FEATURE(feature_set, feature) \ | 19 #define EXPECT_SINGLE_FEATURE(feature_set, feature) \ |
| 22 EXPECT_TRUE(feature_set.size() == 1 && feature_set.count(feature) == 1) | 20 EXPECT_TRUE(feature_set.size() == 1 && feature_set.count(feature) == 1) |
| 23 | 21 |
| 24 namespace gpu { | 22 namespace gpu { |
| 25 | 23 |
| 26 enum TestFeatureType { | 24 enum TestFeatureType { |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 EXPECT_EMPTY_SET(features); | 476 EXPECT_EMPTY_SET(features); |
| 479 | 477 |
| 480 gpu_info.driver_version = "9.0"; | 478 gpu_info.driver_version = "9.0"; |
| 481 features = control_list->MakeDecision( | 479 features = control_list->MakeDecision( |
| 482 GpuControlList::kOsLinux, kOsVersion, gpu_info); | 480 GpuControlList::kOsLinux, kOsVersion, gpu_info); |
| 483 EXPECT_SINGLE_FEATURE(features, TEST_FEATURE_0); | 481 EXPECT_SINGLE_FEATURE(features, TEST_FEATURE_0); |
| 484 } | 482 } |
| 485 | 483 |
| 486 } // namespace gpu | 484 } // namespace gpu |
| 487 | 485 |
| OLD | NEW |