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 #ifndef CONTENT_TEST_GPU_GPU_TEST_CONFIG_H_ | 5 #ifndef GPU_CONFIG_GPU_TEST_CONFIG_H_ |
6 #define CONTENT_TEST_GPU_GPU_TEST_CONFIG_H_ | 6 #define GPU_CONFIG_GPU_TEST_CONFIG_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "gpu/gpu_export.h" |
13 | 14 |
14 namespace gpu { | 15 namespace gpu { |
| 16 |
15 struct GPUInfo; | 17 struct GPUInfo; |
16 } // namespace content | |
17 | 18 |
18 class GPUTestConfig { | 19 class GPU_EXPORT GPUTestConfig { |
19 public: | 20 public: |
20 enum OS { | 21 enum OS { |
21 kOsUnknown = 0, | 22 kOsUnknown = 0, |
22 kOsWinXP = 1 << 0, | 23 kOsWinXP = 1 << 0, |
23 kOsWinVista = 1 << 1, | 24 kOsWinVista = 1 << 1, |
24 kOsWin7 = 1 << 2, | 25 kOsWin7 = 1 << 2, |
25 kOsWin8 = 1 << 3, | 26 kOsWin8 = 1 << 3, |
26 kOsWin = kOsWinXP | kOsWinVista | kOsWin7 | kOsWin8, | 27 kOsWin = kOsWinXP | kOsWinVista | kOsWin7 | kOsWin8, |
27 kOsMacLeopard = 1 << 4, | 28 kOsMacLeopard = 1 << 4, |
28 kOsMacSnowLeopard = 1 << 5, | 29 kOsMacSnowLeopard = 1 << 5, |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 // GPU vendor. | 81 // GPU vendor. |
81 std::vector<uint32> gpu_vendor_; | 82 std::vector<uint32> gpu_vendor_; |
82 | 83 |
83 // GPU device id (unique to each vendor). | 84 // GPU device id (unique to each vendor). |
84 uint32 gpu_device_id_; | 85 uint32 gpu_device_id_; |
85 | 86 |
86 // Release or Debug. | 87 // Release or Debug. |
87 int32 build_type_; | 88 int32 build_type_; |
88 }; | 89 }; |
89 | 90 |
90 class GPUTestBotConfig : public GPUTestConfig { | 91 class GPU_EXPORT GPUTestBotConfig : public GPUTestConfig { |
91 public: | 92 public: |
92 GPUTestBotConfig() { } | 93 GPUTestBotConfig() { } |
93 virtual ~GPUTestBotConfig(); | 94 virtual ~GPUTestBotConfig(); |
94 | 95 |
95 // This should only be called when no gpu_vendor is added. | 96 // This should only be called when no gpu_vendor is added. |
96 virtual void AddGPUVendor(uint32 gpu_vendor) OVERRIDE; | 97 virtual void AddGPUVendor(uint32 gpu_vendor) OVERRIDE; |
97 | 98 |
98 // Return false if gpu_info does not have valid vendor_id and device_id. | 99 // Return false if gpu_info does not have valid vendor_id and device_id. |
99 bool SetGPUInfo(const gpu::GPUInfo& gpu_info); | 100 bool SetGPUInfo(const GPUInfo& gpu_info); |
100 | 101 |
101 // Check if the bot config is valid, i.e., if it is one valid test-bot | 102 // Check if the bot config is valid, i.e., if it is one valid test-bot |
102 // environment. For example, if a field is unknown, or if OS is not one | 103 // environment. For example, if a field is unknown, or if OS is not one |
103 // fully defined OS, then it's valid. | 104 // fully defined OS, then it's valid. |
104 virtual bool IsValid() const OVERRIDE; | 105 virtual bool IsValid() const OVERRIDE; |
105 | 106 |
106 // Check if a bot config matches a test config, i.e., the test config is a | 107 // Check if a bot config matches a test config, i.e., the test config is a |
107 // superset of the bot config. | 108 // superset of the bot config. |
108 bool Matches(const GPUTestConfig& config) const; | 109 bool Matches(const GPUTestConfig& config) const; |
109 bool Matches(const std::string& config_data) const; | 110 bool Matches(const std::string& config_data) const; |
110 | 111 |
111 // Setup the config with the current gpu testing environment. | 112 // Setup the config with the current gpu testing environment. |
112 // If gpu_info is NULL, collect GPUInfo first. | 113 // If gpu_info is NULL, collect GPUInfo first. |
113 bool LoadCurrentConfig(const gpu::GPUInfo* gpu_info); | 114 bool LoadCurrentConfig(const GPUInfo* gpu_info); |
114 | 115 |
115 // Check if this bot's config matches |config_data| or any of the |configs|. | 116 // Check if this bot's config matches |config_data| or any of the |configs|. |
116 static bool CurrentConfigMatches(const std::string& config_data); | 117 static bool CurrentConfigMatches(const std::string& config_data); |
117 static bool CurrentConfigMatches(const std::vector<std::string>& configs); | 118 static bool CurrentConfigMatches(const std::vector<std::string>& configs); |
118 }; | 119 }; |
119 | 120 |
120 #endif // CONTENT_TEST_GPU_GPU_TEST_CONFIG_H_ | 121 } // namespace gpu |
121 | 122 |
| 123 #endif // GPU_CONFIG_GPU_TEST_CONFIG_H_ |
| 124 |
OLD | NEW |