OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 * | 6 * |
7 * TODO(epoger): Combine this with tools/image_expectations.h, or eliminate one
of the two. | 7 * TODO(epoger): Combine this with tools/image_expectations.h, or eliminate one
of the two. |
8 */ | 8 */ |
9 #ifndef gm_expectations_DEFINED | 9 #ifndef gm_expectations_DEFINED |
10 #define gm_expectations_DEFINED | 10 #define gm_expectations_DEFINED |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 public: | 186 public: |
187 /** | 187 /** |
188 * Create an ExpectationsSource that will return Expectations based on | 188 * Create an ExpectationsSource that will return Expectations based on |
189 * image files found within rootDir. | 189 * image files found within rootDir. |
190 * | 190 * |
191 * rootDir: directory under which to look for image files | 191 * rootDir: directory under which to look for image files |
192 * (this string will be copied to storage within this object) | 192 * (this string will be copied to storage within this object) |
193 */ | 193 */ |
194 explicit IndividualImageExpectationsSource(const char *rootDir) : fRootD
ir(rootDir) {} | 194 explicit IndividualImageExpectationsSource(const char *rootDir) : fRootD
ir(rootDir) {} |
195 | 195 |
196 Expectations get(const char *testName) const SK_OVERRIDE ; | 196 Expectations get(const char *testName) const override ; |
197 | 197 |
198 private: | 198 private: |
199 const SkString fRootDir; | 199 const SkString fRootDir; |
200 }; | 200 }; |
201 | 201 |
202 /** | 202 /** |
203 * Return Expectations based on JSON summary file. | 203 * Return Expectations based on JSON summary file. |
204 */ | 204 */ |
205 class JsonExpectationsSource : public ExpectationsSource { | 205 class JsonExpectationsSource : public ExpectationsSource { |
206 public: | 206 public: |
207 /** | 207 /** |
208 * Create an ExpectationsSource that will return Expectations based on | 208 * Create an ExpectationsSource that will return Expectations based on |
209 * a JSON file. | 209 * a JSON file. |
210 * | 210 * |
211 * jsonPath: path to JSON file to read | 211 * jsonPath: path to JSON file to read |
212 */ | 212 */ |
213 explicit JsonExpectationsSource(const char *jsonPath); | 213 explicit JsonExpectationsSource(const char *jsonPath); |
214 | 214 |
215 Expectations get(const char *testName) const SK_OVERRIDE; | 215 Expectations get(const char *testName) const override; |
216 | 216 |
217 private: | 217 private: |
218 | 218 |
219 /** | 219 /** |
220 * Read the file contents from jsonPath and parse them into jsonRoot. | 220 * Read the file contents from jsonPath and parse them into jsonRoot. |
221 * | 221 * |
222 * Returns true if successful. | 222 * Returns true if successful. |
223 */ | 223 */ |
224 static bool Parse(const char *jsonPath, Json::Value *jsonRoot); | 224 static bool Parse(const char *jsonPath, Json::Value *jsonRoot); |
225 | 225 |
226 Json::Value fJsonRoot; | 226 Json::Value fJsonRoot; |
227 Json::Value fJsonExpectedResults; | 227 Json::Value fJsonExpectedResults; |
228 }; | 228 }; |
229 | 229 |
230 } | 230 } |
231 #endif | 231 #endif |
OLD | NEW |