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

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: 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;
waffles 2013/12/05 01:15:07 Can we also remove the extra \n from the non-virtu
Sorin Jianu 2013/12/05 01:43:07 Done.
Sorin Jianu 2013/12/05 01:43:07 Done.
72 86
73 typedef std::pair<CrxComponent*, int> CheckAtLoopCount; 87 typedef std::pair<CrxComponent*, int> CheckAtLoopCount;
74 88
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); 89 void SetLoopCount(int times);
103 90
104 void SetRecheckTime(int seconds); 91 void SetRecheckTime(int seconds);
105 92
106 void SetOnDemandTime(int seconds); 93 void SetOnDemandTime(int seconds);
107 94
108 void SetComponentUpdateService(ComponentUpdateService* cus); 95 void SetComponentUpdateService(ComponentUpdateService* cus);
109 96
110 void SetQuitClosure(const base::Closure& quit_closure); 97 void SetQuitClosure(const base::Closure& quit_closure);
111 98
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 164
178 class OnDemandTester { 165 class OnDemandTester {
179 public: 166 public:
180 static ComponentUpdateService::Status OnDemand( 167 static ComponentUpdateService::Status OnDemand(
181 ComponentUpdateService* cus, const std::string& component_id); 168 ComponentUpdateService* cus, const std::string& component_id);
182 }; 169 };
183 170
184 } // namespace component_updater 171 } // namespace component_updater
185 172
186 #endif // CHROME_BROWSER_COMPONENT_UPDATER_TEST_COMPONENT_UPDATER_SERVICE_UNITT EST_H_ 173 #endif // CHROME_BROWSER_COMPONENT_UPDATER_TEST_COMPONENT_UPDATER_SERVICE_UNITT EST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698