Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: components/sync/engine_impl/syncer_proto_util_unittest.cc

Issue 2258873003: [Sync] Move sessions/ to engine/cycle/ and rename things to match. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/sync/engine_impl/syncer_proto_util.h" 5 #include "components/sync/engine_impl/syncer_proto_util.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
11 #include "base/time/time.h" 11 #include "base/time/time.h"
12 #include "components/sync/base/cancelation_signal.h" 12 #include "components/sync/base/cancelation_signal.h"
13 #include "components/sync/base/model_type_test_util.h" 13 #include "components/sync/base/model_type_test_util.h"
14 #include "components/sync/engine_impl/cycle/sync_cycle_context.h"
14 #include "components/sync/protocol/bookmark_specifics.pb.h" 15 #include "components/sync/protocol/bookmark_specifics.pb.h"
15 #include "components/sync/protocol/password_specifics.pb.h" 16 #include "components/sync/protocol/password_specifics.pb.h"
16 #include "components/sync/protocol/sync.pb.h" 17 #include "components/sync/protocol/sync.pb.h"
17 #include "components/sync/protocol/sync_enums.pb.h" 18 #include "components/sync/protocol/sync_enums.pb.h"
18 #include "components/sync/sessions_impl/sync_session_context.h"
19 #include "components/sync/syncable/directory.h" 19 #include "components/sync/syncable/directory.h"
20 #include "components/sync/test/engine/mock_connection_manager.h" 20 #include "components/sync/test/engine/mock_connection_manager.h"
21 #include "components/sync/test/engine/test_directory_setter_upper.h" 21 #include "components/sync/test/engine/test_directory_setter_upper.h"
22 #include "testing/gtest/include/gtest/gtest.h" 22 #include "testing/gtest/include/gtest/gtest.h"
23 23
24 using ::testing::_; 24 using ::testing::_;
25 25
26 using sync_pb::ClientToServerMessage; 26 using sync_pb::ClientToServerMessage;
27 using sync_pb::CommitResponse_EntryResponse; 27 using sync_pb::CommitResponse_EntryResponse;
28 using sync_pb::SyncEntity; 28 using sync_pb::SyncEntity;
29 29
30 namespace syncer { 30 namespace syncer {
31 31
32 using sessions::SyncSessionContext; 32 class MockDelegate : public SyncCycle::Delegate {
33
34 class MockDelegate : public sessions::SyncSession::Delegate {
35 public: 33 public:
36 MockDelegate() {} 34 MockDelegate() {}
37 ~MockDelegate() {} 35 ~MockDelegate() {}
38 36
39 MOCK_METHOD1(OnReceivedShortPollIntervalUpdate, void(const base::TimeDelta&)); 37 MOCK_METHOD1(OnReceivedShortPollIntervalUpdate, void(const base::TimeDelta&));
40 MOCK_METHOD1(OnReceivedLongPollIntervalUpdate, void(const base::TimeDelta&)); 38 MOCK_METHOD1(OnReceivedLongPollIntervalUpdate, void(const base::TimeDelta&));
41 MOCK_METHOD1(OnReceivedSessionsCommitDelay, void(const base::TimeDelta&)); 39 MOCK_METHOD1(OnReceivedSessionsCommitDelay, void(const base::TimeDelta&));
42 MOCK_METHOD1(OnReceivedClientInvalidationHintBufferSize, void(int)); 40 MOCK_METHOD1(OnReceivedClientInvalidationHintBufferSize, void(int));
43 MOCK_METHOD1(OnSyncProtocolError, void(const SyncProtocolError&)); 41 MOCK_METHOD1(OnSyncProtocolError, void(const SyncProtocolError&));
44 }; 42 };
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 dcm.set_send_error(true); 252 dcm.set_send_error(true);
255 EXPECT_FALSE( 253 EXPECT_FALSE(
256 SyncerProtoUtil::PostAndProcessHeaders(&dcm, NULL, msg, &response)); 254 SyncerProtoUtil::PostAndProcessHeaders(&dcm, NULL, msg, &response));
257 255
258 dcm.set_send_error(false); 256 dcm.set_send_error(false);
259 EXPECT_TRUE( 257 EXPECT_TRUE(
260 SyncerProtoUtil::PostAndProcessHeaders(&dcm, NULL, msg, &response)); 258 SyncerProtoUtil::PostAndProcessHeaders(&dcm, NULL, msg, &response));
261 } 259 }
262 260
263 } // namespace syncer 261 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/engine_impl/syncer_proto_util.cc ('k') | components/sync/engine_impl/syncer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698