chromium/components/upload_list/text_log_upload_list_unittest.cc

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

#include "components/upload_list/text_log_upload_list.h"

#include <string>

#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/callback.h"
#include "base/memory/ref_counted.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace {

constexpr char kTestUploadTime[] =;
constexpr char kTestUploadId[] =;
constexpr char kTestLocalID[] =;
constexpr char kTestCaptureTime[] =;
constexpr char kTestSource[] =;
constexpr char kTestPathHash[] =;
// Explicitly partly taken from `base::kWhitespaceASCII` so our test doesn't
// depend on the change of the behavior of the base library.
constexpr char kTestWhitespaces[] =;

class TextLogUploadListTest : public testing::Test {};

// These tests test that UploadList can parse a vector of log entry strings of
// various formats to a vector of UploadInfo objects. See the UploadList
// declaration for a description of the log entry string formats.

// Test log entry string with upload time and upload ID.
// This is the format that crash reports are stored in.
TEST_F(TextLogUploadListTest, ParseUploadTimeUploadId) {}

TEST_F(TextLogUploadListTest, ParseUploadTimeUploadId_JSON) {}

// Test log entry string with upload time, upload ID and local ID.
// This is the old format that WebRTC logs were stored in.
TEST_F(TextLogUploadListTest, ParseUploadTimeUploadIdLocalId) {}

TEST_F(TextLogUploadListTest, ParseUploadTimeUploadIdLocalId_JSON) {}

// Test log entry string with upload time, upload ID and capture time.
// This is the format that WebRTC logs that only have been uploaded only are
// stored in.
TEST_F(TextLogUploadListTest, ParseUploadTimeUploadIdCaptureTime) {}

TEST_F(TextLogUploadListTest, ParseUploadTimeUploadIdCaptureTime_JSON) {}

// Test log entry string with local ID and capture time.
// This is the format that WebRTC logs that only are stored locally are stored
// in.
TEST_F(TextLogUploadListTest, ParseLocalIdCaptureTime) {}

TEST_F(TextLogUploadListTest, ParseLocalIdCaptureTime_JSON) {}

// Test log entry string with upload time, upload ID, local ID and capture
// time.
// This is the format that WebRTC logs that are stored locally and have been
// uploaded are stored in.
TEST_F(TextLogUploadListTest, ParseUploadTimeUploadIdLocalIdCaptureTime) {}

TEST_F(TextLogUploadListTest, ParseUploadTimeUploadIdLocalIdCaptureTime_JSON) {}

TEST_F(TextLogUploadListTest, ParseMultipleEntries) {}

TEST_F(TextLogUploadListTest, ParseMultipleEntries_JSON) {}

TEST_F(TextLogUploadListTest, ParseWithMultipleDelimiters) {}

TEST_F(TextLogUploadListTest, ParseWithMultipleDelimiters_JSON) {}

TEST_F(TextLogUploadListTest, ParseWithState) {}

TEST_F(TextLogUploadListTest, ParseWithState_JSON) {}

TEST_F(TextLogUploadListTest, ParseWithSource_JSON) {}

TEST_F(TextLogUploadListTest, ParseWithPathHash_JSON) {}

TEST_F(TextLogUploadListTest, ParseHybridFormat) {}

TEST_F(TextLogUploadListTest, SkipInvalidEntry_JSON) {}

// Test log entry string with only single column.
// Such kind of lines are considered as invalid CSV entry. They should be
// skipped in parsing the log file.
TEST_F(TextLogUploadListTest, SkipBlankOrCorruptedEntry) {}

TEST_F(TextLogUploadListTest, ClearUsingUploadTime) {}

TEST_F(TextLogUploadListTest, ClearUsingUploadTime_JSON) {}

TEST_F(TextLogUploadListTest, ClearUsingCaptureTime) {}

TEST_F(TextLogUploadListTest, ClearUsingCaptureTime_JSON) {}

TEST_F(TextLogUploadListTest, ClearingAllDataDeletesFile) {}

TEST_F(TextLogUploadListTest, ClearingAllDataDeletesFile_JSON) {}

// https://crbug.com/597384
TEST_F(TextLogUploadListTest, SimultaneousAccess) {}

TEST_F(TextLogUploadListTest, SimultaneousAccess_JSON) {}

}  // namespace