| 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/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "content/browser/gpu/gpu_data_manager_impl_private.h" | 9 #include "content/browser/gpu/gpu_data_manager_impl_private.h" |
| 10 #include "content/public/browser/gpu_data_manager_observer.h" | 10 #include "content/public/browser/gpu_data_manager_observer.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 namespace content { | 23 namespace content { |
| 24 namespace { | 24 namespace { |
| 25 | 25 |
| 26 class TestObserver : public GpuDataManagerObserver { | 26 class TestObserver : public GpuDataManagerObserver { |
| 27 public: | 27 public: |
| 28 TestObserver() | 28 TestObserver() |
| 29 : gpu_info_updated_(false), | 29 : gpu_info_updated_(false), |
| 30 video_memory_usage_stats_updated_(false) { | 30 video_memory_usage_stats_updated_(false) { |
| 31 } | 31 } |
| 32 virtual ~TestObserver() { } | 32 ~TestObserver() override {} |
| 33 | 33 |
| 34 bool gpu_info_updated() const { return gpu_info_updated_; } | 34 bool gpu_info_updated() const { return gpu_info_updated_; } |
| 35 bool video_memory_usage_stats_updated() const { | 35 bool video_memory_usage_stats_updated() const { |
| 36 return video_memory_usage_stats_updated_; | 36 return video_memory_usage_stats_updated_; |
| 37 } | 37 } |
| 38 | 38 |
| 39 virtual void OnGpuInfoUpdate() override { | 39 void OnGpuInfoUpdate() override { gpu_info_updated_ = true; } |
| 40 gpu_info_updated_ = true; | |
| 41 } | |
| 42 | 40 |
| 43 virtual void OnVideoMemoryUsageStatsUpdate( | 41 void OnVideoMemoryUsageStatsUpdate( |
| 44 const GPUVideoMemoryUsageStats& stats) override { | 42 const GPUVideoMemoryUsageStats& stats) override { |
| 45 video_memory_usage_stats_updated_ = true; | 43 video_memory_usage_stats_updated_ = true; |
| 46 } | 44 } |
| 47 | 45 |
| 48 void Reset() { | 46 void Reset() { |
| 49 gpu_info_updated_ = false; | 47 gpu_info_updated_ = false; |
| 50 video_memory_usage_stats_updated_ = false; | 48 video_memory_usage_stats_updated_ = false; |
| 51 } | 49 } |
| 52 | 50 |
| 53 private: | 51 private: |
| (...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 EXPECT_TRUE(manager->UpdateActiveGpu(0x8086, 0x04a1)); | 747 EXPECT_TRUE(manager->UpdateActiveGpu(0x8086, 0x04a1)); |
| 750 { | 748 { |
| 751 base::RunLoop run_loop; | 749 base::RunLoop run_loop; |
| 752 run_loop.RunUntilIdle(); | 750 run_loop.RunUntilIdle(); |
| 753 } | 751 } |
| 754 EXPECT_TRUE(observer.gpu_info_updated()); | 752 EXPECT_TRUE(observer.gpu_info_updated()); |
| 755 EXPECT_EQ(1u, manager->GetBlacklistedFeatureCount()); | 753 EXPECT_EQ(1u, manager->GetBlacklistedFeatureCount()); |
| 756 } | 754 } |
| 757 | 755 |
| 758 } // namespace content | 756 } // namespace content |
| OLD | NEW |