| Index: components/sync/core_impl/js_mutation_event_observer_unittest.cc
|
| diff --git a/sync/internal_api/js_mutation_event_observer_unittest.cc b/components/sync/core_impl/js_mutation_event_observer_unittest.cc
|
| similarity index 78%
|
| rename from sync/internal_api/js_mutation_event_observer_unittest.cc
|
| rename to components/sync/core_impl/js_mutation_event_observer_unittest.cc
|
| index 2f0ff5dd17e9b4dfaa5c5f245051598239baedf2..9d6916712b1b39cbb122826ecf04d9b3c31d7b68 100644
|
| --- a/sync/internal_api/js_mutation_event_observer_unittest.cc
|
| +++ b/components/sync/core_impl/js_mutation_event_observer_unittest.cc
|
| @@ -2,15 +2,15 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "sync/internal_api/js_mutation_event_observer.h"
|
| +#include "components/sync/core_impl/js_mutation_event_observer.h"
|
|
|
| #include "base/macros.h"
|
| #include "base/run_loop.h"
|
| #include "base/values.h"
|
| -#include "sync/internal_api/public/base/model_type.h"
|
| -#include "sync/internal_api/public/util/weak_handle.h"
|
| -#include "sync/js/js_event_details.h"
|
| -#include "sync/js/js_test_util.h"
|
| +#include "components/sync/base/model_type.h"
|
| +#include "components/sync/base/weak_handle.h"
|
| +#include "components/sync/js/js_event_details.h"
|
| +#include "components/sync/js/js_test_util.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| namespace syncer {
|
| @@ -35,9 +35,7 @@ class JsMutationEventObserverTest : public testing::Test {
|
| StrictMock<MockJsEventHandler> mock_js_event_handler_;
|
| JsMutationEventObserver js_mutation_event_observer_;
|
|
|
| - void PumpLoop() {
|
| - base::RunLoop().RunUntilIdle();
|
| - }
|
| + void PumpLoop() { base::RunLoop().RunUntilIdle(); }
|
| };
|
|
|
| TEST_F(JsMutationEventObserverTest, OnChangesApplied) {
|
| @@ -68,8 +66,7 @@ TEST_F(JsMutationEventObserverTest, OnChangesApplied) {
|
|
|
| // Set expectations for each data type.
|
| for (int i = AUTOFILL_PROFILE; i < MODEL_TYPE_COUNT; ++i) {
|
| - const std::string& model_type_str =
|
| - ModelTypeToString(ModelTypeFromInt(i));
|
| + const std::string& model_type_str = ModelTypeToString(ModelTypeFromInt(i));
|
| base::DictionaryValue expected_details;
|
| expected_details.SetString("modelType", model_type_str);
|
| expected_details.SetString("writeTransactionId", "0");
|
| @@ -80,15 +77,14 @@ TEST_F(JsMutationEventObserverTest, OnChangesApplied) {
|
| }
|
| EXPECT_CALL(mock_js_event_handler_,
|
| HandleJsEvent("onChangesApplied",
|
| - HasDetailsAsDictionary(expected_details)));
|
| + HasDetailsAsDictionary(expected_details)));
|
| }
|
|
|
| // Fire OnChangesApplied() for each data type.
|
| for (int i = AUTOFILL_PROFILE; i < MODEL_TYPE_COUNT; ++i) {
|
| ChangeRecordList local_changes(changes + i, changes + arraysize(changes));
|
| js_mutation_event_observer_.OnChangesApplied(
|
| - ModelTypeFromInt(i),
|
| - 0, ImmutableChangeRecordList(&local_changes));
|
| + ModelTypeFromInt(i), 0, ImmutableChangeRecordList(&local_changes));
|
| }
|
|
|
| PumpLoop();
|
| @@ -99,17 +95,15 @@ TEST_F(JsMutationEventObserverTest, OnChangesComplete) {
|
|
|
| for (int i = FIRST_REAL_MODEL_TYPE; i < MODEL_TYPE_COUNT; ++i) {
|
| base::DictionaryValue expected_details;
|
| - expected_details.SetString(
|
| - "modelType",
|
| - ModelTypeToString(ModelTypeFromInt(i)));
|
| + expected_details.SetString("modelType",
|
| + ModelTypeToString(ModelTypeFromInt(i)));
|
| EXPECT_CALL(mock_js_event_handler_,
|
| HandleJsEvent("onChangesComplete",
|
| - HasDetailsAsDictionary(expected_details)));
|
| + HasDetailsAsDictionary(expected_details)));
|
| }
|
|
|
| for (int i = FIRST_REAL_MODEL_TYPE; i < MODEL_TYPE_COUNT; ++i) {
|
| - js_mutation_event_observer_.OnChangesComplete(
|
| - ModelTypeFromInt(i));
|
| + js_mutation_event_observer_.OnChangesComplete(ModelTypeFromInt(i));
|
| }
|
| PumpLoop();
|
| }
|
|
|