blob: 182f07b2b56b89bae5c85bcd1bfaa9ed7d4b179c [file] [log] [blame]
// Copyright 2023 The ChromiumOS Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "crash-reporter/crash_sender_paths.h"
#include <gtest/gtest.h>
namespace paths {
namespace {
// Chrome's crash report log file when not under the dry run mode.
constexpr char kChromeCrashLog[] = "/var/log/chrome/Crash Reports/uploads.log";
TEST(CrashSenderPathsTest, ChromeCrashLog) {
// Default is not under the dry run mode.
EXPECT_STREQ(kChromeCrashLog, ChromeCrashLog::Get());
// Switch dry run mode on.
ChromeCrashLog::SetDryRun(true);
EXPECT_STREQ("/dev/full", ChromeCrashLog::Get());
// Switch dry run mode back off.
ChromeCrashLog::SetDryRun(false);
EXPECT_STREQ(kChromeCrashLog, ChromeCrashLog::Get());
}
} // namespace
} // namespace paths