#include "components/history/core/browser/sync/delete_directive_handler.h"
#include <string>
#include <utility>
#include "base/files/scoped_temp_dir.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/mock_callback.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "components/history/core/browser/history_backend.h"
#include "components/history/core/browser/history_backend_client.h"
#include "components/history/core/browser/history_database_params.h"
#include "components/history/core/browser/history_db_task.h"
#include "components/history/core/browser/history_types.h"
#include "components/history/core/browser/in_memory_history_backend.h"
#include "components/history/core/test/test_history_database.h"
#include "components/sync/base/client_tag_hash.h"
#include "components/sync/protocol/entity_specifics.pb.h"
#include "components/sync/protocol/history_delete_directive_specifics.pb.h"
#include "components/sync/test/fake_sync_change_processor.h"
#include "components/sync/test/sync_change_processor_wrapper_for_test.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace history {
const std::string kTestAppId1 = …;
const std::string kTestAppId2 = …;
namespace {
base::Time UnixUsecToTime(int64_t usec) { … }
class TestHistoryBackendDelegate : public HistoryBackend::Delegate { … };
void ScheduleDBTask(scoped_refptr<HistoryBackend> history_backend,
const base::Location& location,
std::unique_ptr<HistoryDBTask> task,
base::CancelableTaskTracker* tracker) { … }
void CheckDirectiveProcessingResult(
base::Time timeout,
const syncer::FakeSyncChangeProcessor* change_processor,
uint32_t num_changes) { … }
class HistoryDeleteDirectiveHandlerTest : public testing::Test { … };
TEST_F(HistoryDeleteDirectiveHandlerTest, SyncAlreadyReadyToSync) { … }
TEST_F(HistoryDeleteDirectiveHandlerTest, WaitUntilReadyToSync) { … }
TEST_F(HistoryDeleteDirectiveHandlerTest,
ProcessLocalDeleteDirectiveSyncOnline) { … }
TEST_F(HistoryDeleteDirectiveHandlerTest, ProcessGlobalIdDeleteDirective) { … }
TEST_F(HistoryDeleteDirectiveHandlerTest, ProcessTimeRangeDeleteDirective) { … }
TEST_F(HistoryDeleteDirectiveHandlerTest,
ProcessTimeRangeDeleteDirectiveByApp) { … }
TEST_F(HistoryDeleteDirectiveHandlerTest, ProcessUrlDeleteDirective) { … }
}
}