| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium OS 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 CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_HTTP_FETCHER_H__ | 5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_HTTP_FETCHER_H__ |
| 6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_HTTP_FETCHER_H__ | 6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_HTTP_FETCHER_H__ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 #include <glib.h> | 9 #include <glib.h> |
| 10 #include "chromeos/obsolete_logging.h" | 10 #include "base/logging.h" |
| 11 #include "update_engine/http_fetcher.h" | 11 #include "update_engine/http_fetcher.h" |
| 12 | 12 |
| 13 // This is a mock implementation of HttpFetcher which is useful for testing. | 13 // This is a mock implementation of HttpFetcher which is useful for testing. |
| 14 // All data must be passed into the ctor. When started, MockHttpFetcher will | 14 // All data must be passed into the ctor. When started, MockHttpFetcher will |
| 15 // deliver the data in chunks of size kMockHttpFetcherChunkSize. To simulate | 15 // deliver the data in chunks of size kMockHttpFetcherChunkSize. To simulate |
| 16 // a network failure, you can call FailTransfer(). | 16 // a network failure, you can call FailTransfer(). |
| 17 | 17 |
| 18 namespace chromeos_update_engine { | 18 namespace chromeos_update_engine { |
| 19 | 19 |
| 20 // MockHttpFetcher will send a chunk of data down in each call to BeginTransfer | 20 // MockHttpFetcher will send a chunk of data down in each call to BeginTransfer |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 | 84 |
| 85 // True iff the fetcher is paused. | 85 // True iff the fetcher is paused. |
| 86 bool paused_; | 86 bool paused_; |
| 87 | 87 |
| 88 DISALLOW_COPY_AND_ASSIGN(MockHttpFetcher); | 88 DISALLOW_COPY_AND_ASSIGN(MockHttpFetcher); |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 } // namespace chromeos_update_engine | 91 } // namespace chromeos_update_engine |
| 92 | 92 |
| 93 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_HTTP_FETCHER_H__ | 93 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_HTTP_FETCHER_H__ |
| OLD | NEW |