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 // Unit tests for the SyncApi. Note that a lot of the underlying | 5 // Unit tests for the SyncApi. Note that a lot of the underlying |
6 // functionality is provided by the Syncable layer, which has its own | 6 // functionality is provided by the Syncable layer, which has its own |
7 // unit tests. We'll test SyncApi specific things in this harness. | 7 // unit tests. We'll test SyncApi specific things in this harness. |
8 | 8 |
9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
10 #include "base/scoped_temp_dir.h" | 10 #include "base/scoped_temp_dir.h" |
11 #include "chrome/browser/sync/engine/syncapi.h" | 11 #include "chrome/browser/sync/engine/syncapi.h" |
12 #include "chrome/browser/sync/protocol/password_specifics.pb.h" | 12 #include "chrome/browser/sync/protocol/password_specifics.pb.h" |
13 #include "chrome/browser/sync/syncable/directory_manager.h" | 13 #include "chrome/browser/sync/syncable/directory_manager.h" |
14 #include "chrome/browser/sync/syncable/syncable.h" | 14 #include "chrome/browser/sync/syncable/syncable.h" |
15 #include "chrome/test/sync/engine/test_directory_setter_upper.h" | 15 #include "chrome/test/sync/engine/test_directory_setter_upper.h" |
16 | 16 |
17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
18 | 18 |
19 using browser_sync::KeyParams; | 19 using browser_sync::KeyParams; |
20 | 20 |
21 namespace sync_api { | 21 namespace sync_api { |
22 | 22 |
23 class SyncApiTest : public testing::Test { | 23 class SyncApiTest : public testing::Test { |
24 public: | 24 public: |
25 virtual void SetUp() { | 25 virtual void SetUp() { |
26 setter_upper_.SetUp(); | 26 setter_upper_.SetUp(); |
27 share_.dir_manager.reset(setter_upper_.manager()); | 27 share_.dir_manager.reset(setter_upper_.manager()); |
28 share_.authenticated_name = setter_upper_.name(); | 28 share_.name = setter_upper_.name(); |
29 } | 29 } |
30 | 30 |
31 virtual void TearDown() { | 31 virtual void TearDown() { |
32 // |share_.dir_manager| does not actually own its value. | 32 // |share_.dir_manager| does not actually own its value. |
33 ignore_result(share_.dir_manager.release()); | 33 ignore_result(share_.dir_manager.release()); |
34 setter_upper_.TearDown(); | 34 setter_upper_.TearDown(); |
35 } | 35 } |
36 | 36 |
37 protected: | 37 protected: |
38 UserShare share_; | 38 UserShare share_; |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 ReadNode password_node(&trans); | 258 ReadNode password_node(&trans); |
259 EXPECT_TRUE(password_node.InitByClientTagLookup(syncable::PASSWORDS, | 259 EXPECT_TRUE(password_node.InitByClientTagLookup(syncable::PASSWORDS, |
260 "foo")); | 260 "foo")); |
261 const sync_pb::PasswordSpecificsData& data = | 261 const sync_pb::PasswordSpecificsData& data = |
262 password_node.GetPasswordSpecifics(); | 262 password_node.GetPasswordSpecifics(); |
263 EXPECT_EQ("secret", data.password_value()); | 263 EXPECT_EQ("secret", data.password_value()); |
264 } | 264 } |
265 } | 265 } |
266 | 266 |
267 } // namespace browser_sync | 267 } // namespace browser_sync |
OLD | NEW |