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 "chrome/browser/services/gcm/gcm_profile_service.h" | 5 #include "chrome/browser/services/gcm/gcm_profile_service.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 } | 50 } |
51 | 51 |
52 } // namespace | 52 } // namespace |
53 | 53 |
54 class GCMProfileServiceTest : public testing::Test { | 54 class GCMProfileServiceTest : public testing::Test { |
55 protected: | 55 protected: |
56 GCMProfileServiceTest(); | 56 GCMProfileServiceTest(); |
57 virtual ~GCMProfileServiceTest(); | 57 virtual ~GCMProfileServiceTest(); |
58 | 58 |
59 // testing::Test: | 59 // testing::Test: |
60 virtual void SetUp() OVERRIDE; | 60 virtual void SetUp() override; |
61 virtual void TearDown() OVERRIDE; | 61 virtual void TearDown() override; |
62 | 62 |
63 FakeGCMClient* GetGCMClient() const; | 63 FakeGCMClient* GetGCMClient() const; |
64 | 64 |
65 void CreateGCMProfileService(); | 65 void CreateGCMProfileService(); |
66 void SignIn(); | 66 void SignIn(); |
67 void SignOut(); | 67 void SignOut(); |
68 | 68 |
69 void RegisterAndWaitForCompletion(const std::vector<std::string>& sender_ids); | 69 void RegisterAndWaitForCompletion(const std::vector<std::string>& sender_ids); |
70 void UnregisterAndWaitForCompletion(); | 70 void UnregisterAndWaitForCompletion(); |
71 void SendAndWaitForCompletion(const GCMClient::OutgoingMessage& message); | 71 void SendAndWaitForCompletion(const GCMClient::OutgoingMessage& message); |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 GCMClient::OutgoingMessage message; | 270 GCMClient::OutgoingMessage message; |
271 message.id = "1"; | 271 message.id = "1"; |
272 message.data["key1"] = "value1"; | 272 message.data["key1"] = "value1"; |
273 SendAndWaitForCompletion( message); | 273 SendAndWaitForCompletion( message); |
274 | 274 |
275 EXPECT_EQ(message.id, send_message_id()); | 275 EXPECT_EQ(message.id, send_message_id()); |
276 EXPECT_EQ(GCMClient::SUCCESS, send_result()); | 276 EXPECT_EQ(GCMClient::SUCCESS, send_result()); |
277 } | 277 } |
278 | 278 |
279 } // namespace gcm | 279 } // namespace gcm |
OLD | NEW |