OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "gpu/config/gpu_util.h" | 5 #include "gpu/config/gpu_util.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/strings/string_split.h" | 9 #include "base/strings/string_split.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 TEST(GpuUtilTest, | 82 TEST(GpuUtilTest, |
83 ApplyGpuDriverBugWorkarounds_DisabledExtensions) { | 83 ApplyGpuDriverBugWorkarounds_DisabledExtensions) { |
84 GPUInfo gpu_info; | 84 GPUInfo gpu_info; |
85 CollectBasicGraphicsInfo(&gpu_info); | 85 CollectBasicGraphicsInfo(&gpu_info); |
86 std::unique_ptr<GpuDriverBugList> list(GpuDriverBugList::Create()); | 86 std::unique_ptr<GpuDriverBugList> list(GpuDriverBugList::Create()); |
87 list->LoadList(kGpuDriverBugListJson, GpuControlList::kCurrentOsOnly); | 87 list->LoadList(kGpuDriverBugListJson, GpuControlList::kCurrentOsOnly); |
88 list->MakeDecision(GpuControlList::kOsAny, std::string(), gpu_info); | 88 list->MakeDecision(GpuControlList::kOsAny, std::string(), gpu_info); |
89 std::vector<std::string> expected_disabled_extensions = | 89 std::vector<std::string> expected_disabled_extensions = |
90 list->GetDisabledExtensions(); | 90 list->GetDisabledExtensions(); |
91 base::CommandLine command_line(base::CommandLine::NO_PROGRAM); | 91 base::CommandLine command_line(base::CommandLine::NO_PROGRAM); |
92 ApplyGpuDriverBugWorkarounds(gpu_info, &command_line); | 92 ApplyGpuDriverBugWorkarounds(gpu_info, std::string(), &command_line); |
93 | 93 |
94 std::vector<std::string> actual_disabled_extensions = base::SplitString( | 94 std::vector<std::string> actual_disabled_extensions = base::SplitString( |
95 command_line.GetSwitchValueASCII(switches::kDisableGLExtensions), ", ;", | 95 command_line.GetSwitchValueASCII(switches::kDisableGLExtensions), ", ;", |
96 base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); | 96 base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); |
97 sort(expected_disabled_extensions.begin(), | 97 sort(expected_disabled_extensions.begin(), |
98 expected_disabled_extensions.end()); | 98 expected_disabled_extensions.end()); |
99 sort(actual_disabled_extensions.begin(), actual_disabled_extensions.end()); | 99 sort(actual_disabled_extensions.begin(), actual_disabled_extensions.end()); |
100 | 100 |
101 EXPECT_EQ(expected_disabled_extensions, actual_disabled_extensions); | 101 EXPECT_EQ(expected_disabled_extensions, actual_disabled_extensions); |
102 } | 102 } |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 EXPECT_EQ(gpu_info.secondary_gpus.size(), 2ul); | 203 EXPECT_EQ(gpu_info.secondary_gpus.size(), 2ul); |
204 | 204 |
205 command_line.AppendSwitchASCII(switches::kGpuTestingSecondaryVendorIDs, ""); | 205 command_line.AppendSwitchASCII(switches::kGpuTestingSecondaryVendorIDs, ""); |
206 command_line.AppendSwitchASCII(switches::kGpuTestingSecondaryDeviceIDs, ""); | 206 command_line.AppendSwitchASCII(switches::kGpuTestingSecondaryDeviceIDs, ""); |
207 | 207 |
208 ParseSecondaryGpuDevicesFromCommandLine(command_line, &gpu_info); | 208 ParseSecondaryGpuDevicesFromCommandLine(command_line, &gpu_info); |
209 EXPECT_EQ(gpu_info.secondary_gpus.size(), 0ul); | 209 EXPECT_EQ(gpu_info.secondary_gpus.size(), 0ul); |
210 } | 210 } |
211 | 211 |
212 } // namespace gpu | 212 } // namespace gpu |
OLD | NEW |