| Index: sync/internal_api/js_mutation_event_observer_unittest.cc
|
| diff --git a/sync/internal_api/js_mutation_event_observer_unittest.cc b/sync/internal_api/js_mutation_event_observer_unittest.cc
|
| index a7eb8243e6c8f50b28e739fcc47554ac4352afc9..91e10b3a30edc8056ac6b590096673a1ff4d48c8 100644
|
| --- a/sync/internal_api/js_mutation_event_observer_unittest.cc
|
| +++ b/sync/internal_api/js_mutation_event_observer_unittest.cc
|
| @@ -46,21 +46,18 @@ TEST_F(JsMutationEventObserverTest, OnChangesApplied) {
|
| // We don't test with passwords as that requires additional setup.
|
|
|
| // Build a list of example ChangeRecords.
|
| - syncer::ChangeRecord changes[syncer::MODEL_TYPE_COUNT];
|
| - for (int i = syncer::AUTOFILL_PROFILE; i < syncer::MODEL_TYPE_COUNT; ++i) {
|
| + ChangeRecord changes[MODEL_TYPE_COUNT];
|
| + for (int i = AUTOFILL_PROFILE; i < MODEL_TYPE_COUNT; ++i) {
|
| changes[i].id = i;
|
| switch (i % 3) {
|
| case 0:
|
| - changes[i].action =
|
| - syncer::ChangeRecord::ACTION_ADD;
|
| + changes[i].action = ChangeRecord::ACTION_ADD;
|
| break;
|
| case 1:
|
| - changes[i].action =
|
| - syncer::ChangeRecord::ACTION_UPDATE;
|
| + changes[i].action = ChangeRecord::ACTION_UPDATE;
|
| break;
|
| default:
|
| - changes[i].action =
|
| - syncer::ChangeRecord::ACTION_DELETE;
|
| + changes[i].action = ChangeRecord::ACTION_DELETE;
|
| break;
|
| }
|
| }
|
| @@ -70,15 +67,15 @@ TEST_F(JsMutationEventObserverTest, OnChangesApplied) {
|
| // starting from changes[i].
|
|
|
| // Set expectations for each data type.
|
| - for (int i = syncer::AUTOFILL_PROFILE; i < syncer::MODEL_TYPE_COUNT; ++i) {
|
| + for (int i = AUTOFILL_PROFILE; i < MODEL_TYPE_COUNT; ++i) {
|
| const std::string& model_type_str =
|
| - syncer::ModelTypeToString(syncer::ModelTypeFromInt(i));
|
| + ModelTypeToString(ModelTypeFromInt(i));
|
| DictionaryValue expected_details;
|
| expected_details.SetString("modelType", model_type_str);
|
| expected_details.SetString("writeTransactionId", "0");
|
| ListValue* expected_changes = new ListValue();
|
| expected_details.Set("changes", expected_changes);
|
| - for (int j = i; j < syncer::MODEL_TYPE_COUNT; ++j) {
|
| + for (int j = i; j < MODEL_TYPE_COUNT; ++j) {
|
| expected_changes->Append(changes[j].ToValue());
|
| }
|
| EXPECT_CALL(mock_js_event_handler_,
|
| @@ -87,12 +84,11 @@ TEST_F(JsMutationEventObserverTest, OnChangesApplied) {
|
| }
|
|
|
| // Fire OnChangesApplied() for each data type.
|
| - for (int i = syncer::AUTOFILL_PROFILE; i < syncer::MODEL_TYPE_COUNT; ++i) {
|
| - syncer::ChangeRecordList
|
| - local_changes(changes + i, changes + arraysize(changes));
|
| + for (int i = AUTOFILL_PROFILE; i < MODEL_TYPE_COUNT; ++i) {
|
| + ChangeRecordList local_changes(changes + i, changes + arraysize(changes));
|
| js_mutation_event_observer_.OnChangesApplied(
|
| - syncer::ModelTypeFromInt(i),
|
| - 0, syncer::ImmutableChangeRecordList(&local_changes));
|
| + ModelTypeFromInt(i),
|
| + 0, ImmutableChangeRecordList(&local_changes));
|
| }
|
|
|
| PumpLoop();
|
| @@ -101,21 +97,19 @@ TEST_F(JsMutationEventObserverTest, OnChangesApplied) {
|
| TEST_F(JsMutationEventObserverTest, OnChangesComplete) {
|
| InSequence dummy;
|
|
|
| - for (int i = syncer::FIRST_REAL_MODEL_TYPE;
|
| - i < syncer::MODEL_TYPE_COUNT; ++i) {
|
| + for (int i = FIRST_REAL_MODEL_TYPE; i < MODEL_TYPE_COUNT; ++i) {
|
| DictionaryValue expected_details;
|
| expected_details.SetString(
|
| "modelType",
|
| - syncer::ModelTypeToString(syncer::ModelTypeFromInt(i)));
|
| + ModelTypeToString(ModelTypeFromInt(i)));
|
| EXPECT_CALL(mock_js_event_handler_,
|
| HandleJsEvent("onChangesComplete",
|
| HasDetailsAsDictionary(expected_details)));
|
| }
|
|
|
| - for (int i = syncer::FIRST_REAL_MODEL_TYPE;
|
| - i < syncer::MODEL_TYPE_COUNT; ++i) {
|
| + for (int i = FIRST_REAL_MODEL_TYPE; i < MODEL_TYPE_COUNT; ++i) {
|
| js_mutation_event_observer_.OnChangesComplete(
|
| - syncer::ModelTypeFromInt(i));
|
| + ModelTypeFromInt(i));
|
| }
|
| PumpLoop();
|
| }
|
|
|