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

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

Issue 56023005: First changelist of a series to migrate the component updater protocol (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Dump pings in all cases for easier debugging of failed tests. Created 7 years, 1 month 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 private: 134 private:
135 TestConfigurator* test_config_; 135 TestConfigurator* test_config_;
136 base::FilePath test_data_dir_; 136 base::FilePath test_data_dir_;
137 content::TestBrowserThreadBundle thread_bundle_; 137 content::TestBrowserThreadBundle thread_bundle_;
138 scoped_ptr<ComponentUpdateService> component_updater_; 138 scoped_ptr<ComponentUpdateService> component_updater_;
139 }; 139 };
140 140
141 const char expected_crx_url[] = 141 const char expected_crx_url[] =
142 "http://localhost/download/jebgalgnebhfojomionfpkfelancnnkf.crx"; 142 "http://localhost/download/jebgalgnebhfojomionfpkfelancnnkf.crx";
143 143
144 class PingChecker : public RequestCounter {
145 public:
146 explicit PingChecker(const std::map<std::string, std::string>& attributes);
147
148 virtual ~PingChecker();
149
150 virtual void Trial(net::URLRequest* request) OVERRIDE;
151
152 int NumHits() const {
153 return num_hits_;
154 }
155 int NumMisses() const {
156 return num_misses_;
157 }
158 std::string GetPings() const;
159
160 private:
161 std::vector<std::string> pings_;
162 int num_hits_;
163 int num_misses_;
164 const std::map<std::string, std::string> attributes_;
165 virtual bool Test(net::URLRequest* request);
166 };
167
168 class MockComponentObserver : public ComponentObserver { 144 class MockComponentObserver : public ComponentObserver {
169 public: 145 public:
170 MockComponentObserver(); 146 MockComponentObserver();
171 ~MockComponentObserver(); 147 ~MockComponentObserver();
172 MOCK_METHOD2(OnEvent, void(Events event, int extra)); 148 MOCK_METHOD2(OnEvent, void(Events event, int extra));
173 }; 149 };
174 150
175 class OnDemandTester { 151 class OnDemandTester {
176 public: 152 public:
177 static ComponentUpdateService::Status OnDemand( 153 static ComponentUpdateService::Status OnDemand(
178 ComponentUpdateService* cus, const std::string& component_id); 154 ComponentUpdateService* cus, const std::string& component_id);
179 }; 155 };
180 156
181 #endif // CHROME_BROWSER_COMPONENT_UPDATER_TEST_COMPONENT_UPDATER_SERVICE_UNITT EST_H_ 157 #endif // CHROME_BROWSER_COMPONENT_UPDATER_TEST_COMPONENT_UPDATER_SERVICE_UNITT EST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698