| 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 #ifndef BASE_TEST_EXPECTATIONS_EXPECTATION_H_ | 5 #ifndef BASE_TEST_EXPECTATIONS_EXPECTATION_H_ |
| 6 #define BASE_TEST_EXPECTATIONS_EXPECTATION_H_ | 6 #define BASE_TEST_EXPECTATIONS_EXPECTATION_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 // The variant of the platform, either an OS version like "XP" or "10.8", or | 45 // The variant of the platform, either an OS version like "XP" or "10.8", or |
| 46 // "Device" or "Simulator" in the case of mobile. | 46 // "Device" or "Simulator" in the case of mobile. |
| 47 std::string variant; | 47 std::string variant; |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 // Converts a text string |modifier| to a Platform struct, written to | 50 // Converts a text string |modifier| to a Platform struct, written to |
| 51 // |out_platform|. Returns true on success and false on failure. | 51 // |out_platform|. Returns true on success and false on failure. |
| 52 bool PlatformFromString(const base::StringPiece& modifier, | 52 bool PlatformFromString(const base::StringPiece& modifier, |
| 53 Platform* out_platform) WARN_UNUSED_RESULT; | 53 Platform* out_platform) WARN_UNUSED_RESULT; |
| 54 | 54 |
| 55 // Returns the Platform for the currently running binary. |
| 56 Platform GetCurrentPlatform(); |
| 57 |
| 55 // The build configuration. | 58 // The build configuration. |
| 56 enum Configuration { | 59 enum Configuration { |
| 57 CONFIGURATION_UNSPECIFIED, | 60 CONFIGURATION_UNSPECIFIED, |
| 58 CONFIGURATION_DEBUG, | 61 CONFIGURATION_DEBUG, |
| 59 CONFIGURATION_RELEASE, | 62 CONFIGURATION_RELEASE, |
| 60 }; | 63 }; |
| 61 | 64 |
| 62 // Converts the |modifier| to a Configuration constant, writing the value to | 65 // Converts the |modifier| to a Configuration constant, writing the value to |
| 63 // |out_configuration|. Returns true on success or false on failure. | 66 // |out_configuration|. Returns true on success or false on failure. |
| 64 bool ConfigurationFromString(const base::StringPiece& modifier, | 67 bool ConfigurationFromString(const base::StringPiece& modifier, |
| 65 Configuration* out_configuration) WARN_UNUSED_RESULT; | 68 Configuration* out_configuration) WARN_UNUSED_RESULT; |
| 66 | 69 |
| 70 // Returns the Configuration for the currently running binary. |
| 71 Configuration GetCurrentConfiguration(); |
| 72 |
| 67 // An Expectation is records what the result for a given test name should be on | 73 // An Expectation is records what the result for a given test name should be on |
| 68 // the specified platforms and configuration. | 74 // the specified platforms and configuration. |
| 69 struct Expectation { | 75 struct Expectation { |
| 70 Expectation(); | 76 Expectation(); |
| 71 ~Expectation(); | 77 ~Expectation(); |
| 72 | 78 |
| 73 // The name of the test, like FooBarTest.BarIsBaz. | 79 // The name of the test, like FooBarTest.BarIsBaz. |
| 74 std::string test_name; | 80 std::string test_name; |
| 75 | 81 |
| 76 // The set of platforms for which this expectation is applicable. | 82 // The set of platforms for which this expectation is applicable. |
| 77 std::vector<Platform> platforms; | 83 std::vector<Platform> platforms; |
| 78 | 84 |
| 79 // The build configuration. | 85 // The build configuration. |
| 80 Configuration configuration; | 86 Configuration configuration; |
| 81 | 87 |
| 82 // The expected result of this test. | 88 // The expected result of this test. |
| 83 Result result; | 89 Result result; |
| 84 }; | 90 }; |
| 85 | 91 |
| 86 } // namespace test_expectations | 92 } // namespace test_expectations |
| 87 | 93 |
| 88 #endif // BASE_TEST_EXPECTATIONS_EXPECTATION_H_ | 94 #endif // BASE_TEST_EXPECTATIONS_EXPECTATION_H_ |
| OLD | NEW |