diff options
author | zmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-28 02:12:14 +0000 |
---|---|---|
committer | zmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-28 02:12:14 +0000 |
commit | b018639e360f44f062906c0a16c4406c29c53f5a (patch) | |
tree | db55b02440b63ed1249661df26e03a2506faa683 /content/test/gpu | |
parent | c7ea77e81b374fa2efd6c27bd221a1d31e9031b3 (diff) | |
download | chromium_src-b018639e360f44f062906c0a16c4406c29c53f5a.zip chromium_src-b018639e360f44f062906c0a16c4406c29c53f5a.tar.gz chromium_src-b018639e360f44f062906c0a16c4406c29c53f5a.tar.bz2 |
Add GPU info collection to GPUTestConfig.
We didn't add it the first place due to a shared build failure. This should be added so the GPUTestConfig can be easier to use.
BUG=101216
TEST=content_unittests
R=kbr
Review URL: http://codereview.chromium.org/9288073
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119553 0039d316-1c4b-4281-b951-d872f2087c98
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()); } |