chromium/chrome/browser/upgrade_detector/get_installed_version_linux_unittest.cc

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/upgrade_detector/get_installed_version.h"

#include <stdio.h>
#include <string>

#include "base/base_switches.h"
#include "base/command_line.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/test/mock_callback.h"
#include "base/test/task_environment.h"
#include "components/version_info/version_info.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/multiprocess_func_list.h"

_;

namespace {

constexpr char kChildModeSwitch[] =;

enum class ChildMode {};

ChildMode GetChildMode() {}

}  // namespace

// A function run in a child process to print the desired version to stdout,
// just like Chrome does.
MULTIPROCESS_TEST_MAIN(GetProductVersionInChildProc) {}

// A multi process test that exercises the Linux implementation of
// GetInstalledVersion.
class GetInstalledVersionLinuxTest : public ::testing::Test {};

// Tests that an empty instance is returned when the child process reports
// nothing.
TEST_F(GetInstalledVersionLinuxTest, NoVersion) {}

// Tests that an empty instance is returned when the child process exits with an
// error.
TEST_F(GetInstalledVersionLinuxTest, ProcessError) {}

// Tests that an empty instance is returned when the child process reports a
// monkey.
TEST_F(GetInstalledVersionLinuxTest, WithMonkey) {}

// Tests that the expected instance is returned when the child process reports a
// valid version.
// b/344455232: Disable as the test is failing on dbg build.
#if defined(NDEBUG)
#define MAYBE_WithVersion
#else
#define MAYBE_WithVersion
#endif
TEST_F(GetInstalledVersionLinuxTest, MAYBE_WithVersion) {}