Chromium Code Reviews| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "gpu/config/gpu_control_list.h" | 10 #include "gpu/config/gpu_control_list.h" |
| (...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 792 | 792 |
| 793 GPUInfo gpu_info; | 793 GPUInfo gpu_info; |
| 794 gpu_info.gpu.vendor_id = 0x8086; | 794 gpu_info.gpu.vendor_id = 0x8086; |
| 795 EXPECT_TRUE(entry->NeedsMoreInfo(gpu_info, true)); | 795 EXPECT_TRUE(entry->NeedsMoreInfo(gpu_info, true)); |
| 796 EXPECT_FALSE(entry->NeedsMoreInfo(gpu_info, false)); | 796 EXPECT_FALSE(entry->NeedsMoreInfo(gpu_info, false)); |
| 797 | 797 |
| 798 gpu_info.gl_renderer = "mesa"; | 798 gpu_info.gl_renderer = "mesa"; |
| 799 EXPECT_FALSE(entry->NeedsMoreInfo(gpu_info, true)); | 799 EXPECT_FALSE(entry->NeedsMoreInfo(gpu_info, true)); |
| 800 } | 800 } |
| 801 | 801 |
| 802 TEST_F(GpuControlListEntryTest, NeedsMoreInfoForGlVersionEntry) { | |
| 803 const std::string json = LONG_STRING_CONST( | |
| 804 { | |
| 805 "id" : 1, | |
| 806 "gl_type": "gl", | |
| 807 "gl_version": { | |
| 808 "op": "<", | |
| 809 "value" : "3.5" | |
| 810 }, | |
| 811 "features" : [ | |
| 812 "test_feature_1" | |
| 813 ] | |
| 814 } | |
| 815 ); | |
| 816 ScopedEntry entry(GetEntryFromString(json)); | |
| 817 EXPECT_TRUE(entry.get() != NULL); | |
| 818 | |
| 819 GPUInfo gpu_info; | |
| 820 EXPECT_TRUE(entry->NeedsMoreInfo(gpu_info, true)); | |
| 821 EXPECT_TRUE( | |
| 822 entry->Contains(GpuControlList::kOsUnknown, std::string(), gpu_info)); | |
| 823 | |
| 824 gpu_info.gl_version = "3.1 Mesa 11.1.0"; | |
| 825 EXPECT_FALSE(entry->NeedsMoreInfo(gpu_info, false)); | |
| 826 EXPECT_TRUE( | |
| 827 entry->Contains(GpuControlList::kOsUnknown, std::string(), gpu_info)); | |
| 828 | |
| 829 gpu_info.gl_version = "4.1 Mesa 12.1.0"; | |
| 830 EXPECT_FALSE(entry->NeedsMoreInfo(gpu_info, false)); | |
| 831 EXPECT_FALSE( | |
| 832 entry->Contains(GpuControlList::kOsUnknown, std::string(), gpu_info)); | |
| 833 | |
| 834 gpu_info.gl_version = "OpenGL ES 2.0 Mesa 12.1.0"; | |
| 835 EXPECT_FALSE(entry->NeedsMoreInfo(gpu_info, false)); | |
| 836 EXPECT_FALSE( | |
| 837 entry->Contains(GpuControlList::kOsUnknown, std::string(), gpu_info)); | |
|
Zhenyao Mo
2016/09/30 23:29:22
Can you try a "OpenGL ES 3.6 Mesa 20.0.0"? Just wa
Zhenyao Mo
2016/09/30 23:30:14
Never mind. Just realized it/s < 3.5 so this last
| |
| 838 } | |
| 839 | |
| 802 TEST_F(GpuControlListEntryTest, FeatureTypeAllEntry) { | 840 TEST_F(GpuControlListEntryTest, FeatureTypeAllEntry) { |
| 803 const std::string json = LONG_STRING_CONST( | 841 const std::string json = LONG_STRING_CONST( |
| 804 { | 842 { |
| 805 "id": 1, | 843 "id": 1, |
| 806 "features": [ | 844 "features": [ |
| 807 "all" | 845 "all" |
| 808 ] | 846 ] |
| 809 } | 847 } |
| 810 ); | 848 ); |
| 811 ScopedEntry entry(GetEntryFromString(json, true)); | 849 ScopedEntry entry(GetEntryFromString(json, true)); |
| (...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1316 EXPECT_TRUE(entry->Contains(GpuControlList::kOsLinux, | 1354 EXPECT_TRUE(entry->Contains(GpuControlList::kOsLinux, |
| 1317 "3.13.0-63-generic", | 1355 "3.13.0-63-generic", |
| 1318 gpu_info)); | 1356 gpu_info)); |
| 1319 EXPECT_FALSE(entry->Contains(GpuControlList::kOsLinux, | 1357 EXPECT_FALSE(entry->Contains(GpuControlList::kOsLinux, |
| 1320 "3.19.2-1-generic", | 1358 "3.19.2-1-generic", |
| 1321 gpu_info)); | 1359 gpu_info)); |
| 1322 } | 1360 } |
| 1323 | 1361 |
| 1324 } // namespace gpu | 1362 } // namespace gpu |
| 1325 | 1363 |
| OLD | NEW |