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 "base/logging.h" | 5 #include "base/logging.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "content/browser/gpu/gpu_control_list_jsons.h" | 7 #include "gpu/config/gpu_control_list_jsons.h" |
8 #include "content/browser/gpu/gpu_driver_bug_list.h" | 8 #include "gpu/config/gpu_driver_bug_list.h" |
9 #include "content/public/common/gpu_info.h" | 9 #include "gpu/config/gpu_driver_bug_workaround_type.h" |
10 #include "gpu/command_buffer/service/gpu_driver_bug_workaround_type.h" | 10 #include "gpu/config/gpu_info.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 | 12 |
13 const char kOsVersion[] = "10.6.4"; | 13 const char kOsVersion[] = "10.6.4"; |
14 | 14 |
15 namespace content { | 15 namespace gpu { |
16 | 16 |
17 class GpuDriverBugListTest : public testing::Test { | 17 class GpuDriverBugListTest : public testing::Test { |
18 public: | 18 public: |
19 GpuDriverBugListTest() { } | 19 GpuDriverBugListTest() { } |
20 | 20 |
21 virtual ~GpuDriverBugListTest() { } | 21 virtual ~GpuDriverBugListTest() { } |
22 | 22 |
23 const GPUInfo& gpu_info() const { | 23 const GPUInfo& gpu_info() const { |
24 return gpu_info_; | 24 return gpu_info_; |
25 } | 25 } |
(...skipping 29 matching lines...) Expand all Loading... |
55 | 55 |
56 TEST_F(GpuDriverBugListTest, CurrentListForARM) { | 56 TEST_F(GpuDriverBugListTest, CurrentListForARM) { |
57 scoped_ptr<GpuDriverBugList> list(GpuDriverBugList::Create()); | 57 scoped_ptr<GpuDriverBugList> list(GpuDriverBugList::Create()); |
58 EXPECT_TRUE(list->LoadList(kGpuDriverBugListJson, GpuControlList::kAllOs)); | 58 EXPECT_TRUE(list->LoadList(kGpuDriverBugListJson, GpuControlList::kAllOs)); |
59 | 59 |
60 GPUInfo gpu_info; | 60 GPUInfo gpu_info; |
61 gpu_info.gl_vendor = "ARM"; | 61 gpu_info.gl_vendor = "ARM"; |
62 gpu_info.gl_renderer = "MALi_T604"; | 62 gpu_info.gl_renderer = "MALi_T604"; |
63 std::set<int> bugs = list->MakeDecision( | 63 std::set<int> bugs = list->MakeDecision( |
64 GpuControlList::kOsAndroid, "4.1", gpu_info); | 64 GpuControlList::kOsAndroid, "4.1", gpu_info); |
65 EXPECT_EQ(1u, bugs.count(gpu::USE_CLIENT_SIDE_ARRAYS_FOR_STREAM_BUFFERS)); | 65 EXPECT_EQ(1u, bugs.count(USE_CLIENT_SIDE_ARRAYS_FOR_STREAM_BUFFERS)); |
66 } | 66 } |
67 | 67 |
68 TEST_F(GpuDriverBugListTest, CurrentListForImagination) { | 68 TEST_F(GpuDriverBugListTest, CurrentListForImagination) { |
69 scoped_ptr<GpuDriverBugList> list(GpuDriverBugList::Create()); | 69 scoped_ptr<GpuDriverBugList> list(GpuDriverBugList::Create()); |
70 EXPECT_TRUE(list->LoadList(kGpuDriverBugListJson, GpuControlList::kAllOs)); | 70 EXPECT_TRUE(list->LoadList(kGpuDriverBugListJson, GpuControlList::kAllOs)); |
71 | 71 |
72 GPUInfo gpu_info; | 72 GPUInfo gpu_info; |
73 gpu_info.gl_vendor = "Imagination Technologies"; | 73 gpu_info.gl_vendor = "Imagination Technologies"; |
74 gpu_info.gl_renderer = "PowerVR SGX 540"; | 74 gpu_info.gl_renderer = "PowerVR SGX 540"; |
75 std::set<int> bugs = list->MakeDecision( | 75 std::set<int> bugs = list->MakeDecision( |
76 GpuControlList::kOsAndroid, "4.1", gpu_info); | 76 GpuControlList::kOsAndroid, "4.1", gpu_info); |
77 EXPECT_EQ(1u, bugs.count(gpu::USE_CLIENT_SIDE_ARRAYS_FOR_STREAM_BUFFERS)); | 77 EXPECT_EQ(1u, bugs.count(USE_CLIENT_SIDE_ARRAYS_FOR_STREAM_BUFFERS)); |
78 } | 78 } |
79 | 79 |
80 } // namespace content | 80 } // namespace gpu |
81 | 81 |
OLD | NEW |