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 #ifndef NET_LOG_TEST_NET_LOG_H_ | 5 #ifndef NET_LOG_TEST_NET_LOG_H_ |
6 #define NET_LOG_TEST_NET_LOG_H_ | 6 #define NET_LOG_TEST_NET_LOG_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "net/log/net_log.h" | 13 #include "net/log/net_log.h" |
14 #include "net/log/test_net_log_entry.h" | 14 #include "net/log/test_net_log_entry.h" |
15 | 15 |
16 namespace net { | 16 namespace net { |
17 | 17 |
18 // TestNetLog is NetLog subclass which records all NetLog events that occur and | 18 // TestNetLog is NetLog subclass which records all NetLog events that occur and |
19 // their parameters. It is intended for testing only, and is part of the | 19 // their parameters. It is intended for testing only, and is part of the |
20 // net_test_support project. | 20 // net_test_support project. |
21 class TestNetLog : public NetLog { | 21 class TestNetLog : public NetLog { |
22 public: | 22 public: |
23 TestNetLog(); | 23 TestNetLog(); |
24 ~TestNetLog() override; | 24 ~TestNetLog() override; |
25 | 25 |
26 void SetCaptureMode(NetLogCaptureMode capture_mode); | 26 void SetCaptureMode(NetLogCaptureMode capture_mode); |
27 NetLogCaptureMode GetCaptureMode() const; | |
mmenke
2015/05/06 15:14:42
Why do we need this?
eroman
2015/05/06 17:01:05
Done (removed)
| |
27 | 28 |
28 // Below methods are forwarded to test_net_log_observer_. | 29 // Below methods are forwarded to test_net_log_observer_. |
29 void GetEntries(TestNetLogEntry::List* entry_list) const; | 30 void GetEntries(TestNetLogEntry::List* entry_list) const; |
30 void GetEntriesForSource(Source source, | 31 void GetEntriesForSource(Source source, |
31 TestNetLogEntry::List* entry_list) const; | 32 TestNetLogEntry::List* entry_list) const; |
32 size_t GetSize() const; | 33 size_t GetSize() const; |
33 void Clear(); | 34 void Clear(); |
34 | 35 |
35 // Returns a NetLog observer that will write entries to the TestNetLog's event | 36 // Returns a NetLog observer that will write entries to the TestNetLog's event |
36 // store. For testing code that bypasses NetLogs and adds events directly to | 37 // store. For testing code that bypasses NetLogs and adds events directly to |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
77 private: | 78 private: |
78 TestNetLog test_net_log_; | 79 TestNetLog test_net_log_; |
79 const BoundNetLog net_log_; | 80 const BoundNetLog net_log_; |
80 | 81 |
81 DISALLOW_COPY_AND_ASSIGN(BoundTestNetLog); | 82 DISALLOW_COPY_AND_ASSIGN(BoundTestNetLog); |
82 }; | 83 }; |
83 | 84 |
84 } // namespace net | 85 } // namespace net |
85 | 86 |
86 #endif // NET_LOG_TEST_NET_LOG_H_ | 87 #endif // NET_LOG_TEST_NET_LOG_H_ |
OLD | NEW |