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 #include "chrome/browser/services/gcm/gcm_client_mock.h" | 5 #include "chrome/browser/services/gcm/gcm_client_mock.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/sys_byteorder.h" | 10 #include "base/sys_byteorder.h" |
11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
12 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
13 | 13 |
14 namespace gcm { | 14 namespace gcm { |
15 | 15 |
16 GCMClientMock::GCMClientMock(Status status, ErrorSimulation error_simulation) | 16 GCMClientMock::GCMClientMock(Status status, ErrorSimulation error_simulation) |
17 : delegate_(NULL), | 17 : delegate_(NULL), |
18 status_(status), | 18 status_(status), |
19 error_simulation_(error_simulation) { | 19 error_simulation_(error_simulation) { |
20 } | 20 } |
21 | 21 |
22 GCMClientMock::~GCMClientMock() { | 22 GCMClientMock::~GCMClientMock() { |
23 } | 23 } |
24 | 24 |
25 void GCMClientMock::Initialize( | 25 void GCMClientMock::Initialize( |
26 const checkin_proto::ChromeBuildProto& chrome_build_proto, | 26 const checkin_proto::ChromeBuildProto& chrome_build_proto, |
27 const base::FilePath& store_path, | 27 const base::FilePath& store_path, |
| 28 const std::vector<std::string>& account_ids, |
28 const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner, | 29 const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner, |
29 const scoped_refptr<net::URLRequestContextGetter>& | 30 const scoped_refptr<net::URLRequestContextGetter>& |
30 url_request_context_getter, | 31 url_request_context_getter, |
31 Delegate* delegate) { | 32 Delegate* delegate) { |
32 delegate_ = delegate; | 33 delegate_ = delegate; |
33 } | 34 } |
34 | 35 |
35 void GCMClientMock::CheckOut() { | 36 void GCMClientMock::CheckOut() { |
36 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); | 37 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); |
37 } | 38 } |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 const std::string& message_id) { | 169 const std::string& message_id) { |
169 if (delegate_) | 170 if (delegate_) |
170 delegate_->OnMessageSendError(app_id, message_id, NETWORK_ERROR); | 171 delegate_->OnMessageSendError(app_id, message_id, NETWORK_ERROR); |
171 } | 172 } |
172 | 173 |
173 void GCMClientMock::SetReadyOnIO() { | 174 void GCMClientMock::SetReadyOnIO() { |
174 delegate_->OnGCMReady(); | 175 delegate_->OnGCMReady(); |
175 } | 176 } |
176 | 177 |
177 } // namespace gcm | 178 } // namespace gcm |
OLD | NEW |