| 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 <stdint.h> |
| 6 |
| 5 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 6 #include "base/logging.h" | 8 #include "base/logging.h" |
| 7 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 8 #include "gpu/config/gpu_control_list_jsons.h" | 10 #include "gpu/config/gpu_control_list_jsons.h" |
| 9 #include "gpu/config/gpu_driver_bug_list.h" | 11 #include "gpu/config/gpu_driver_bug_list.h" |
| 10 #include "gpu/config/gpu_driver_bug_workaround_type.h" | 12 #include "gpu/config/gpu_driver_bug_workaround_type.h" |
| 11 #include "gpu/config/gpu_info.h" | 13 #include "gpu/config/gpu_info.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 15 |
| 14 #define LONG_STRING_CONST(...) #__VA_ARGS__ | 16 #define LONG_STRING_CONST(...) #__VA_ARGS__ |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 } | 102 } |
| 101 ] | 103 ] |
| 102 } | 104 } |
| 103 ); | 105 ); |
| 104 scoped_ptr<GpuDriverBugList> driver_bug_list(GpuDriverBugList::Create()); | 106 scoped_ptr<GpuDriverBugList> driver_bug_list(GpuDriverBugList::Create()); |
| 105 EXPECT_TRUE(driver_bug_list->LoadList(json, GpuControlList::kAllOs)); | 107 EXPECT_TRUE(driver_bug_list->LoadList(json, GpuControlList::kAllOs)); |
| 106 std::set<int> switching = driver_bug_list->MakeDecision( | 108 std::set<int> switching = driver_bug_list->MakeDecision( |
| 107 GpuControlList::kOsMacosx, "10.8", gpu_info()); | 109 GpuControlList::kOsMacosx, "10.8", gpu_info()); |
| 108 EXPECT_EQ(1u, switching.size()); | 110 EXPECT_EQ(1u, switching.size()); |
| 109 EXPECT_EQ(1u, switching.count(FORCE_DISCRETE_GPU)); | 111 EXPECT_EQ(1u, switching.count(FORCE_DISCRETE_GPU)); |
| 110 std::vector<uint32> entries; | 112 std::vector<uint32_t> entries; |
| 111 driver_bug_list->GetDecisionEntries(&entries, false); | 113 driver_bug_list->GetDecisionEntries(&entries, false); |
| 112 ASSERT_EQ(1u, entries.size()); | 114 ASSERT_EQ(1u, entries.size()); |
| 113 EXPECT_EQ(1u, entries[0]); | 115 EXPECT_EQ(1u, entries[0]); |
| 114 | 116 |
| 115 driver_bug_list.reset(GpuDriverBugList::Create()); | 117 driver_bug_list.reset(GpuDriverBugList::Create()); |
| 116 EXPECT_TRUE(driver_bug_list->LoadList(json, GpuControlList::kAllOs)); | 118 EXPECT_TRUE(driver_bug_list->LoadList(json, GpuControlList::kAllOs)); |
| 117 switching = driver_bug_list->MakeDecision( | 119 switching = driver_bug_list->MakeDecision( |
| 118 GpuControlList::kOsWin, "6.1", gpu_info()); | 120 GpuControlList::kOsWin, "6.1", gpu_info()); |
| 119 EXPECT_EQ(1u, switching.size()); | 121 EXPECT_EQ(1u, switching.size()); |
| 120 EXPECT_EQ(1u, switching.count(FORCE_INTEGRATED_GPU)); | 122 EXPECT_EQ(1u, switching.count(FORCE_INTEGRATED_GPU)); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 EXPECT_EQ(1u, bugs.count(DISABLE_D3D11)); | 201 EXPECT_EQ(1u, bugs.count(DISABLE_D3D11)); |
| 200 | 202 |
| 201 // test a higher driver version number | 203 // test a higher driver version number |
| 202 gpu_info.driver_version = "9.18.13.2723"; | 204 gpu_info.driver_version = "9.18.13.2723"; |
| 203 bugs = list->MakeDecision(GpuControlList::kOsWin, "7.0", gpu_info); | 205 bugs = list->MakeDecision(GpuControlList::kOsWin, "7.0", gpu_info); |
| 204 EXPECT_EQ(0u, bugs.count(DISABLE_D3D11)); | 206 EXPECT_EQ(0u, bugs.count(DISABLE_D3D11)); |
| 205 } | 207 } |
| 206 | 208 |
| 207 } // namespace gpu | 209 } // namespace gpu |
| 208 | 210 |
| OLD | NEW |