Chromium Code Reviews| 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/engine/syncer_proto_util.h" | 5 #include "chrome/browser/sync/engine/syncer_proto_util.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/message_loop.h" | |
| 11 #include "chrome/browser/sync/engine/syncproto.h" | 12 #include "chrome/browser/sync/engine/syncproto.h" |
| 12 #include "chrome/browser/sync/syncable/blob.h" | 13 #include "chrome/browser/sync/syncable/blob.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/syncable.h" | 15 #include "chrome/browser/sync/syncable/syncable.h" |
| 15 #include "chrome/browser/sync/test/engine/mock_connection_manager.h" | 16 #include "chrome/browser/sync/test/engine/mock_connection_manager.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 | 18 |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| 19 | 20 |
| 20 using syncable::Blob; | 21 using syncable::Blob; |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 130 public: | 131 public: |
| 131 virtual void SetUp() { | 132 virtual void SetUp() { |
| 132 setter_upper_.SetUp(); | 133 setter_upper_.SetUp(); |
| 133 } | 134 } |
| 134 | 135 |
| 135 virtual void TearDown() { | 136 virtual void TearDown() { |
| 136 setter_upper_.TearDown(); | 137 setter_upper_.TearDown(); |
| 137 } | 138 } |
| 138 | 139 |
| 139 protected: | 140 protected: |
| 141 MessageLoop message_loop_; | |
|
Nicolas Zea
2011/11/17 21:35:45
What is this used by?
akalin
2011/11/18 00:04:32
Any test that opens a Transaction uses a WeakHandl
| |
| 140 browser_sync::TestDirectorySetterUpper setter_upper_; | 142 browser_sync::TestDirectorySetterUpper setter_upper_; |
| 141 }; | 143 }; |
| 142 | 144 |
| 143 TEST_F(SyncerProtoUtilTest, VerifyResponseBirthday) { | 145 TEST_F(SyncerProtoUtilTest, VerifyResponseBirthday) { |
| 144 ScopedDirLookup lookup(setter_upper_.manager(), setter_upper_.name()); | 146 ScopedDirLookup lookup(setter_upper_.manager(), setter_upper_.name()); |
| 145 ASSERT_TRUE(lookup.good()); | 147 ASSERT_TRUE(lookup.good()); |
| 146 | 148 |
| 147 // Both sides empty | 149 // Both sides empty |
| 148 EXPECT_TRUE(lookup->store_birthday().empty()); | 150 EXPECT_TRUE(lookup->store_birthday().empty()); |
| 149 ClientToServerResponse response; | 151 ClientToServerResponse response; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 232 dcm.set_send_error(false); | 234 dcm.set_send_error(false); |
| 233 EXPECT_TRUE(SyncerProtoUtil::PostAndProcessHeaders(&dcm, NULL, | 235 EXPECT_TRUE(SyncerProtoUtil::PostAndProcessHeaders(&dcm, NULL, |
| 234 msg, &response)); | 236 msg, &response)); |
| 235 | 237 |
| 236 dcm.set_access_denied(true); | 238 dcm.set_access_denied(true); |
| 237 EXPECT_FALSE(SyncerProtoUtil::PostAndProcessHeaders(&dcm, NULL, | 239 EXPECT_FALSE(SyncerProtoUtil::PostAndProcessHeaders(&dcm, NULL, |
| 238 msg, &response)); | 240 msg, &response)); |
| 239 } | 241 } |
| 240 | 242 |
| 241 } // namespace browser_sync | 243 } // namespace browser_sync |
| OLD | NEW |