chromium/content/browser/attribution_reporting/sql_query_plan_test_util.cc

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

#include "content/browser/attribution_reporting/sql_query_plan_test_util.h"

#include <optional>
#include <ostream>
#include <string>
#include <string_view>
#include <utility>
#include <vector>

#include "base/check.h"
#include "base/command_line.h"
#include "base/containers/contains.h"
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/path_service.h"
#include "base/process/launch.h"
#include "base/process/process.h"
#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/strings/string_util.h"
#include "base/types/expected.h"
#include "testing/gmock/include/gmock/gmock.h"

namespace content {

namespace {

base::FilePath GetExecPath(std::string_view name) {}

// TODO(apaseltiner): Instead of making each index-check opt-in, we should parse
// the entire query plan and verify the entire set of indexes.
class SqlIndexMatcher {};

bool SqlIndexMatcher::MatchAndExplain(const SqlQueryPlan& plan,
                                      std::ostream*) const {}

size_t SqlIndexMatcher::FindIndexStart(std::string_view plan) const {}

void SqlIndexMatcher::DescribeTo(std::ostream* out, bool negated) const {}

// TODO(apaseltiner): This check is not robust, as some "scans" are optimized
// using an index.
bool HasFullTableScan(const SqlQueryPlan& plan) {}

}  // namespace

testing::Matcher<SqlQueryPlan> UsesIndex(std::string name,
                                         std::vector<std::string> columns) {}

testing::Matcher<SqlQueryPlan> UsesCoveringIndex(
    std::string name,
    std::vector<std::string> columns) {}

testing::Matcher<SqlQueryPlan> UsesPrimaryKey() {}

std::ostream& operator<<(std::ostream& out, const SqlQueryPlan& plan) {}

SqlQueryPlanExplainer::SqlQueryPlanExplainer(base::FilePath db_path)
    :{}

SqlQueryPlanExplainer::~SqlQueryPlanExplainer() = default;

base::expected<SqlQueryPlan, SqlQueryPlanExplainer::Error>
SqlQueryPlanExplainer::GetPlan(
    std::string query,
    std::optional<SqlFullScanReason> full_scan_reason) {}

std::ostream& operator<<(std::ostream& out,
                         SqlQueryPlanExplainer::Error error) {}

}  // namespace content