blob: ea4fa30c7c27a86bf4f754b35f6174ae70ce0d51 [file] [log] [blame]
eroman001c3742015-04-23 03:11:171// Copyright 2015 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "net/log/net_log_capture_mode.h"
6
7#include "testing/gtest/include/gtest/gtest.h"
8
9namespace net {
10
11namespace {
12
eroman001c3742015-04-23 03:11:1713TEST(NetLogCaptureMode, Default) {
Eric Roman3124cde2019-07-10 22:26:1514 NetLogCaptureMode mode = NetLogCaptureMode::kDefault;
eroman001c3742015-04-23 03:11:1715
Eric Roman3124cde2019-07-10 22:26:1516 EXPECT_FALSE(NetLogCaptureIncludesSensitive(mode));
17 EXPECT_FALSE(NetLogCaptureIncludesSocketBytes(mode));
eroman001c3742015-04-23 03:11:1718}
19
Eric Roman3124cde2019-07-10 22:26:1520TEST(NetLogCaptureMode, IncludeSensitive) {
21 NetLogCaptureMode mode = NetLogCaptureMode::kIncludeSensitive;
eroman001c3742015-04-23 03:11:1722
Eric Roman3124cde2019-07-10 22:26:1523 EXPECT_TRUE(NetLogCaptureIncludesSensitive(mode));
24 EXPECT_FALSE(NetLogCaptureIncludesSocketBytes(mode));
eroman001c3742015-04-23 03:11:1725}
26
Eric Roman3124cde2019-07-10 22:26:1527TEST(NetLogCaptureMode, Everything) {
28 NetLogCaptureMode mode = NetLogCaptureMode::kEverything;
eroman001c3742015-04-23 03:11:1729
Eric Roman3124cde2019-07-10 22:26:1530 EXPECT_TRUE(NetLogCaptureIncludesSensitive(mode));
31 EXPECT_TRUE(NetLogCaptureIncludesSocketBytes(mode));
eroman001c3742015-04-23 03:11:1732}
33
eroman001c3742015-04-23 03:11:1734} // namespace
35
36} // namespace net