diff options
Diffstat (limited to 'content/test/gpu')
-rw-r--r-- | content/test/gpu/gpu_test_config.cc | 12 | ||||
-rw-r--r-- | content/test/gpu/gpu_test_config.h | 3 | ||||
-rw-r--r-- | content/test/gpu/gpu_test_config_unittest.cc | 2 |
3 files changed, 13 insertions, 4 deletions
diff --git a/content/test/gpu/gpu_test_config.cc b/content/test/gpu/gpu_test_config.cc index 077e37c..946c6a2 100644 --- a/content/test/gpu/gpu_test_config.cc +++ b/content/test/gpu/gpu_test_config.cc @@ -6,6 +6,7 @@ #include "base/logging.h" #include "base/sys_info.h" +#include "content/gpu/gpu_info_collector.h" #include "content/public/common/gpu_info.h" namespace { @@ -188,8 +189,15 @@ bool GPUTestBotConfig::Matches(const GPUTestConfig& config) const { return true; } -bool GPUTestBotConfig::LoadCurrentConfig(const content::GPUInfo& gpu_info) { - bool rt = SetGPUInfo(gpu_info); +bool GPUTestBotConfig::LoadCurrentConfig(const content::GPUInfo* gpu_info) { + bool rt; + if (gpu_info == NULL) { + content::GPUInfo my_gpu_info; + gpu_info_collector::CollectPreliminaryGraphicsInfo(&my_gpu_info); + rt = SetGPUInfo(my_gpu_info); + } else { + rt = SetGPUInfo(*gpu_info); + } set_os(GetCurrentOS()); if (os() == kOsUnknown) rt = false; diff --git a/content/test/gpu/gpu_test_config.h b/content/test/gpu/gpu_test_config.h index 412fe57..4c14d0f 100644 --- a/content/test/gpu/gpu_test_config.h +++ b/content/test/gpu/gpu_test_config.h @@ -97,7 +97,8 @@ class GPUTestBotConfig : public GPUTestConfig { bool Matches(const GPUTestConfig& config) const; // Setup the config with the current gpu testing environment. - bool LoadCurrentConfig(const content::GPUInfo& gpu_info); + // If gpu_info is NULL, collect GPUInfo first. + bool LoadCurrentConfig(const content::GPUInfo* gpu_info); }; #endif // CONTENT_TEST_GPU_GPU_TEST_CONFIG_H_ diff --git a/content/test/gpu/gpu_test_config_unittest.cc b/content/test/gpu/gpu_test_config_unittest.cc index 48aaef5..7c0a3b0 100644 --- a/content/test/gpu/gpu_test_config_unittest.cc +++ b/content/test/gpu/gpu_test_config_unittest.cc @@ -214,7 +214,7 @@ TEST_F(GPUTestConfigTest, LoadCurrentConfig) { content::GPUInfo gpu_info; gpu_info.vendor_id = 0x10de; gpu_info.device_id = 0x0640; - EXPECT_TRUE(config.LoadCurrentConfig(gpu_info)); + EXPECT_TRUE(config.LoadCurrentConfig(&gpu_info)); EXPECT_TRUE(config.IsValid()); } |