| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/sessions/sync_session.h" | 5 #include "chrome/browser/sync/sessions/sync_session.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/message_loop.h" |
| 10 #include "chrome/browser/sync/engine/conflict_resolver.h" | 11 #include "chrome/browser/sync/engine/conflict_resolver.h" |
| 11 #include "chrome/browser/sync/engine/mock_model_safe_workers.h" | 12 #include "chrome/browser/sync/engine/mock_model_safe_workers.h" |
| 12 #include "chrome/browser/sync/engine/syncer_types.h" | 13 #include "chrome/browser/sync/engine/syncer_types.h" |
| 13 #include "chrome/browser/sync/syncable/directory_manager.h" | 14 #include "chrome/browser/sync/syncable/directory_manager.h" |
| 14 #include "chrome/browser/sync/syncable/model_type.h" | 15 #include "chrome/browser/sync/syncable/model_type.h" |
| 15 #include "chrome/browser/sync/syncable/syncable.h" | 16 #include "chrome/browser/sync/syncable/syncable.h" |
| 16 #include "chrome/browser/sync/test/engine/test_directory_setter_upper.h" | 17 #include "chrome/browser/sync/test/engine/test_directory_setter_upper.h" |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 18 | 19 |
| 19 using syncable::WriteTransaction; | 20 using syncable::WriteTransaction; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 request_params[syncable::AUTOFILL] = true; | 95 request_params[syncable::AUTOFILL] = true; |
| 95 return request_params; | 96 return request_params; |
| 96 } | 97 } |
| 97 | 98 |
| 98 syncable::ModelTypeBitSet ParamsMeaningJustOneEnabledType() { | 99 syncable::ModelTypeBitSet ParamsMeaningJustOneEnabledType() { |
| 99 syncable::ModelTypeBitSet request_params; | 100 syncable::ModelTypeBitSet request_params; |
| 100 request_params[syncable::AUTOFILL] = true; | 101 request_params[syncable::AUTOFILL] = true; |
| 101 return request_params; | 102 return request_params; |
| 102 } | 103 } |
| 103 | 104 |
| 105 MessageLoop message_loop_; |
| 104 bool controller_invocations_allowed_; | 106 bool controller_invocations_allowed_; |
| 105 scoped_ptr<SyncSession> session_; | 107 scoped_ptr<SyncSession> session_; |
| 106 scoped_ptr<SyncSessionContext> context_; | 108 scoped_ptr<SyncSessionContext> context_; |
| 107 ModelSafeRoutingInfo routes_; | 109 ModelSafeRoutingInfo routes_; |
| 108 }; | 110 }; |
| 109 | 111 |
| 110 TEST_F(SyncSessionTest, ScopedContextHelpers) { | 112 TEST_F(SyncSessionTest, ScopedContextHelpers) { |
| 111 ConflictResolver resolver; | 113 ConflictResolver resolver; |
| 112 EXPECT_FALSE(context_->resolver()); | 114 EXPECT_FALSE(context_->resolver()); |
| 113 { | 115 { |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 EXPECT_EQ(empty_payload, original[syncable::BOOKMARKS]); | 478 EXPECT_EQ(empty_payload, original[syncable::BOOKMARKS]); |
| 477 EXPECT_EQ(payload1, original[syncable::PASSWORDS]); | 479 EXPECT_EQ(payload1, original[syncable::PASSWORDS]); |
| 478 EXPECT_EQ(payload1, original[syncable::AUTOFILL]); | 480 EXPECT_EQ(payload1, original[syncable::AUTOFILL]); |
| 479 EXPECT_EQ(payload2, original[syncable::SESSIONS]); | 481 EXPECT_EQ(payload2, original[syncable::SESSIONS]); |
| 480 EXPECT_EQ(payload3, original[syncable::THEMES]); | 482 EXPECT_EQ(payload3, original[syncable::THEMES]); |
| 481 } | 483 } |
| 482 | 484 |
| 483 } // namespace | 485 } // namespace |
| 484 } // namespace sessions | 486 } // namespace sessions |
| 485 } // namespace browser_sync | 487 } // namespace browser_sync |
| OLD | NEW |