| OLD | NEW |
| 1 // Copyright (c) 2011 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 "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/fake_model_worker.h" | 11 #include "chrome/browser/sync/test/engine/fake_model_worker.h" |
| 12 #include "chrome/browser/sync/test/engine/proto_extension_validator.h" | 12 #include "chrome/browser/sync/test/engine/proto_extension_validator.h" |
| 13 #include "chrome/browser/sync/test/engine/syncer_command_test.h" | 13 #include "chrome/browser/sync/test/engine/syncer_command_test.h" |
| 14 | 14 |
| 15 using ::testing::_; | 15 using ::testing::_; |
| 16 namespace browser_sync { | 16 namespace browser_sync { |
| 17 | 17 |
| 18 using syncable::FIRST_REAL_MODEL_TYPE; | 18 using syncable::FIRST_REAL_MODEL_TYPE; |
| 19 using syncable::MODEL_TYPE_COUNT; | 19 using syncable::MODEL_TYPE_COUNT; |
| 20 | 20 |
| 21 // A test fixture for tests exercising DownloadUpdatesCommandTest. | 21 // A test fixture for tests exercising DownloadUpdatesCommandTest. |
| 22 class DownloadUpdatesCommandTest : public SyncerCommandTest { | 22 class DownloadUpdatesCommandTest : public SyncerCommandTest { |
| 23 protected: | 23 protected: |
| 24 DownloadUpdatesCommandTest() {} | 24 DownloadUpdatesCommandTest() |
| 25 : command_(true /* create_mobile_bookmarks_folder */) {} |
| 25 | 26 |
| 26 virtual void SetUp() { | 27 virtual void SetUp() { |
| 27 workers()->clear(); | 28 workers()->clear(); |
| 28 mutable_routing_info()->clear(); | 29 mutable_routing_info()->clear(); |
| 29 workers()->push_back( | 30 workers()->push_back( |
| 30 make_scoped_refptr(new FakeModelWorker(GROUP_DB))); | 31 make_scoped_refptr(new FakeModelWorker(GROUP_DB))); |
| 31 workers()->push_back( | 32 workers()->push_back( |
| 32 make_scoped_refptr(new FakeModelWorker(GROUP_UI))); | 33 make_scoped_refptr(new FakeModelWorker(GROUP_UI))); |
| 33 (*mutable_routing_info())[syncable::AUTOFILL] = GROUP_DB; | 34 (*mutable_routing_info())[syncable::AUTOFILL] = GROUP_DB; |
| 34 (*mutable_routing_info())[syncable::BOOKMARKS] = GROUP_UI; | 35 (*mutable_routing_info())[syncable::BOOKMARKS] = GROUP_UI; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 EXPECT_CALL(*(mock_debug_info_getter()), GetAndClearDebugInfo(_)) | 67 EXPECT_CALL(*(mock_debug_info_getter()), GetAndClearDebugInfo(_)) |
| 67 .Times(1); | 68 .Times(1); |
| 68 command_.AppendClientDebugInfoIfNeeded(session(), &debug_info); | 69 command_.AppendClientDebugInfoIfNeeded(session(), &debug_info); |
| 69 | 70 |
| 70 // Now try to add it once more and make sure |GetAndClearDebugInfo| is not | 71 // Now try to add it once more and make sure |GetAndClearDebugInfo| is not |
| 71 // called. | 72 // called. |
| 72 command_.AppendClientDebugInfoIfNeeded(session(), &debug_info); | 73 command_.AppendClientDebugInfoIfNeeded(session(), &debug_info); |
| 73 } | 74 } |
| 74 | 75 |
| 75 } // namespace browser_sync | 76 } // namespace browser_sync |
| OLD | NEW |