| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "sync/notifier/push_client_channel.h" | 5 #include "sync/notifier/push_client_channel.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "jingle/notifier/listener/fake_push_client.h" | 11 #include "jingle/notifier/listener/fake_push_client.h" |
| 12 #include "jingle/notifier/listener/notification_defines.h" | 12 #include "jingle/notifier/listener/notification_defines.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 | 14 |
| 15 namespace csync { | 15 namespace syncer { |
| 16 namespace { | 16 namespace { |
| 17 | 17 |
| 18 class PushClientChannelTest : public ::testing::Test { | 18 class PushClientChannelTest : public ::testing::Test { |
| 19 protected: | 19 protected: |
| 20 PushClientChannelTest() | 20 PushClientChannelTest() |
| 21 : fake_push_client_(new notifier::FakePushClient()), | 21 : fake_push_client_(new notifier::FakePushClient()), |
| 22 push_client_channel_( | 22 push_client_channel_( |
| 23 scoped_ptr<notifier::PushClient>(fake_push_client_)), | 23 scoped_ptr<notifier::PushClient>(fake_push_client_)), |
| 24 connected_(false) { | 24 connected_(false) { |
| 25 push_client_channel_.SetMessageReceiver( | 25 push_client_channel_.SetMessageReceiver( |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 EXPECT_TRUE(PushClientChannel::DecodeMessageForTest( | 243 EXPECT_TRUE(PushClientChannel::DecodeMessageForTest( |
| 244 fake_push_client_->sent_notifications()[1], | 244 fake_push_client_->sent_notifications()[1], |
| 245 &message, &service_context, &scheduling_hash)); | 245 &message, &service_context, &scheduling_hash)); |
| 246 EXPECT_EQ(kMessage, message); | 246 EXPECT_EQ(kMessage, message); |
| 247 EXPECT_EQ(kServiceContext, service_context); | 247 EXPECT_EQ(kServiceContext, service_context); |
| 248 EXPECT_EQ(kSchedulingHash, scheduling_hash); | 248 EXPECT_EQ(kSchedulingHash, scheduling_hash); |
| 249 } | 249 } |
| 250 } | 250 } |
| 251 | 251 |
| 252 } // namespace | 252 } // namespace |
| 253 } // namespace csync | 253 } // namespace syncer |
| OLD | NEW |