| 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 "google_apis/gcm/engine/mcs_client.h" | 5 #include "google_apis/gcm/engine/mcs_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 return MCSMessage(kDataMessageStanzaTag, data_message); | 67 return MCSMessage(kDataMessageStanzaTag, data_message); |
| 68 } | 68 } |
| 69 | 69 |
| 70 // MCSClient with overriden exposed persistent id logic. | 70 // MCSClient with overriden exposed persistent id logic. |
| 71 class TestMCSClient : public MCSClient { | 71 class TestMCSClient : public MCSClient { |
| 72 public: | 72 public: |
| 73 TestMCSClient(base::Clock* clock, | 73 TestMCSClient(base::Clock* clock, |
| 74 ConnectionFactory* connection_factory, | 74 ConnectionFactory* connection_factory, |
| 75 GCMStore* gcm_store, | 75 GCMStore* gcm_store, |
| 76 gcm::GCMStatsRecorder* recorder) | 76 gcm::GCMStatsRecorder* recorder) |
| 77 : MCSClient("", clock, connection_factory, gcm_store, recorder, | 77 : MCSClient("", clock, connection_factory, gcm_store, recorder), |
| 78 make_scoped_ptr(new base::Timer(true, false))), | |
| 79 next_id_(0) { | 78 next_id_(0) { |
| 80 } | 79 } |
| 81 | 80 |
| 82 std::string GetNextPersistentId() override { | 81 std::string GetNextPersistentId() override { |
| 83 return base::UintToString(++next_id_); | 82 return base::UintToString(++next_id_); |
| 84 } | 83 } |
| 85 | 84 |
| 86 private: | 85 private: |
| 87 uint32 next_id_; | 86 uint32 next_id_; |
| 88 }; | 87 }; |
| (...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 866 | 865 |
| 867 LoginClient(std::vector<std::string>()); | 866 LoginClient(std::vector<std::string>()); |
| 868 GetFakeHandler()->ExpectOutgoingMessage(message); | 867 GetFakeHandler()->ExpectOutgoingMessage(message); |
| 869 GetFakeHandler()->ExpectOutgoingMessage(message2); | 868 GetFakeHandler()->ExpectOutgoingMessage(message2); |
| 870 PumpLoop(); | 869 PumpLoop(); |
| 871 } | 870 } |
| 872 | 871 |
| 873 } // namespace | 872 } // namespace |
| 874 | 873 |
| 875 } // namespace gcm | 874 } // namespace gcm |
| OLD | NEW |