| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 CHROME_BROWSER_COMPONENT_UPDATER_TEST_COMPONENT_UPDATER_SERVICE_UNITTEST
_H_ | 5 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_TEST_COMPONENT_UPDATER_SERVICE_UNITTEST
_H_ |
| 6 #define CHROME_BROWSER_COMPONENT_UPDATER_TEST_COMPONENT_UPDATER_SERVICE_UNITTEST
_H_ | 6 #define CHROME_BROWSER_COMPONENT_UPDATER_TEST_COMPONENT_UPDATER_SERVICE_UNITTEST
_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <utility> | 11 #include <utility> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
| 15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
| 16 #include "base/files/file_path.h" | 16 #include "base/files/file_path.h" |
| 17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
| 18 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
| 19 #include "chrome/browser/component_updater/component_updater_service.h" | 19 #include "chrome/browser/component_updater/component_updater_service.h" |
| 20 #include "chrome/browser/component_updater/test/component_patcher_mock.h" |
| 20 #include "chrome/browser/component_updater/test/url_request_post_interceptor.h" | 21 #include "chrome/browser/component_updater/test/url_request_post_interceptor.h" |
| 21 #include "content/public/test/test_browser_thread_bundle.h" | 22 #include "content/public/test/test_browser_thread_bundle.h" |
| 22 #include "content/test/net/url_request_prepackaged_interceptor.h" | 23 #include "content/test/net/url_request_prepackaged_interceptor.h" |
| 23 #include "net/url_request/url_request_test_util.h" | 24 #include "net/url_request/url_request_test_util.h" |
| 24 #include "testing/gmock/include/gmock/gmock.h" | 25 #include "testing/gmock/include/gmock/gmock.h" |
| 25 #include "testing/gtest/include/gtest/gtest.h" | 26 #include "testing/gtest/include/gtest/gtest.h" |
| 26 | 27 |
| 27 namespace component_updater { | 28 namespace component_updater { |
| 28 | 29 |
| 29 class TestInstaller; | 30 class TestInstaller; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 virtual int StepDelay() OVERRIDE; | 84 virtual int StepDelay() OVERRIDE; |
| 84 virtual int StepDelayMedium() OVERRIDE; | 85 virtual int StepDelayMedium() OVERRIDE; |
| 85 virtual int MinimumReCheckWait() OVERRIDE; | 86 virtual int MinimumReCheckWait() OVERRIDE; |
| 86 virtual int OnDemandDelay() OVERRIDE; | 87 virtual int OnDemandDelay() OVERRIDE; |
| 87 virtual GURL UpdateUrl() OVERRIDE; | 88 virtual GURL UpdateUrl() OVERRIDE; |
| 88 virtual GURL PingUrl() OVERRIDE; | 89 virtual GURL PingUrl() OVERRIDE; |
| 89 virtual std::string ExtraRequestParams() OVERRIDE; | 90 virtual std::string ExtraRequestParams() OVERRIDE; |
| 90 virtual size_t UrlSizeLimit() OVERRIDE; | 91 virtual size_t UrlSizeLimit() OVERRIDE; |
| 91 virtual net::URLRequestContextGetter* RequestContext() OVERRIDE; | 92 virtual net::URLRequestContextGetter* RequestContext() OVERRIDE; |
| 92 virtual bool InProcess() OVERRIDE; | 93 virtual bool InProcess() OVERRIDE; |
| 94 virtual ComponentPatcher* CreateComponentPatcher() OVERRIDE; |
| 93 virtual bool DeltasEnabled() const OVERRIDE; | 95 virtual bool DeltasEnabled() const OVERRIDE; |
| 94 virtual bool UseBackgroundDownloader() const OVERRIDE; | 96 virtual bool UseBackgroundDownloader() const OVERRIDE; |
| 95 | 97 |
| 96 typedef std::pair<CrxComponent*, int> CheckAtLoopCount; | 98 typedef std::pair<CrxComponent*, int> CheckAtLoopCount; |
| 97 void SetLoopCount(int times); | 99 void SetLoopCount(int times); |
| 98 void SetRecheckTime(int seconds); | 100 void SetRecheckTime(int seconds); |
| 99 void SetOnDemandTime(int seconds); | 101 void SetOnDemandTime(int seconds); |
| 100 void SetComponentUpdateService(ComponentUpdateService* cus); | 102 void SetComponentUpdateService(ComponentUpdateService* cus); |
| 101 void SetQuitClosure(const base::Closure& quit_closure); | 103 void SetQuitClosure(const base::Closure& quit_closure); |
| 102 void SetInitialDelay(int seconds); | 104 void SetInitialDelay(int seconds); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 169 |
| 168 class OnDemandTester { | 170 class OnDemandTester { |
| 169 public: | 171 public: |
| 170 static ComponentUpdateService::Status OnDemand( | 172 static ComponentUpdateService::Status OnDemand( |
| 171 ComponentUpdateService* cus, const std::string& component_id); | 173 ComponentUpdateService* cus, const std::string& component_id); |
| 172 }; | 174 }; |
| 173 | 175 |
| 174 } // namespace component_updater | 176 } // namespace component_updater |
| 175 | 177 |
| 176 #endif // CHROME_BROWSER_COMPONENT_UPDATER_TEST_COMPONENT_UPDATER_SERVICE_UNITT
EST_H_ | 178 #endif // CHROME_BROWSER_COMPONENT_UPDATER_TEST_COMPONENT_UPDATER_SERVICE_UNITT
EST_H_ |
| OLD | NEW |