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 "content/browser/gpu/gpu_data_manager_impl.h" | 7 #include "content/browser/gpu/gpu_data_manager_impl.h" |
8 #include "content/public/browser/gpu_data_manager_observer.h" | 8 #include "content/public/browser/gpu_data_manager_observer.h" |
9 #include "content/public/common/gpu_info.h" | 9 #include "content/public/common/gpu_info.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 " }\n" | 139 " }\n" |
140 " ]\n" | 140 " ]\n" |
141 "}"; | 141 "}"; |
142 | 142 |
143 content::GPUInfo gpu_info; | 143 content::GPUInfo gpu_info; |
144 gpu_info.gpu.vendor_id = 0x10de; | 144 gpu_info.gpu.vendor_id = 0x10de; |
145 gpu_info.gpu.device_id = 0x0640; | 145 gpu_info.gpu.device_id = 0x0640; |
146 manager->InitializeForTesting(blacklist_json, gpu_info); | 146 manager->InitializeForTesting(blacklist_json, gpu_info); |
147 | 147 |
148 EXPECT_TRUE(manager->GpuAccessAllowed()); | 148 EXPECT_TRUE(manager->GpuAccessAllowed()); |
149 EXPECT_EQ(content::GPU_FEATURE_TYPE_WEBGL, | 149 EXPECT_EQ(0, manager->GetBlacklistedFeatures()); |
150 manager->GetBlacklistedFeatures()); | |
151 | 150 |
152 // Now assue gpu process launches and full GPU info is collected. | 151 // Now assue gpu process launches and full GPU info is collected. |
153 gpu_info.gl_renderer = "NVIDIA GeForce GT 120"; | 152 gpu_info.gl_renderer = "NVIDIA GeForce GT 120"; |
154 manager->UpdateGpuInfo(gpu_info); | 153 manager->UpdateGpuInfo(gpu_info); |
155 EXPECT_TRUE(manager->GpuAccessAllowed()); | 154 EXPECT_TRUE(manager->GpuAccessAllowed()); |
156 EXPECT_EQ(0, manager->GetBlacklistedFeatures()); | 155 EXPECT_EQ(0, manager->GetBlacklistedFeatures()); |
157 | 156 |
158 delete manager; | 157 delete manager; |
159 } | 158 } |
160 | 159 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 content::GPUVideoMemoryUsageStats vram_stats; | 249 content::GPUVideoMemoryUsageStats vram_stats; |
251 manager->UpdateVideoMemoryUsageStats(vram_stats); | 250 manager->UpdateVideoMemoryUsageStats(vram_stats); |
252 | 251 |
253 base::RunLoop run_loop; | 252 base::RunLoop run_loop; |
254 run_loop.RunUntilIdle(); | 253 run_loop.RunUntilIdle(); |
255 EXPECT_TRUE(observer.video_memory_usage_stats_updated()); | 254 EXPECT_TRUE(observer.video_memory_usage_stats_updated()); |
256 | 255 |
257 delete manager; | 256 delete manager; |
258 } | 257 } |
259 | 258 |
OLD | NEW |