blob: c85d3ee3a30143d5bd6a070fa84a70ff9cee59c9 [file] [log] [blame]
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/updater/updater_scope.h"
#include "base/command_line.h"
#include "base/test/scoped_command_line.h"
#include "chrome/updater/constants.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace updater {
TEST(UpdaterScope, GetUpdaterScope) {
base::test::ScopedCommandLine original_command_line;
{
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
command_line->RemoveSwitch(kSystemSwitch);
DCHECK_EQ(GetUpdaterScope(), UpdaterScope::kUser);
command_line->AppendSwitch(kSystemSwitch);
DCHECK_EQ(GetUpdaterScope(), UpdaterScope::kSystem);
}
}
} // namespace updater