Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(351)

Side by Side Diff: google_apis/gcm/engine/connection_event_tracker_unittest.cc

Issue 2481873002: Added ClientEvent proto and structure for storing events in the factory. (Closed)
Patch Set: Integrated code review comments Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "google_apis/gcm/engine/connection_event_tracker.h"
6
7 #include "google_apis/gcm/protocol/mcs.pb.h"
8 #include "net/base/net_errors.h"
9 #include "testing/gtest/include/gtest/gtest.h"
10
11 namespace gcm {
12 namespace {
13
14 class ConnectionEventTrackerTest : public testing::Test {
15 public:
16 ConnectionEventTracker* tracker() { return &tracker_; }
17
18 private:
19 ConnectionEventTracker tracker_;
20 };
21
22 } // namespace
23
24 TEST_F(ConnectionEventTrackerTest, SuccessfulAttempt) {
25 tracker()->StartConnectionAttempt();
26 tracker()->ConnectionAttemptSucceeded();
27 tracker()->EndConnectionAttempt();
28
29 mcs_proto::LoginRequest request;
30 tracker()->WriteToLoginRequest(&request);
31
32 ASSERT_EQ(request.client_event().size(), 1);
33 for (const auto& event : request.client_event())
34 EXPECT_EQ(event.type(), mcs_proto::ClientEvent::SUCCESSFUL_CONNECTION);
35 }
36
37 } // namespace gcm
OLDNEW
« no previous file with comments | « google_apis/gcm/engine/connection_event_tracker.cc ('k') | google_apis/gcm/engine/connection_factory_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698