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 "chromeos/network/network_event_log.h" | 5 #include "chromeos/network/network_event_log.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 std::string output_newest_first_short = network_event_log::GetAsString( | 91 std::string output_newest_first_short = network_event_log::GetAsString( |
92 network_event_log::NEWEST_FIRST, 2); | 92 network_event_log::NEWEST_FIRST, 2); |
93 output_newest_first_short = SkipTime(output_newest_first_short); | 93 output_newest_first_short = SkipTime(output_newest_first_short); |
94 EXPECT_EQ(expected_output_newest_first_short, output_newest_first_short); | 94 EXPECT_EQ(expected_output_newest_first_short, output_newest_first_short); |
95 } | 95 } |
96 | 96 |
97 TEST_F(NetworkEventLogTest, TestMaxNetworkEvents) { | 97 TEST_F(NetworkEventLogTest, TestMaxNetworkEvents) { |
98 const size_t entries_to_add = | 98 const size_t entries_to_add = |
99 network_event_log::kMaxNetworkEventLogEntries + 3; | 99 network_event_log::kMaxNetworkEventLogEntries + 3; |
100 for (size_t i = 0; i < entries_to_add; ++i) | 100 for (size_t i = 0; i < entries_to_add; ++i) |
101 network_event_log::AddEntry("test", StringPrintf("event_%"PRIuS, i), ""); | 101 network_event_log::AddEntry("test", |
| 102 base::StringPrintf("event_%"PRIuS, i), ""); |
102 | 103 |
103 std::string output = GetAsString(network_event_log::OLDEST_FIRST, 0); | 104 std::string output = GetAsString(network_event_log::OLDEST_FIRST, 0); |
104 size_t output_lines = CountLines(output); | 105 size_t output_lines = CountLines(output); |
105 EXPECT_EQ(network_event_log::kMaxNetworkEventLogEntries, output_lines); | 106 EXPECT_EQ(network_event_log::kMaxNetworkEventLogEntries, output_lines); |
106 } | 107 } |
107 | 108 |
108 } // namespace chromeos | 109 } // namespace chromeos |
OLD | NEW |