OLD | NEW |
| (Empty) |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 // | |
5 #ifndef SYNC_INTERNAL_API_PUBLIC_TEST_DATA_TYPE_ERROR_HANDLER_MOCK_H__ | |
6 #define SYNC_INTERNAL_API_PUBLIC_TEST_DATA_TYPE_ERROR_HANDLER_MOCK_H__ | |
7 | |
8 #include <string> | |
9 | |
10 #include "sync/internal_api/public/base/model_type.h" | |
11 #include "sync/internal_api/public/data_type_error_handler.h" | |
12 | |
13 namespace syncer { | |
14 | |
15 // A mock DataTypeErrorHandler for testing. Set the expected error type with | |
16 // ExpectError and OnSingleDataTypeUnrecoverableError will pass. If the error is | |
17 // not called this object's destructor will DCHECK. | |
18 class DataTypeErrorHandlerMock : public DataTypeErrorHandler { | |
19 public: | |
20 DataTypeErrorHandlerMock(); | |
21 ~DataTypeErrorHandlerMock() override; | |
22 | |
23 void OnSingleDataTypeUnrecoverableError(const SyncError& error) override; | |
24 SyncError CreateAndUploadError(const tracked_objects::Location& location, | |
25 const std::string& message, | |
26 ModelType type) override; | |
27 | |
28 // Set the |error_type| to expect. | |
29 void ExpectError(SyncError::ErrorType error_type); | |
30 | |
31 private: | |
32 // The error type to expect. | |
33 SyncError::ErrorType expected_error_type_ = SyncError::UNSET; | |
34 }; | |
35 | |
36 } // namespace syncer | |
37 | |
38 #endif // SYNC_INTERNAL_API_PUBLIC_TEST_DATA_TYPE_ERROR_HANDLER_MOCK_H__ | |
OLD | NEW |