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 "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
17 #include "base/message_loop/message_loop.h" | 17 #include "base/message_loop/message_loop.h" |
18 #include "chrome/browser/component_updater/component_updater_service.h" | 18 #include "chrome/browser/component_updater/component_updater_service.h" |
19 #include "chrome/browser/component_updater/test/component_patcher_mock.h" | 19 #include "chrome/browser/component_updater/test/component_patcher_mock.h" |
20 #include "chrome/browser/component_updater/test/url_request_post_interceptor.h" | 20 #include "chrome/browser/component_updater/test/url_request_post_interceptor.h" |
21 #include "content/public/test/test_browser_thread.h" | 21 #include "content/public/test/test_browser_thread.h" |
22 #include "content/public/test/test_notification_tracker.h" | 22 #include "content/public/test/test_notification_tracker.h" |
23 #include "net/url_request/url_request_test_util.h" | 23 #include "net/url_request/url_request_test_util.h" |
| 24 #include "testing/gmock/include/gmock/gmock.h" |
24 #include "testing/gtest/include/gtest/gtest.h" | 25 #include "testing/gtest/include/gtest/gtest.h" |
25 | 26 |
26 class TestInstaller; | 27 class TestInstaller; |
27 | 28 |
28 // component 1 has extension id "jebgalgnebhfojomionfpkfelancnnkf", and | 29 // component 1 has extension id "jebgalgnebhfojomionfpkfelancnnkf", and |
29 // the RSA public key the following hash: | 30 // the RSA public key the following hash: |
30 const uint8 jebg_hash[] = {0x94, 0x16, 0x0b, 0x6d, 0x41, 0x75, 0xe9, 0xec, | 31 const uint8 jebg_hash[] = {0x94, 0x16, 0x0b, 0x6d, 0x41, 0x75, 0xe9, 0xec, |
31 0x8e, 0xd5, 0xfa, 0x54, 0xb0, 0xd2, 0xdd, 0xa5, | 32 0x8e, 0xd5, 0xfa, 0x54, 0xb0, 0xd2, 0xdd, 0xa5, |
32 0x6e, 0x05, 0x6b, 0xe8, 0x73, 0x47, 0xf6, 0xc4, | 33 0x6e, 0x05, 0x6b, 0xe8, 0x73, 0x47, 0xf6, 0xc4, |
33 0x11, 0x9f, 0xbc, 0xb3, 0x09, 0xb3, 0x5b, 0x40}; | 34 0x11, 0x9f, 0xbc, 0xb3, 0x09, 0xb3, 0x5b, 0x40}; |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 return num_misses_; | 158 return num_misses_; |
158 } | 159 } |
159 | 160 |
160 private: | 161 private: |
161 int num_hits_; | 162 int num_hits_; |
162 int num_misses_; | 163 int num_misses_; |
163 const std::map<std::string, std::string> attributes_; | 164 const std::map<std::string, std::string> attributes_; |
164 virtual bool Test(net::URLRequest* request); | 165 virtual bool Test(net::URLRequest* request); |
165 }; | 166 }; |
166 | 167 |
| 168 class MockComponentObserver : public ComponentObserver { |
| 169 public: |
| 170 MockComponentObserver(); |
| 171 ~MockComponentObserver(); |
| 172 MOCK_METHOD2(OnEvent, void(Events event, int extra)); |
| 173 }; |
| 174 |
167 #endif // CHROME_BROWSER_COMPONENT_UPDATER_TEST_COMPONENT_UPDATER_SERVICE_UNITT
EST_H_ | 175 #endif // CHROME_BROWSER_COMPONENT_UPDATER_TEST_COMPONENT_UPDATER_SERVICE_UNITT
EST_H_ |
OLD | NEW |