Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 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 #include "components/sync/test/engine/mock_connection_manager.h" | 5 #include "components/sync/test/engine/mock_connection_manager.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 541 } | 541 } |
| 542 } | 542 } |
| 543 | 543 |
| 544 response->mutable_get_updates()->CopyFrom(*updates); | 544 response->mutable_get_updates()->CopyFrom(*updates); |
| 545 | 545 |
| 546 // Set appropriate progress markers, overriding the value squirreled | 546 // Set appropriate progress markers, overriding the value squirreled |
| 547 // away by ApplyToken(). | 547 // away by ApplyToken(). |
| 548 std::string token = response->get_updates().new_progress_marker(0).token(); | 548 std::string token = response->get_updates().new_progress_marker(0).token(); |
| 549 response->mutable_get_updates()->clear_new_progress_marker(); | 549 response->mutable_get_updates()->clear_new_progress_marker(); |
| 550 for (int i = 0; i < gu.from_progress_marker_size(); ++i) { | 550 for (int i = 0; i < gu.from_progress_marker_size(); ++i) { |
| 551 int data_type_id = gu.from_progress_marker(i).data_type_id(); | |
|
Patrick Noland
2017/06/01 21:34:40
any reason not to just inline this into the EXPECT
skym
2017/06/01 22:43:20
Cause it gets used down below on line 556!
| |
| 552 EXPECT_TRUE(expected_filter_.Has( | |
| 553 GetModelTypeFromSpecificsFieldNumber(data_type_id))); | |
| 551 sync_pb::DataTypeProgressMarker* new_marker = | 554 sync_pb::DataTypeProgressMarker* new_marker = |
| 552 response->mutable_get_updates()->add_new_progress_marker(); | 555 response->mutable_get_updates()->add_new_progress_marker(); |
| 553 new_marker->set_data_type_id(gu.from_progress_marker(i).data_type_id()); | 556 new_marker->set_data_type_id(data_type_id); |
| 554 new_marker->set_token(token); | 557 new_marker->set_token(token); |
| 555 } | 558 } |
| 556 | 559 |
| 557 // Fill the keystore key if requested. | 560 // Fill the keystore key if requested. |
| 558 if (gu.need_encryption_key()) | 561 if (gu.need_encryption_key()) |
| 559 response->mutable_get_updates()->add_encryption_keys(keystore_key_); | 562 response->mutable_get_updates()->add_encryption_keys(keystore_key_); |
| 560 | 563 |
| 561 update_queue_.pop_front(); | 564 update_queue_.pop_front(); |
| 562 | 565 |
| 563 if (gu_client_command_) { | 566 if (gu_client_command_) { |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 764 server_status_ = HttpResponse::SERVER_CONNECTION_OK; | 767 server_status_ = HttpResponse::SERVER_CONNECTION_OK; |
| 765 } | 768 } |
| 766 } | 769 } |
| 767 | 770 |
| 768 void MockConnectionManager::SetServerStatus( | 771 void MockConnectionManager::SetServerStatus( |
| 769 HttpResponse::ServerConnectionCode server_status) { | 772 HttpResponse::ServerConnectionCode server_status) { |
| 770 server_status_ = server_status; | 773 server_status_ = server_status; |
| 771 } | 774 } |
| 772 | 775 |
| 773 } // namespace syncer | 776 } // namespace syncer |
| OLD | NEW |