net_log_capture_mode_unittest.cc 960 B

123456789101112131415161718192021222324252627282930313233343536
  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.
  4. #include "net/log/net_log_capture_mode.h"
  5. #include "testing/gtest/include/gtest/gtest.h"
  6. namespace net {
  7. namespace {
  8. TEST(NetLogCaptureMode, Default) {
  9. NetLogCaptureMode mode = NetLogCaptureMode::kDefault;
  10. EXPECT_FALSE(NetLogCaptureIncludesSensitive(mode));
  11. EXPECT_FALSE(NetLogCaptureIncludesSocketBytes(mode));
  12. }
  13. TEST(NetLogCaptureMode, IncludeSensitive) {
  14. NetLogCaptureMode mode = NetLogCaptureMode::kIncludeSensitive;
  15. EXPECT_TRUE(NetLogCaptureIncludesSensitive(mode));
  16. EXPECT_FALSE(NetLogCaptureIncludesSocketBytes(mode));
  17. }
  18. TEST(NetLogCaptureMode, Everything) {
  19. NetLogCaptureMode mode = NetLogCaptureMode::kEverything;
  20. EXPECT_TRUE(NetLogCaptureIncludesSensitive(mode));
  21. EXPECT_TRUE(NetLogCaptureIncludesSocketBytes(mode));
  22. }
  23. } // namespace
  24. } // namespace net