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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 TEST_F(GpuDataManagerImplTest, GpuSideBlacklisting) { | 62 TEST_F(GpuDataManagerImplTest, GpuSideBlacklisting) { |
63 // If a feature is allowed in preliminary step (browser side), but | 63 // If a feature is allowed in preliminary step (browser side), but |
64 // disabled when GPU process launches and collects full GPU info, | 64 // disabled when GPU process launches and collects full GPU info, |
65 // it's too late to let renderer know, so we basically block all GPU | 65 // it's too late to let renderer know, so we basically block all GPU |
66 // access, to be on the safe side. | 66 // access, to be on the safe side. |
67 GpuDataManagerImpl* manager = new GpuDataManagerImpl(); | 67 GpuDataManagerImpl* manager = new GpuDataManagerImpl(); |
68 ASSERT_TRUE(manager); | 68 ASSERT_TRUE(manager); |
69 EXPECT_EQ(0, manager->GetBlacklistedFeatures()); | 69 EXPECT_EQ(0, manager->GetBlacklistedFeatures()); |
70 EXPECT_TRUE(manager->GpuAccessAllowed()); | 70 EXPECT_TRUE(manager->GpuAccessAllowed()); |
71 | 71 |
72 manager->SetPreliminaryBlacklistedFeatures( | 72 manager->UpdateBlacklistedFeatures( |
73 content::GPU_FEATURE_TYPE_WEBGL); | 73 content::GPU_FEATURE_TYPE_WEBGL); |
| 74 manager->UpdatePreliminaryBlacklistedFeatures(); |
74 EXPECT_TRUE(manager->GpuAccessAllowed()); | 75 EXPECT_TRUE(manager->GpuAccessAllowed()); |
75 EXPECT_EQ(content::GPU_FEATURE_TYPE_WEBGL, | 76 EXPECT_EQ(content::GPU_FEATURE_TYPE_WEBGL, |
76 manager->GetBlacklistedFeatures()); | 77 manager->GetBlacklistedFeatures()); |
77 | 78 |
78 manager->UpdateBlacklistedFeatures( | 79 manager->UpdateBlacklistedFeatures( |
79 content::GPU_FEATURE_TYPE_WEBGL); | 80 content::GPU_FEATURE_TYPE_WEBGL); |
80 EXPECT_TRUE(manager->GpuAccessAllowed()); | 81 EXPECT_TRUE(manager->GpuAccessAllowed()); |
81 EXPECT_EQ(content::GPU_FEATURE_TYPE_WEBGL, | 82 EXPECT_EQ(content::GPU_FEATURE_TYPE_WEBGL, |
82 manager->GetBlacklistedFeatures()); | 83 manager->GetBlacklistedFeatures()); |
83 | 84 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 content::GPUVideoMemoryUsageStats vram_stats; | 139 content::GPUVideoMemoryUsageStats vram_stats; |
139 manager->UpdateVideoMemoryUsageStats(vram_stats); | 140 manager->UpdateVideoMemoryUsageStats(vram_stats); |
140 | 141 |
141 base::RunLoop run_loop; | 142 base::RunLoop run_loop; |
142 run_loop.RunUntilIdle(); | 143 run_loop.RunUntilIdle(); |
143 EXPECT_TRUE(observer.video_memory_usage_stats_updated()); | 144 EXPECT_TRUE(observer.video_memory_usage_stats_updated()); |
144 | 145 |
145 delete manager; | 146 delete manager; |
146 } | 147 } |
147 | 148 |
OLD | NEW |