#include "components/sync/service/data_type_controller.h"
#include <utility>
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/run_loop.h"
#include "base/test/gmock_move_support.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/mock_callback.h"
#include "base/test/task_environment.h"
#include "components/sync/engine/data_type_activation_response.h"
#include "components/sync/model/data_type_activation_request.h"
#include "components/sync/model/forwarding_data_type_controller_delegate.h"
#include "components/sync/model/type_entities_count.h"
#include "components/sync/service/configure_context.h"
#include "components/sync/test/fake_data_type_processor.h"
#include "components/sync/test/mock_data_type_controller_delegate.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace syncer {
namespace {
_;
DoAll;
InSequence;
NiceMock;
NotNull;
SaveArg;
const DataType kTestDataType = …;
const char kCacheGuid[] = …;
const char kAccountId[] = …;
const char kStartFailuresHistogram[] = …;
const char kRunFailuresHistogram[] = …;
MATCHER(ErrorIsSet, "") { … }
class TestDataTypeController : public DataTypeController { … };
ConfigureContext MakeConfigureContext() { … }
}
class DataTypeControllerTest : public testing::Test { … };
TEST_F(DataTypeControllerTest, InitialState) { … }
TEST_F(DataTypeControllerTest, LoadModelsOnBackendThread) { … }
TEST_F(DataTypeControllerTest, Connect) { … }
TEST_F(DataTypeControllerTest, ConnectWithInitialSyncDone) { … }
TEST_F(DataTypeControllerTest, ConnectWithError) { … }
TEST_F(DataTypeControllerTest, Stop) { … }
TEST_F(DataTypeControllerTest, StopWhenDatatypeEnabled) { … }
TEST_F(DataTypeControllerTest, StopWhenDatatypeDisabled) { … }
TEST_F(DataTypeControllerTest, StopWhileStopping) { … }
TEST_F(DataTypeControllerTest, StopBeforeLoadModels) { … }
TEST_F(DataTypeControllerTest, StopDuringFailedState) { … }
TEST_F(DataTypeControllerTest, StopWhileStarting) { … }
TEST_F(DataTypeControllerTest, StopWhileStartingWithError) { … }
TEST_F(DataTypeControllerTest, StopWhileErrorInFlight) { … }
TEST_F(DataTypeControllerTest, ReportErrorWhileStarting) { … }
TEST_F(DataTypeControllerTest, StopAndReportErrorWhileStarting) { … }
TEST(DataTypeControllerWithMultiDelegateTest, ToggleSyncMode) { … }
TEST_F(DataTypeControllerTest, ReportErrorAfterLoaded) { … }
TEST_F(DataTypeControllerTest, ReportErrorAfterRegisteredWithBackend) { … }
TEST_F(DataTypeControllerTest, ClearMetadataWhenDatatypeNotRunning) { … }
TEST_F(DataTypeControllerTest,
ShouldNotClearMetadataWhenDatatypeInFailedState) { … }
}