| OLD | NEW |
| 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 // Mock ServerConnectionManager class for use in client regression tests. | 5 // Mock ServerConnectionManager class for use in client regression tests. |
| 6 | 6 |
| 7 #include "chrome/browser/sync/test/engine/mock_connection_manager.h" | 7 #include "chrome/browser/sync/test/engine/mock_connection_manager.h" |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 bool is_folder) { | 189 bool is_folder) { |
| 190 if (use_legacy_bookmarks_protocol_) { | 190 if (use_legacy_bookmarks_protocol_) { |
| 191 sync_pb::SyncEntity_BookmarkData* data = entity->mutable_bookmarkdata(); | 191 sync_pb::SyncEntity_BookmarkData* data = entity->mutable_bookmarkdata(); |
| 192 data->set_bookmark_folder(is_folder); | 192 data->set_bookmark_folder(is_folder); |
| 193 | 193 |
| 194 if (!is_folder) { | 194 if (!is_folder) { |
| 195 data->set_bookmark_url("http://google.com"); | 195 data->set_bookmark_url("http://google.com"); |
| 196 } | 196 } |
| 197 } else { | 197 } else { |
| 198 entity->set_folder(is_folder); | 198 entity->set_folder(is_folder); |
| 199 entity->mutable_specifics()->MutableExtension(sync_pb::bookmark); | 199 entity->mutable_specifics()->mutable_bookmark(); |
| 200 if (!is_folder) { | 200 if (!is_folder) { |
| 201 entity->mutable_specifics()->MutableExtension(sync_pb::bookmark)-> | 201 entity->mutable_specifics()->mutable_bookmark()-> |
| 202 set_url("http://google.com"); | 202 set_url("http://google.com"); |
| 203 } | 203 } |
| 204 } | 204 } |
| 205 } | 205 } |
| 206 | 206 |
| 207 SyncEntity* MockConnectionManager::AddUpdateDirectory(int id, | 207 SyncEntity* MockConnectionManager::AddUpdateDirectory(int id, |
| 208 int parent_id, | 208 int parent_id, |
| 209 string name, | 209 string name, |
| 210 int64 version, | 210 int64 version, |
| 211 int64 sync_ts) { | 211 int64 sync_ts) { |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 } | 656 } |
| 657 | 657 |
| 658 void MockConnectionManager::SetServerNotReachable() { | 658 void MockConnectionManager::SetServerNotReachable() { |
| 659 server_status_ = HttpResponse::CONNECTION_UNAVAILABLE; | 659 server_status_ = HttpResponse::CONNECTION_UNAVAILABLE; |
| 660 server_reachable_ = false; | 660 server_reachable_ = false; |
| 661 | 661 |
| 662 FOR_EACH_OBSERVER(ServerConnectionEventListener, listeners_, | 662 FOR_EACH_OBSERVER(ServerConnectionEventListener, listeners_, |
| 663 OnServerConnectionEvent( | 663 OnServerConnectionEvent( |
| 664 ServerConnectionEvent(server_status_, server_reachable_))); | 664 ServerConnectionEvent(server_status_, server_reachable_))); |
| 665 } | 665 } |
| OLD | NEW |