| 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 "sync/sessions/sync_session.h" | 5 #include "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 "base/message_loop.h" |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 scoped_ptr<SyncSession> session(MakeSession()); | 155 scoped_ptr<SyncSession> session(MakeSession()); |
| 156 std::set<ModelSafeGroup> expected_enabled_groups; | 156 std::set<ModelSafeGroup> expected_enabled_groups; |
| 157 expected_enabled_groups.insert(GROUP_PASSIVE); | 157 expected_enabled_groups.insert(GROUP_PASSIVE); |
| 158 expected_enabled_groups.insert(GROUP_UI); | 158 expected_enabled_groups.insert(GROUP_UI); |
| 159 expected_enabled_groups.insert(GROUP_DB); | 159 expected_enabled_groups.insert(GROUP_DB); |
| 160 EXPECT_EQ(expected_enabled_groups, session->GetEnabledGroups()); | 160 EXPECT_EQ(expected_enabled_groups, session->GetEnabledGroups()); |
| 161 } | 161 } |
| 162 | 162 |
| 163 TEST_F(SyncSessionTest, SetWriteTransaction) { | 163 TEST_F(SyncSessionTest, SetWriteTransaction) { |
| 164 TestDirectorySetterUpper dir_maker; | 164 TestDirectorySetterUpper dir_maker; |
| 165 dir_maker.SetUp(); | 165 dir_maker.SetUp(NULL); |
| 166 syncable::Directory* directory = dir_maker.directory(); | 166 syncable::Directory* directory = dir_maker.directory(); |
| 167 | 167 |
| 168 scoped_ptr<SyncSession> session(MakeSession()); | 168 scoped_ptr<SyncSession> session(MakeSession()); |
| 169 EXPECT_TRUE(NULL == session->write_transaction()); | 169 EXPECT_TRUE(NULL == session->write_transaction()); |
| 170 { | 170 { |
| 171 WriteTransaction trans(FROM_HERE, syncable::UNITTEST, directory); | 171 WriteTransaction trans(FROM_HERE, syncable::UNITTEST, directory); |
| 172 sessions::ScopedSetSessionWriteTransaction set_trans(session.get(), &trans); | 172 sessions::ScopedSetSessionWriteTransaction set_trans(session.get(), &trans); |
| 173 EXPECT_TRUE(&trans == session->write_transaction()); | 173 EXPECT_TRUE(&trans == session->write_transaction()); |
| 174 } | 174 } |
| 175 } | 175 } |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 | 433 |
| 434 ASSERT_EQ(3U, invalidation_map.size()); | 434 ASSERT_EQ(3U, invalidation_map.size()); |
| 435 EXPECT_EQ(invalidation_map[BOOKMARKS].payload, payload); | 435 EXPECT_EQ(invalidation_map[BOOKMARKS].payload, payload); |
| 436 EXPECT_EQ(invalidation_map[PASSWORDS].payload, payload); | 436 EXPECT_EQ(invalidation_map[PASSWORDS].payload, payload); |
| 437 EXPECT_EQ(invalidation_map[AUTOFILL].payload, payload); | 437 EXPECT_EQ(invalidation_map[AUTOFILL].payload, payload); |
| 438 } | 438 } |
| 439 | 439 |
| 440 } // namespace | 440 } // namespace |
| 441 } // namespace sessions | 441 } // namespace sessions |
| 442 } // namespace syncer | 442 } // namespace syncer |
| OLD | NEW |