Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Side by Side Diff: chrome/browser/component_updater/test/component_updater_service_unittest.h

Issue 105853002: Implement a background downloader using BITS in Windows Chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed error codes. Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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>
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x01}; 57 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x01};
58 // component 3 has extension id "ihfokbkgjpifnbbojhneepfflplebdkc", and 58 // component 3 has extension id "ihfokbkgjpifnbbojhneepfflplebdkc", and
59 // the RSA public key the following hash: 59 // the RSA public key the following hash:
60 const uint8 ihfo_hash[] = {0x87, 0x5e, 0xa1, 0xa6, 0x9f, 0x85, 0xd1, 0x1e, 60 const uint8 ihfo_hash[] = {0x87, 0x5e, 0xa1, 0xa6, 0x9f, 0x85, 0xd1, 0x1e,
61 0x97, 0xd4, 0x4f, 0x55, 0xbf, 0xb4, 0x13, 0xa2, 61 0x97, 0xd4, 0x4f, 0x55, 0xbf, 0xb4, 0x13, 0xa2,
62 0xe7, 0xc5, 0xc8, 0xf5, 0x60, 0x19, 0x78, 0x1b, 62 0xe7, 0xc5, 0xc8, 0xf5, 0x60, 0x19, 0x78, 0x1b,
63 0x6d, 0xe9, 0x4c, 0xeb, 0x96, 0x05, 0x42, 0x17}; 63 0x6d, 0xe9, 0x4c, 0xeb, 0x96, 0x05, 0x42, 0x17};
64 64
65 class TestConfigurator : public ComponentUpdateService::Configurator { 65 class TestConfigurator : public ComponentUpdateService::Configurator {
66 public: 66 public:
67 explicit TestConfigurator(); 67 TestConfigurator();
68
69 virtual ~TestConfigurator(); 68 virtual ~TestConfigurator();
70 69
70 // Overrrides for ComponentUpdateService::Configurator.
71 virtual int InitialDelay() OVERRIDE; 71 virtual int InitialDelay() OVERRIDE;
72 virtual int NextCheckDelay() OVERRIDE;
73 virtual int StepDelay() OVERRIDE;
74 virtual int StepDelayMedium() OVERRIDE;
75 virtual int MinimumReCheckWait() OVERRIDE;
76 virtual int OnDemandDelay() OVERRIDE;
77 virtual GURL UpdateUrl() OVERRIDE;
78 virtual GURL PingUrl() OVERRIDE;
79 virtual const char* ExtraRequestParams() OVERRIDE;
80 virtual size_t UrlSizeLimit() OVERRIDE;
81 virtual net::URLRequestContextGetter* RequestContext() OVERRIDE;
82 virtual bool InProcess() OVERRIDE;
83 virtual ComponentPatcher* CreateComponentPatcher() OVERRIDE;
84 virtual bool DeltasEnabled() const OVERRIDE;
85 virtual bool UseBackgroundDownloader() const OVERRIDE;
72 86
73 typedef std::pair<CrxComponent*, int> CheckAtLoopCount; 87 typedef std::pair<CrxComponent*, int> CheckAtLoopCount;
74
75 virtual int NextCheckDelay() OVERRIDE;
76
77 virtual int StepDelay() OVERRIDE;
78
79 virtual int StepDelayMedium() OVERRIDE;
80
81 virtual int MinimumReCheckWait() OVERRIDE;
82
83 virtual int OnDemandDelay() OVERRIDE;
84
85 virtual GURL UpdateUrl() OVERRIDE;
86
87 virtual GURL PingUrl() OVERRIDE;
88
89 virtual const char* ExtraRequestParams() OVERRIDE;
90
91 virtual size_t UrlSizeLimit() OVERRIDE;
92
93 virtual net::URLRequestContextGetter* RequestContext() OVERRIDE;
94
95 // Don't use the utility process to run component updater code.
96 virtual bool InProcess() OVERRIDE;
97
98 virtual ComponentPatcher* CreateComponentPatcher() OVERRIDE;
99
100 virtual bool DeltasEnabled() const OVERRIDE;
101
102 void SetLoopCount(int times); 88 void SetLoopCount(int times);
103
104 void SetRecheckTime(int seconds); 89 void SetRecheckTime(int seconds);
105
106 void SetOnDemandTime(int seconds); 90 void SetOnDemandTime(int seconds);
107
108 void SetComponentUpdateService(ComponentUpdateService* cus); 91 void SetComponentUpdateService(ComponentUpdateService* cus);
109
110 void SetQuitClosure(const base::Closure& quit_closure); 92 void SetQuitClosure(const base::Closure& quit_closure);
111
112 void SetInitialDelay(int seconds); 93 void SetInitialDelay(int seconds);
113 94
114 private: 95 private:
115 int initial_time_; 96 int initial_time_;
116 int times_; 97 int times_;
117 int recheck_time_; 98 int recheck_time_;
118 int ondemand_time_; 99 int ondemand_time_;
119 100
120 ComponentUpdateService* cus_; 101 ComponentUpdateService* cus_;
121 scoped_refptr<net::TestURLRequestContextGetter> context_; 102 scoped_refptr<net::TestURLRequestContextGetter> context_;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 158
178 class OnDemandTester { 159 class OnDemandTester {
179 public: 160 public:
180 static ComponentUpdateService::Status OnDemand( 161 static ComponentUpdateService::Status OnDemand(
181 ComponentUpdateService* cus, const std::string& component_id); 162 ComponentUpdateService* cus, const std::string& component_id);
182 }; 163 };
183 164
184 } // namespace component_updater 165 } // namespace component_updater
185 166
186 #endif // CHROME_BROWSER_COMPONENT_UPDATER_TEST_COMPONENT_UPDATER_SERVICE_UNITT EST_H_ 167 #endif // CHROME_BROWSER_COMPONENT_UPDATER_TEST_COMPONENT_UPDATER_SERVICE_UNITT EST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698