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
3 // found in the LICENSE file.
5 #include "net/log/net_log_capture_mode.h"
7 #include "testing/gtest/include/gtest/gtest.h"
13 TEST(NetLogCaptureMode
, DefaultConstructor
) {
14 EXPECT_EQ(NetLogCaptureMode(), NetLogCaptureMode::Default());
17 TEST(NetLogCaptureMode
, Default
) {
18 NetLogCaptureMode mode
= NetLogCaptureMode::Default();
20 EXPECT_FALSE(mode
.include_cookies_and_credentials());
21 EXPECT_FALSE(mode
.include_socket_bytes());
23 EXPECT_EQ(mode
, NetLogCaptureMode::Default());
24 EXPECT_NE(mode
, NetLogCaptureMode::IncludeCookiesAndCredentials());
25 EXPECT_NE(mode
, NetLogCaptureMode::IncludeSocketBytes());
28 TEST(NetLogCaptureMode
, IncludeCookiesAndCredentials
) {
29 NetLogCaptureMode mode
= NetLogCaptureMode::IncludeCookiesAndCredentials();
31 EXPECT_TRUE(mode
.include_cookies_and_credentials());
32 EXPECT_FALSE(mode
.include_socket_bytes());
34 EXPECT_NE(mode
, NetLogCaptureMode::Default());
35 EXPECT_EQ(mode
, NetLogCaptureMode::IncludeCookiesAndCredentials());
36 EXPECT_NE(mode
, NetLogCaptureMode::IncludeSocketBytes());
39 TEST(NetLogCaptureMode
, IncludeSocketBytes
) {
40 NetLogCaptureMode mode
= NetLogCaptureMode::IncludeSocketBytes();
42 EXPECT_TRUE(mode
.include_cookies_and_credentials());
43 EXPECT_TRUE(mode
.include_socket_bytes());
45 EXPECT_NE(mode
, NetLogCaptureMode::Default());
46 EXPECT_NE(mode
, NetLogCaptureMode::IncludeCookiesAndCredentials());
47 EXPECT_EQ(mode
, NetLogCaptureMode::IncludeSocketBytes());