OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/sync/engine/download_updates_command.h" | 5 #include "chrome/browser/sync/engine/download_updates_command.h" |
6 #include "chrome/browser/sync/protocol/autofill_specifics.pb.h" | 6 #include "chrome/browser/sync/protocol/autofill_specifics.pb.h" |
7 #include "chrome/browser/sync/protocol/bookmark_specifics.pb.h" | 7 #include "chrome/browser/sync/protocol/bookmark_specifics.pb.h" |
8 #include "chrome/browser/sync/protocol/preference_specifics.pb.h" | 8 #include "chrome/browser/sync/protocol/preference_specifics.pb.h" |
9 #include "chrome/browser/sync/protocol/sync.pb.h" | 9 #include "chrome/browser/sync/protocol/sync.pb.h" |
10 #include "chrome/browser/sync/syncable/directory_manager.h" | 10 #include "chrome/browser/sync/syncable/directory_manager.h" |
11 #include "chrome/browser/sync/test/engine/proto_extension_validator.h" | 11 #include "chrome/browser/sync/test/engine/proto_extension_validator.h" |
12 #include "chrome/browser/sync/test/engine/syncer_command_test.h" | 12 #include "chrome/browser/sync/test/engine/syncer_command_test.h" |
13 | 13 |
| 14 using ::testing::_; |
14 namespace browser_sync { | 15 namespace browser_sync { |
15 | 16 |
16 using syncable::FIRST_REAL_MODEL_TYPE; | 17 using syncable::FIRST_REAL_MODEL_TYPE; |
17 using syncable::MODEL_TYPE_COUNT; | 18 using syncable::MODEL_TYPE_COUNT; |
18 | 19 |
19 // A test fixture for tests exercising DownloadUpdatesCommandTest. | 20 // A test fixture for tests exercising DownloadUpdatesCommandTest. |
20 class DownloadUpdatesCommandTest : public SyncerCommandTest { | 21 class DownloadUpdatesCommandTest : public SyncerCommandTest { |
21 protected: | 22 protected: |
22 DownloadUpdatesCommandTest() {} | 23 DownloadUpdatesCommandTest() {} |
23 | 24 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 SetRoutingInfo(types); | 126 SetRoutingInfo(types); |
126 sessions::SyncSourceInfo source; | 127 sessions::SyncSourceInfo source; |
127 source.types[syncable::AUTOFILL] = "autofill_payload"; | 128 source.types[syncable::AUTOFILL] = "autofill_payload"; |
128 source.types[syncable::BOOKMARKS] = "bookmark_payload"; | 129 source.types[syncable::BOOKMARKS] = "bookmark_payload"; |
129 source.types[syncable::PREFERENCES] = "preferences_payload"; | 130 source.types[syncable::PREFERENCES] = "preferences_payload"; |
130 mock_server()->ExpectGetUpdatesRequestTypes(ModelTypeBitSetFromSet(types)); | 131 mock_server()->ExpectGetUpdatesRequestTypes(ModelTypeBitSetFromSet(types)); |
131 mock_server()->ExpectGetUpdatesRequestPayloads(source.types); | 132 mock_server()->ExpectGetUpdatesRequestPayloads(source.types); |
132 command_.ExecuteImpl(session(source)); | 133 command_.ExecuteImpl(session(source)); |
133 } | 134 } |
134 | 135 |
| 136 TEST_F(DownloadUpdatesCommandTest, VerifyAppendDebugInfo) { |
| 137 sync_pb::DebugInfo debug_info; |
| 138 EXPECT_CALL(*(mock_debug_info_getter()), GetAndClearDebugInfo(_)) |
| 139 .Times(1); |
| 140 command_.AppendClientDebugInfoIfNeeded(session(), &debug_info); |
| 141 |
| 142 // Now try to add it once more and make sure |GetAndClearDebugInfo| is not |
| 143 // called. |
| 144 command_.AppendClientDebugInfoIfNeeded(session(), &debug_info); |
| 145 } |
| 146 |
135 } // namespace browser_sync | 147 } // namespace browser_sync |
OLD | NEW |