OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/message_loop.h" | 5 #include "base/message_loop.h" |
6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
7 #include "base/time.h" | 7 #include "base/time.h" |
8 #include "content/browser/gpu/gpu_data_manager_impl.h" | 8 #include "content/browser/gpu/gpu_data_manager_impl.h" |
9 #include "content/public/browser/gpu_data_manager_observer.h" | 9 #include "content/public/browser/gpu_data_manager_observer.h" |
10 #include "content/public/common/gpu_info.h" | 10 #include "content/public/common/gpu_info.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 "}"; | 135 "}"; |
136 | 136 |
137 GPUInfo gpu_info; | 137 GPUInfo gpu_info; |
138 gpu_info.gpu.vendor_id = 0x10de; | 138 gpu_info.gpu.vendor_id = 0x10de; |
139 gpu_info.gpu.device_id = 0x0640; | 139 gpu_info.gpu.device_id = 0x0640; |
140 manager->InitializeForTesting(blacklist_json, gpu_info); | 140 manager->InitializeForTesting(blacklist_json, gpu_info); |
141 | 141 |
142 EXPECT_TRUE(manager->GpuAccessAllowed()); | 142 EXPECT_TRUE(manager->GpuAccessAllowed()); |
143 EXPECT_EQ(GPU_FEATURE_TYPE_WEBGL, manager->GetBlacklistedFeatures()); | 143 EXPECT_EQ(GPU_FEATURE_TYPE_WEBGL, manager->GetBlacklistedFeatures()); |
144 | 144 |
| 145 gpu_info.gl_vendor = "NVIDIA"; |
145 gpu_info.gl_renderer = "NVIDIA GeForce GT 120"; | 146 gpu_info.gl_renderer = "NVIDIA GeForce GT 120"; |
146 manager->UpdateGpuInfo(gpu_info); | 147 manager->UpdateGpuInfo(gpu_info); |
147 EXPECT_FALSE(manager->GpuAccessAllowed()); | 148 EXPECT_FALSE(manager->GpuAccessAllowed()); |
148 EXPECT_EQ(GPU_FEATURE_TYPE_WEBGL | | 149 EXPECT_EQ(GPU_FEATURE_TYPE_WEBGL | |
149 GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS, | 150 GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS, |
150 manager->GetBlacklistedFeatures()); | 151 manager->GetBlacklistedFeatures()); |
151 } | 152 } |
152 | 153 |
153 TEST_F(GpuDataManagerImplTest, GpuSideExceptions) { | 154 TEST_F(GpuDataManagerImplTest, GpuSideExceptions) { |
154 ScopedGpuDataManagerImpl manager; | 155 ScopedGpuDataManagerImpl manager; |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 manager->UnblockDomainFrom3DAPIs(GetDomain1ForTesting()); | 445 manager->UnblockDomainFrom3DAPIs(GetDomain1ForTesting()); |
445 | 446 |
446 // This behavior is debatable. Perhaps the GPU reset caused by | 447 // This behavior is debatable. Perhaps the GPU reset caused by |
447 // domain 1 should still cause other domains to be blocked. | 448 // domain 1 should still cause other domains to be blocked. |
448 EXPECT_EQ(GpuDataManagerImpl::DOMAIN_BLOCK_STATUS_NOT_BLOCKED, | 449 EXPECT_EQ(GpuDataManagerImpl::DOMAIN_BLOCK_STATUS_NOT_BLOCKED, |
449 manager->Are3DAPIsBlockedAtTime(GetDomain2ForTesting(), | 450 manager->Are3DAPIsBlockedAtTime(GetDomain2ForTesting(), |
450 JustBeforeExpiration(manager))); | 451 JustBeforeExpiration(manager))); |
451 } | 452 } |
452 | 453 |
453 } // namespace content | 454 } // namespace content |
OLD | NEW |