OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 // Mock ServerConnectionManager class for use in client regression tests. | 5 // Mock ServerConnectionManager class for use in client regression tests. |
6 | 6 |
7 #include "sync/test/engine/mock_connection_manager.h" | 7 #include "sync/test/engine/mock_connection_manager.h" |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 | 10 |
11 #include "base/location.h" | 11 #include "base/location.h" |
12 #include "base/stringprintf.h" | 12 #include "base/stringprintf.h" |
13 #include "sync/engine/syncer_proto_util.h" | 13 #include "sync/engine/syncer_proto_util.h" |
14 #include "sync/test/engine/test_id_factory.h" | 14 #include "sync/test/engine/test_id_factory.h" |
15 #include "sync/protocol/bookmark_specifics.pb.h" | 15 #include "sync/protocol/bookmark_specifics.pb.h" |
16 #include "sync/syncable/directory.h" | 16 #include "sync/syncable/directory.h" |
17 #include "sync/syncable/write_transaction.h" | 17 #include "sync/syncable/syncable_write_transaction.h" |
18 #include "sync/test/engine/test_id_factory.h" | 18 #include "sync/test/engine/test_id_factory.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
20 | 20 |
21 using std::map; | 21 using std::map; |
22 using std::string; | 22 using std::string; |
23 using sync_pb::ClientToServerMessage; | 23 using sync_pb::ClientToServerMessage; |
24 using sync_pb::CommitMessage; | 24 using sync_pb::CommitMessage; |
25 using sync_pb::CommitResponse; | 25 using sync_pb::CommitResponse; |
26 using sync_pb::GetUpdatesMessage; | 26 using sync_pb::GetUpdatesMessage; |
27 using sync_pb::SyncEnums; | 27 using sync_pb::SyncEnums; |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 | 612 |
613 void MockConnectionManager::UpdateConnectionStatus() { | 613 void MockConnectionManager::UpdateConnectionStatus() { |
614 if (!server_reachable_) { | 614 if (!server_reachable_) { |
615 server_status_ = HttpResponse::CONNECTION_UNAVAILABLE; | 615 server_status_ = HttpResponse::CONNECTION_UNAVAILABLE; |
616 } else { | 616 } else { |
617 server_status_ = HttpResponse::SERVER_CONNECTION_OK; | 617 server_status_ = HttpResponse::SERVER_CONNECTION_OK; |
618 } | 618 } |
619 } | 619 } |
620 | 620 |
621 } // namespace syncer | 621 } // namespace syncer |
OLD | NEW |