| 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 "net/log/test_net_log_util.h" | 5 #include "net/log/test_net_log_util.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 | 8 |
| 9 #include "net/log/net_log.h" |
| 10 |
| 9 namespace net { | 11 namespace net { |
| 10 | 12 |
| 11 namespace { | 13 namespace { |
| 12 | 14 |
| 13 // Takes the list of entries and an offset, and returns an index into the array. | 15 // Takes the list of entries and an offset, and returns an index into the array. |
| 14 // If |offset| is positive, just returns |offset|. If it's negative, it | 16 // If |offset| is positive, just returns |offset|. If it's negative, it |
| 15 // indicates a position relative to the end of the array. | 17 // indicates a position relative to the end of the array. |
| 16 size_t GetIndex(const TestNetLogEntry::List& entries, int offset) { | 18 size_t GetIndex(const TestNetLogEntry::List& entries, int offset) { |
| 17 if (offset >= 0) | 19 if (offset >= 0) |
| 18 return static_cast<size_t>(offset); | 20 return static_cast<size_t>(offset); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 for (; i < entries.size(); ++i) { | 117 for (; i < entries.size(); ++i) { |
| 116 const TestNetLogEntry& entry = entries[i]; | 118 const TestNetLogEntry& entry = entries[i]; |
| 117 if (entry.type == expected_event && entry.phase == expected_phase) | 119 if (entry.type == expected_event && entry.phase == expected_phase) |
| 118 break; | 120 break; |
| 119 } | 121 } |
| 120 EXPECT_LT(i, entries.size()); | 122 EXPECT_LT(i, entries.size()); |
| 121 return i; | 123 return i; |
| 122 } | 124 } |
| 123 | 125 |
| 124 } // namespace net | 126 } // namespace net |
| OLD | NEW |