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

Side by Side Diff: blimp/net/blimp_stats_unittest.cc

Issue 2632803002: Remove all blimp network code. (Closed)
Patch Set: merge from origin/master for good measure Created 3 years, 11 months 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
« no previous file with comments | « blimp/net/blimp_stats.cc ('k') | blimp/net/blimp_transport.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <limits>
6
7 #include "base/at_exit.h"
8 #include "base/macros.h"
9 #include "blimp/net/blimp_stats.h"
10 #include "testing/gtest/include/gtest/gtest.h"
11
12 namespace blimp {
13
14 class BlimpStatsTest : public testing::Test {
15 public:
16 BlimpStatsTest() {}
17 ~BlimpStatsTest() override {}
18
19 private:
20 base::ShadowingAtExitManager at_exit_manager_;
21
22 DISALLOW_COPY_AND_ASSIGN(BlimpStatsTest);
23 };
24
25 TEST_F(BlimpStatsTest, AddStatsAndVerify) {
26 EXPECT_EQ(0, BlimpStats::GetInstance()->Get(BlimpStats::BYTES_SENT));
27 EXPECT_EQ(0, BlimpStats::GetInstance()->Get(BlimpStats::BYTES_RECEIVED));
28 EXPECT_EQ(0, BlimpStats::GetInstance()->Get(BlimpStats::COMMIT));
29
30 BlimpStats::GetInstance()->Add(BlimpStats::BYTES_SENT, 10);
31 BlimpStats::GetInstance()->Add(BlimpStats::BYTES_SENT, 20);
32 BlimpStats::GetInstance()->Add(BlimpStats::BYTES_RECEIVED, 5);
33 BlimpStats::GetInstance()->Add(BlimpStats::COMMIT, 1);
34
35 EXPECT_EQ(30, BlimpStats::GetInstance()->Get(BlimpStats::BYTES_SENT));
36 EXPECT_EQ(5, BlimpStats::GetInstance()->Get(BlimpStats::BYTES_RECEIVED));
37 EXPECT_EQ(1, BlimpStats::GetInstance()->Get(BlimpStats::COMMIT));
38 }
39
40 } // namespace blimp
OLDNEW
« no previous file with comments | « blimp/net/blimp_stats.cc ('k') | blimp/net/blimp_transport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698