| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "net/base/network_activity_monitor.h" | 5 #include "net/base/network_activity_monitor.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 FROM_HERE, | 112 FROM_HERE, |
| 113 base::Bind(&IncrementBytesSent, bytes_sent)); | 113 base::Bind(&IncrementBytesSent, bytes_sent)); |
| 114 threads[thread_num]->task_runner()->PostTask( | 114 threads[thread_num]->task_runner()->PostTask( |
| 115 FROM_HERE, | 115 FROM_HERE, |
| 116 base::Bind(&VerifyBytesSentIsMultipleOf, bytes_sent)); | 116 base::Bind(&VerifyBytesSentIsMultipleOf, bytes_sent)); |
| 117 threads[thread_num]->task_runner()->PostTask( | 117 threads[thread_num]->task_runner()->PostTask( |
| 118 FROM_HERE, | 118 FROM_HERE, |
| 119 base::Bind(&VerifyBytesReceivedIsMultipleOf, bytes_received)); | 119 base::Bind(&VerifyBytesReceivedIsMultipleOf, bytes_received)); |
| 120 } | 120 } |
| 121 | 121 |
| 122 STLDeleteElements(&threads); | 122 base::STLDeleteElements(&threads); |
| 123 | 123 |
| 124 NetworkActivityMonitor* monitor = NetworkActivityMonitor::GetInstance(); | 124 NetworkActivityMonitor* monitor = NetworkActivityMonitor::GetInstance(); |
| 125 EXPECT_EQ(num_increments * bytes_received, monitor->GetBytesReceived()); | 125 EXPECT_EQ(num_increments * bytes_received, monitor->GetBytesReceived()); |
| 126 EXPECT_EQ(num_increments * bytes_sent, monitor->GetBytesSent()); | 126 EXPECT_EQ(num_increments * bytes_sent, monitor->GetBytesSent()); |
| 127 } | 127 } |
| 128 | 128 |
| 129 } // namespace test | 129 } // namespace test |
| 130 | 130 |
| 131 } // namespace net | 131 } // namespace net |
| OLD | NEW |