chromium/chrome/browser/diagnostics/recon_diagnostics.cc

// Copyright 2012 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/diagnostics/recon_diagnostics.h"

#include <stddef.h>
#include <stdint.h>

#include <memory>
#include <string>

#include "base/files/file_util.h"
#include "base/json/json_reader.h"
#include "base/json/json_string_value_serializer.h"
#include "base/path_service.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/system/sys_info.h"
#include "build/branding_buildflags.h"
#include "build/build_config.h"
#include "chrome/browser/diagnostics/diagnostics_test.h"
#include "chrome/common/channel_info.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
#include "components/bookmarks/common/bookmark_constants.h"
#include "components/version_info/version_info.h"

#if BUILDFLAG(IS_WIN)
#include "chrome/installer/util/install_util.h"
#endif

// Reconnaissance diagnostics. These are the first and most critical
// diagnostic tests. Here we check for the existence of critical files.
// TODO(cpu): Define if it makes sense to localize strings.

// TODO(cpu): There are a few maximum file sizes hard-coded in this file
// that have little or no theoretical or experimental ground. Find a way
// to justify them.

namespace diagnostics {

namespace {

const int64_t kOneKilobyte =;
const int64_t kOneMegabyte =;

class InstallTypeTest;
InstallTypeTest* g_install_type =;

// Check that the disk space in the volume where the user data directory
// normally lives is not dangerously low.
class DiskSpaceTest : public DiagnosticsTest {};

// Check if it is system install or per-user install.
class InstallTypeTest : public DiagnosticsTest {};

// Checks that a given JSON file can be correctly parsed.
class JSONTest : public DiagnosticsTest {};

// Check that the flavor of the operating system is supported.
class OperatingSystemTest : public DiagnosticsTest {};

struct TestPathInfo {};

const TestPathInfo kPathsToTest[] =;

// Check that the user's data directory exists and the paths are writable.
class PathTest : public DiagnosticsTest {};

// Check the version of Chrome.
class VersionTest : public DiagnosticsTest {};

}  // namespace

std::unique_ptr<DiagnosticsTest> MakeDiskSpaceTest() {}

std::unique_ptr<DiagnosticsTest> MakeInstallTypeTest() {}

std::unique_ptr<DiagnosticsTest> MakeLocalOrSyncableBookmarksTest() {}

std::unique_ptr<DiagnosticsTest> MakeAccountBookmarksTest() {}

std::unique_ptr<DiagnosticsTest> MakeLocalStateTest() {}

std::unique_ptr<DiagnosticsTest> MakePreferencesTest() {}

std::unique_ptr<DiagnosticsTest> MakeOperatingSystemTest() {}

std::unique_ptr<DiagnosticsTest> MakeDictonaryDirTest() {}

std::unique_ptr<DiagnosticsTest> MakeLocalStateFileTest() {}

std::unique_ptr<DiagnosticsTest> MakeResourcesFileTest() {}

std::unique_ptr<DiagnosticsTest> MakeUserDirTest() {}

std::unique_ptr<DiagnosticsTest> MakeVersionTest() {}

}  // namespace diagnostics