Skip to content

Commit

Permalink
Delete remaining references to legacy Sync Directory
Browse files Browse the repository at this point in the history
This cleans up a few minor leftovers that continue to reference the
legacy Sync Directory, about to be deleted from the codebase.

Change-Id: I583b07038f13f648d5c47e8aea2ed0a36edbe93e
Bug: 923287
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2267037
Commit-Queue: Mikel Astiz <mastiz@chromium.org>
Reviewed-by: Maksim Moskvitin <mmoskvitin@google.com>
Cr-Commit-Position: refs/heads/master@{#783843}
  • Loading branch information
Mikel Astiz authored and Commit Bot committed Jun 30, 2020
1 parent 7ca3ce6 commit 4fd187a
Show file tree
Hide file tree
Showing 18 changed files with 63 additions and 286 deletions.
1 change: 0 additions & 1 deletion chrome/browser/sync/glue/DEPS
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
include_rules = [
"-components/sync/engine",
"-components/sync/sessions",
"-components/sync/syncable",
]
1 change: 0 additions & 1 deletion chrome/browser/sync/test/integration/sessions_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "chrome/browser/sync/test/integration/multi_client_status_change_checker.h"
#include "chrome/browser/sync/test/integration/sync_test.h"
#include "components/sessions/core/session_types.h"
#include "components/sync/syncable/nigori_util.h"
#include "components/sync_sessions/synced_session.h"

class GURL;
Expand Down

This file was deleted.

3 changes: 0 additions & 3 deletions chrome/browser/sync/test/integration/typed_urls_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
#include "components/history/core/browser/history_database.h"
#include "components/history/core/browser/history_db_task.h"
#include "components/history/core/browser/history_service.h"
#include "components/sync/syncable/read_node.h"
#include "components/sync/syncable/read_transaction.h"
#include "components/sync/syncable/user_share.h"

using sync_datatype_helper::test;

Expand Down
1 change: 0 additions & 1 deletion chrome/test/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -6446,7 +6446,6 @@ if (!is_fuchsia && !is_android) {
"../browser/sync/test/integration/single_client_custom_passphrase_sync_test.cc",
"../browser/sync/test/integration/single_client_device_info_sync_test.cc",
"../browser/sync/test/integration/single_client_dictionary_sync_test.cc",
"../browser/sync/test/integration/single_client_directory_sync_test.cc",
"../browser/sync/test/integration/single_client_extension_apps_sync_test.cc",
"../browser/sync/test/integration/single_client_extensions_sync_test.cc",
"../browser/sync/test/integration/single_client_history_delete_directives_sync_test.cc",
Expand Down
9 changes: 0 additions & 9 deletions components/sync/driver/profile_sync_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/rand_util.h"
#include "base/run_loop.h"
#include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "base/threading/thread.h"
Expand Down Expand Up @@ -1963,14 +1962,6 @@ void ProfileSyncService::SetPassphrasePrompted(bool prompted) {
sync_prefs_.SetPassphrasePrompted(prompted);
}

void ProfileSyncService::FlushBackendTaskRunnerForTest() const {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
base::RunLoop run_loop;

backend_task_runner_->PostTask(FROM_HERE, run_loop.QuitClosure());
run_loop.Run();
}

SyncEncryptionHandler::Observer*
ProfileSyncService::GetEncryptionObserverForTest() {
return &crypto_;
Expand Down
3 changes: 0 additions & 3 deletions components/sync/driver/profile_sync_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,6 @@ class ProfileSyncService : public SyncService,

bool IsDataTypeControllerRunningForTest(ModelType type) const;

// Sometimes we need to wait for tasks on the |backend_task_runner_| in tests.
void FlushBackendTaskRunnerForTest() const;

// Some tests rely on injecting calls to the encryption observer.
SyncEncryptionHandler::Observer* GetEncryptionObserverForTest();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// found in the LICENSE file.

#include "components/sync/engine_impl/cycle/sync_cycle.h"
#include "components/sync/test/engine/test_id_factory.h"
#include "net/http/http_status_code.h"
#include "testing/gtest/include/gtest/gtest.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "components/sync/engine_impl/syncer_proto_util.h"
#include "components/sync/protocol/sync.pb.h"
#include "components/sync/protocol/sync_enums.pb.h"
#include "components/sync/test/engine/test_directory_setter_upper.h"
#include "testing/gtest/include/gtest/gtest.h"

using sync_pb::ClientToServerMessage;
Expand Down
1 change: 0 additions & 1 deletion components/sync/engine_impl/sync_manager_impl_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
#include "components/sync/test/callback_counter.h"
#include "components/sync/test/engine/fake_model_worker.h"
#include "components/sync/test/engine/fake_sync_scheduler.h"
#include "components/sync/test/engine/test_id_factory.h"
#include "components/sync/test/fake_sync_encryption_handler.h"
#include "services/network/test/test_network_connection_tracker.h"
#include "testing/gmock/include/gmock/gmock.h"
Expand Down
74 changes: 34 additions & 40 deletions components/sync/engine_impl/syncer_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -392,13 +392,13 @@ TEST_F(SyncerTest, GetUpdatesPartialThrottled) {
const sync_pb::EntitySpecifics pref = MakeSpecifics(PREFERENCES);

// Normal sync, all the data types should get synced.
mock_server_->AddUpdateSpecifics(1, 0, "A", 10, 10, true, 0, bookmark,
mock_server_->AddUpdateSpecifics("1", "0", "A", 10, 10, true, 0, bookmark,
foreign_cache_guid(), "-1");
mock_server_->AddUpdateSpecifics(2, 1, "B", 10, 10, false, 2, bookmark,
mock_server_->AddUpdateSpecifics("2", "1", "B", 10, 10, false, 2, bookmark,
foreign_cache_guid(), "-2");
mock_server_->AddUpdateSpecifics(3, 1, "C", 10, 10, false, 1, bookmark,
mock_server_->AddUpdateSpecifics("3", "1", "C", 10, 10, false, 1, bookmark,
foreign_cache_guid(), "-3");
mock_server_->AddUpdateSpecifics(4, 0, "D", 10, 10, false, 0, pref);
mock_server_->AddUpdateSpecifics("4", "0", "D", 10, 10, false, 0, pref);

EXPECT_TRUE(SyncShareNudge());
// Initial state. Everything is normal.
Expand All @@ -413,13 +413,13 @@ TEST_F(SyncerTest, GetUpdatesPartialThrottled) {
mock_server_->set_throttling(true);
mock_server_->SetPartialFailureTypes(throttled_types);

mock_server_->AddUpdateSpecifics(1, 0, "E", 20, 20, true, 0, bookmark,
mock_server_->AddUpdateSpecifics("1", "0", "E", 20, 20, true, 0, bookmark,
foreign_cache_guid(), "-1");
mock_server_->AddUpdateSpecifics(2, 1, "F", 20, 20, false, 2, bookmark,
mock_server_->AddUpdateSpecifics("2", "1", "F", 20, 20, false, 2, bookmark,
foreign_cache_guid(), "-2");
mock_server_->AddUpdateSpecifics(3, 1, "G", 20, 20, false, 1, bookmark,
mock_server_->AddUpdateSpecifics("3", "1", "G", 20, 20, false, 1, bookmark,
foreign_cache_guid(), "-3");
mock_server_->AddUpdateSpecifics(4, 0, "H", 20, 20, false, 0, pref);
mock_server_->AddUpdateSpecifics("4", "0", "H", 20, 20, false, 0, pref);
EXPECT_TRUE(SyncShareNudge());

// PREFERENCES continues to work normally (not throttled).
Expand All @@ -430,13 +430,13 @@ TEST_F(SyncerTest, GetUpdatesPartialThrottled) {
// Unthrottled BOOKMARKS, then BOOKMARKS should get synced now.
mock_server_->set_throttling(false);

mock_server_->AddUpdateSpecifics(1, 0, "E", 30, 30, true, 0, bookmark,
mock_server_->AddUpdateSpecifics("1", "0", "E", 30, 30, true, 0, bookmark,
foreign_cache_guid(), "-1");
mock_server_->AddUpdateSpecifics(2, 1, "F", 30, 30, false, 2, bookmark,
mock_server_->AddUpdateSpecifics("2", "1", "F", 30, 30, false, 2, bookmark,
foreign_cache_guid(), "-2");
mock_server_->AddUpdateSpecifics(3, 1, "G", 30, 30, false, 1, bookmark,
mock_server_->AddUpdateSpecifics("3", "1", "G", 30, 30, false, 1, bookmark,
foreign_cache_guid(), "-3");
mock_server_->AddUpdateSpecifics(4, 0, "H", 30, 30, false, 0, pref);
mock_server_->AddUpdateSpecifics("4", "0", "H", 30, 30, false, 0, pref);
EXPECT_TRUE(SyncShareNudge());
// BOOKMARKS unthrottled.
EXPECT_EQ(2U, GetProcessor(BOOKMARKS)->GetNumUpdateResponses());
Expand All @@ -447,13 +447,13 @@ TEST_F(SyncerTest, GetUpdatesPartialFailure) {
const sync_pb::EntitySpecifics pref = MakeSpecifics(PREFERENCES);

// Normal sync, all the data types should get synced.
mock_server_->AddUpdateSpecifics(1, 0, "A", 10, 10, true, 0, bookmark,
mock_server_->AddUpdateSpecifics("1", "0", "A", 10, 10, true, 0, bookmark,
foreign_cache_guid(), "-1");
mock_server_->AddUpdateSpecifics(2, 1, "B", 10, 10, false, 2, bookmark,
mock_server_->AddUpdateSpecifics("2", "1", "B", 10, 10, false, 2, bookmark,
foreign_cache_guid(), "-2");
mock_server_->AddUpdateSpecifics(3, 1, "C", 10, 10, false, 1, bookmark,
mock_server_->AddUpdateSpecifics("3", "1", "C", 10, 10, false, 1, bookmark,
foreign_cache_guid(), "-3");
mock_server_->AddUpdateSpecifics(4, 0, "D", 10, 10, false, 0, pref);
mock_server_->AddUpdateSpecifics("4", "0", "D", 10, 10, false, 0, pref);

EXPECT_TRUE(SyncShareNudge());
// Initial state. Everything is normal.
Expand All @@ -468,13 +468,13 @@ TEST_F(SyncerTest, GetUpdatesPartialFailure) {
mock_server_->set_partial_failure(true);
mock_server_->SetPartialFailureTypes(failed_types);

mock_server_->AddUpdateSpecifics(1, 0, "E", 20, 20, true, 0, bookmark,
mock_server_->AddUpdateSpecifics("1", "0", "E", 20, 20, true, 0, bookmark,
foreign_cache_guid(), "-1");
mock_server_->AddUpdateSpecifics(2, 1, "F", 20, 20, false, 2, bookmark,
mock_server_->AddUpdateSpecifics("2", "1", "F", 20, 20, false, 2, bookmark,
foreign_cache_guid(), "-2");
mock_server_->AddUpdateSpecifics(3, 1, "G", 20, 20, false, 1, bookmark,
mock_server_->AddUpdateSpecifics("3", "1", "G", 20, 20, false, 1, bookmark,
foreign_cache_guid(), "-3");
mock_server_->AddUpdateSpecifics(4, 0, "H", 20, 20, false, 0, pref);
mock_server_->AddUpdateSpecifics("4", "0", "H", 20, 20, false, 0, pref);
EXPECT_TRUE(SyncShareNudge());

// PREFERENCES continues to work normally (not throttled).
Expand All @@ -485,13 +485,13 @@ TEST_F(SyncerTest, GetUpdatesPartialFailure) {
// Set BOOKMARKS not partial failed, then BOOKMARKS should get synced now.
mock_server_->set_partial_failure(false);

mock_server_->AddUpdateSpecifics(1, 0, "E", 30, 30, true, 0, bookmark,
mock_server_->AddUpdateSpecifics("1", "0", "E", 30, 30, true, 0, bookmark,
foreign_cache_guid(), "-1");
mock_server_->AddUpdateSpecifics(2, 1, "F", 30, 30, false, 2, bookmark,
mock_server_->AddUpdateSpecifics("2", "1", "F", 30, 30, false, 2, bookmark,
foreign_cache_guid(), "-2");
mock_server_->AddUpdateSpecifics(3, 1, "G", 30, 30, false, 1, bookmark,
mock_server_->AddUpdateSpecifics("3", "1", "G", 30, 30, false, 1, bookmark,
foreign_cache_guid(), "-3");
mock_server_->AddUpdateSpecifics(4, 0, "H", 30, 30, false, 0, pref);
mock_server_->AddUpdateSpecifics("4", "0", "H", 30, 30, false, 0, pref);
EXPECT_TRUE(SyncShareNudge());
// BOOKMARKS not failed.
EXPECT_EQ(2U, GetProcessor(BOOKMARKS)->GetNumUpdateResponses());
Expand All @@ -509,10 +509,8 @@ TEST_F(SyncerTest, TestSimpleCommit) {
MakeSpecifics(PREFERENCES), kSyncId2);

EXPECT_TRUE(SyncShareNudge());
EXPECT_THAT(
mock_server_->committed_ids(),
UnorderedElementsAre(syncable::Id::CreateFromClientString(kSyncId1),
syncable::Id::CreateFromClientString(kSyncId2)));
EXPECT_THAT(mock_server_->committed_ids(),
UnorderedElementsAre(kSyncId1, kSyncId2));
}

TEST_F(SyncerTest, TestSimpleGetUpdates) {
Expand Down Expand Up @@ -804,8 +802,8 @@ TEST_F(SyncerTest, TestClientCommandDuringUpdate) {
GetSpecificsFieldNumberFromModelType(BOOKMARKS));
bookmark_delay->set_delay_ms(950);
command->set_client_invalidation_hint_buffer_size(11);
mock_server_->AddUpdateDirectory(1, 0, "in_root", 1, 1, foreign_cache_guid(),
"-1");
mock_server_->AddUpdateDirectory("1", "0", "in_root", 1, 1,
foreign_cache_guid(), "-1");
mock_server_->SetGUClientCommand(std::move(command));
EXPECT_TRUE(SyncShareNudge());

Expand All @@ -824,8 +822,8 @@ TEST_F(SyncerTest, TestClientCommandDuringUpdate) {
GetSpecificsFieldNumberFromModelType(BOOKMARKS));
bookmark_delay->set_delay_ms(1050);
command->set_client_invalidation_hint_buffer_size(9);
mock_server_->AddUpdateDirectory(1, 0, "in_root", 1, 1, foreign_cache_guid(),
"-1");
mock_server_->AddUpdateDirectory("1", "0", "in_root", 1, 1,
foreign_cache_guid(), "-1");
mock_server_->SetGUClientCommand(std::move(command));
EXPECT_TRUE(SyncShareNudge());

Expand Down Expand Up @@ -882,7 +880,7 @@ TEST_F(SyncerTest, TestClientCommandDuringCommit) {
}

TEST_F(SyncerTest, ClientTagServerCreatedUpdatesWork) {
mock_server_->AddUpdateDirectory(1, 0, "permitem1", 1, 10,
mock_server_->AddUpdateDirectory("1", "0", "permitem1", 1, 10,
foreign_cache_guid(), "-1");
mock_server_->SetLastUpdateClientTag("clienttag");

Expand Down Expand Up @@ -941,9 +939,7 @@ TEST_F(SyncerTest, UpdateThenCommit) {

// The sync cycle should have included a GetUpdate, then a commit.
EXPECT_TRUE(mock_server_->last_request().has_commit());
EXPECT_THAT(
mock_server_->committed_ids(),
UnorderedElementsAre(syncable::Id::CreateFromClientString(to_commit)));
EXPECT_THAT(mock_server_->committed_ids(), UnorderedElementsAre(to_commit));

// The update should have been received.
ASSERT_EQ(1U, GetProcessor(BOOKMARKS)->GetNumUpdateResponses());
Expand Down Expand Up @@ -1125,13 +1121,11 @@ TEST_P(MixedResult, ExtensionsActivity) {
"bookmarkid2");

if (ShouldFailBookmarkCommit()) {
mock_server_->SetTransientErrorId(
syncable::Id::CreateFromClientString("bookmarkid2"));
mock_server_->SetTransientErrorId("bookmarkid2");
}

if (ShouldFailAutofillCommit()) {
mock_server_->SetTransientErrorId(
syncable::Id::CreateFromClientString("prefid1"));
mock_server_->SetTransientErrorId("prefid1");
}

// Put some extensions activity records into the monitor.
Expand Down
Loading

0 comments on commit 4fd187a

Please sign in to comment.