| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // Utilities for testing. | 5 // Utilities for testing. |
| 6 | 6 |
| 7 #ifndef CEEE_TESTING_UTILS_TEST_UTILS_H_ | 7 #ifndef CEEE_TESTING_UTILS_TEST_UTILS_H_ |
| 8 #define CEEE_TESTING_UTILS_TEST_UTILS_H_ | 8 #define CEEE_TESTING_UTILS_TEST_UTILS_H_ |
| 9 | 9 |
| 10 #include <atlbase.h> | 10 #include <atlbase.h> |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 } | 60 } |
| 61 | 61 |
| 62 // Prevents any logging actions (DCHECKs, killing the process, | 62 // Prevents any logging actions (DCHECKs, killing the process, |
| 63 // informational output, or anything) for the scope of its lifetime. | 63 // informational output, or anything) for the scope of its lifetime. |
| 64 class LogDisabler { | 64 class LogDisabler { |
| 65 public: | 65 public: |
| 66 LogDisabler(); | 66 LogDisabler(); |
| 67 ~LogDisabler(); | 67 ~LogDisabler(); |
| 68 | 68 |
| 69 private: | 69 private: |
| 70 int initial_log_level_; | 70 logging::LogMessageHandlerFunction old_handler_; |
| 71 static bool DropMessageHandler(int severity, const std::string& str); |
| 71 }; | 72 }; |
| 72 | 73 |
| 73 // Overrides a path in the PathService singleton, replacing the | 74 // Overrides a path in the PathService singleton, replacing the |
| 74 // original at the end of its lifetime. | 75 // original at the end of its lifetime. |
| 75 class PathServiceOverrider { | 76 class PathServiceOverrider { |
| 76 public: | 77 public: |
| 77 PathServiceOverrider(int key, const FilePath& path); | 78 PathServiceOverrider(int key, const FilePath& path); |
| 78 ~PathServiceOverrider(); | 79 ~PathServiceOverrider(); |
| 79 | 80 |
| 80 private: | 81 private: |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 TEST_F(test_fixture, test_name) | 306 TEST_F(test_fixture, test_name) |
| 306 #else | 307 #else |
| 307 #define TEST_DEBUG_ONLY(test_case_name, test_name) \ | 308 #define TEST_DEBUG_ONLY(test_case_name, test_name) \ |
| 308 void DisabledTest##test_case_name##test_name() | 309 void DisabledTest##test_case_name##test_name() |
| 309 #define TEST_F_DEBUG_ONLY TEST_DEBUG_ONLY | 310 #define TEST_F_DEBUG_ONLY TEST_DEBUG_ONLY |
| 310 #endif | 311 #endif |
| 311 | 312 |
| 312 | 313 |
| 313 | 314 |
| 314 #endif // CEEE_TESTING_UTILS_TEST_UTILS_H_ | 315 #endif // CEEE_TESTING_UTILS_TEST_UTILS_H_ |
| OLD | NEW |