| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/net_log_capture_mode.h" | 5 #include "net/log/net_log_capture_mode.h" |
| 6 | 6 |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 8 |
| 9 namespace net { | 9 namespace net { |
| 10 | 10 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 EXPECT_NE(mode, NetLogCaptureMode::None()); | 66 EXPECT_NE(mode, NetLogCaptureMode::None()); |
| 67 EXPECT_NE(mode, NetLogCaptureMode::Default()); | 67 EXPECT_NE(mode, NetLogCaptureMode::Default()); |
| 68 EXPECT_NE(mode, NetLogCaptureMode::IncludeCookiesAndCredentials()); | 68 EXPECT_NE(mode, NetLogCaptureMode::IncludeCookiesAndCredentials()); |
| 69 EXPECT_EQ(mode, NetLogCaptureMode::IncludeSocketBytes()); | 69 EXPECT_EQ(mode, NetLogCaptureMode::IncludeSocketBytes()); |
| 70 EXPECT_EQ( | 70 EXPECT_EQ( |
| 71 mode.ToInternalValueForTesting(), | 71 mode.ToInternalValueForTesting(), |
| 72 NetLogCaptureMode::IncludeSocketBytes().ToInternalValueForTesting()); | 72 NetLogCaptureMode::IncludeSocketBytes().ToInternalValueForTesting()); |
| 73 } | 73 } |
| 74 | 74 |
| 75 TEST(NetLogCaptureMode, Max) { | |
| 76 NetLogCaptureMode none = NetLogCaptureMode::None(); | |
| 77 NetLogCaptureMode all = NetLogCaptureMode::IncludeSocketBytes(); | |
| 78 NetLogCaptureMode cookies = NetLogCaptureMode::IncludeCookiesAndCredentials(); | |
| 79 NetLogCaptureMode def = NetLogCaptureMode::Default(); | |
| 80 | |
| 81 EXPECT_EQ(all, NetLogCaptureMode::Max(none, all)); | |
| 82 EXPECT_EQ(all, NetLogCaptureMode::Max(all, none)); | |
| 83 | |
| 84 EXPECT_EQ(cookies, NetLogCaptureMode::Max(def, cookies)); | |
| 85 EXPECT_EQ(cookies, NetLogCaptureMode::Max(cookies, def)); | |
| 86 | |
| 87 EXPECT_EQ(all, NetLogCaptureMode::Max(def, all)); | |
| 88 EXPECT_EQ(all, NetLogCaptureMode::Max(all, def)); | |
| 89 } | |
| 90 | |
| 91 } // namespace | 75 } // namespace |
| 92 | 76 |
| 93 } // namespace net | 77 } // namespace net |
| OLD | NEW |