| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "google_apis/gcm/gcm_client_impl.h" | 5 #include "google_apis/gcm/gcm_client_impl.h" |
| 6 | 6 |
| 7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/test/simple_test_clock.h" | 10 #include "base/test/simple_test_clock.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 80 |
| 81 private: | 81 private: |
| 82 uint64 last_android_id_; | 82 uint64 last_android_id_; |
| 83 uint64 last_security_token_; | 83 uint64 last_security_token_; |
| 84 uint8 last_message_tag_; | 84 uint8 last_message_tag_; |
| 85 mcs_proto::DataMessageStanza last_data_message_stanza_; | 85 mcs_proto::DataMessageStanza last_data_message_stanza_; |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 FakeMCSClient::FakeMCSClient(base::Clock* clock, | 88 FakeMCSClient::FakeMCSClient(base::Clock* clock, |
| 89 ConnectionFactory* connection_factory) | 89 ConnectionFactory* connection_factory) |
| 90 : MCSClient(clock, connection_factory, NULL), | 90 : MCSClient("", clock, connection_factory, NULL), |
| 91 last_android_id_(0u), | 91 last_android_id_(0u), |
| 92 last_security_token_(0u), | 92 last_security_token_(0u), |
| 93 last_message_tag_(kNumProtoTypes) { | 93 last_message_tag_(kNumProtoTypes) { |
| 94 } | 94 } |
| 95 | 95 |
| 96 FakeMCSClient::~FakeMCSClient() { | 96 FakeMCSClient::~FakeMCSClient() { |
| 97 } | 97 } |
| 98 | 98 |
| 99 void FakeMCSClient::set_gcm_store(GCMStore* gcm_store) { | 99 void FakeMCSClient::set_gcm_store(GCMStore* gcm_store) { |
| 100 SetGCMStoreForTesting(gcm_store); | 100 SetGCMStoreForTesting(gcm_store); |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 EXPECT_EQ("007", mcs_client()->last_data_message_stanza().id()); | 447 EXPECT_EQ("007", mcs_client()->last_data_message_stanza().id()); |
| 448 EXPECT_EQ(1, mcs_client()->last_data_message_stanza().device_user_id()); | 448 EXPECT_EQ(1, mcs_client()->last_data_message_stanza().device_user_id()); |
| 449 EXPECT_EQ("gcm@chrome.com", mcs_client()->last_data_message_stanza().from()); | 449 EXPECT_EQ("gcm@chrome.com", mcs_client()->last_data_message_stanza().from()); |
| 450 EXPECT_EQ("project_id", mcs_client()->last_data_message_stanza().to()); | 450 EXPECT_EQ("project_id", mcs_client()->last_data_message_stanza().to()); |
| 451 EXPECT_EQ("key", mcs_client()->last_data_message_stanza().app_data(0).key()); | 451 EXPECT_EQ("key", mcs_client()->last_data_message_stanza().app_data(0).key()); |
| 452 EXPECT_EQ("value", | 452 EXPECT_EQ("value", |
| 453 mcs_client()->last_data_message_stanza().app_data(0).value()); | 453 mcs_client()->last_data_message_stanza().app_data(0).value()); |
| 454 } | 454 } |
| 455 | 455 |
| 456 } // namespace gcm | 456 } // namespace gcm |
| OLD | NEW |