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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 2235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2246 TestIdFactory factory_; | 2246 TestIdFactory factory_; |
2247 }; | 2247 }; |
2248 | 2248 |
2249 TEST_F(SyncableClientTagTest, TestClientTagClear) { | 2249 TEST_F(SyncableClientTagTest, TestClientTagClear) { |
2250 Id server_id = factory_.NewServerId(); | 2250 Id server_id = factory_.NewServerId(); |
2251 EXPECT_TRUE(CreateWithDefaultTag(server_id, false)); | 2251 EXPECT_TRUE(CreateWithDefaultTag(server_id, false)); |
2252 { | 2252 { |
2253 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get()); | 2253 WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get()); |
2254 MutableEntry me(&trans, GET_BY_CLIENT_TAG, test_tag_); | 2254 MutableEntry me(&trans, GET_BY_CLIENT_TAG, test_tag_); |
2255 EXPECT_TRUE(me.good()); | 2255 EXPECT_TRUE(me.good()); |
2256 me.Put(UNIQUE_CLIENT_TAG, ""); | 2256 me.Put(UNIQUE_CLIENT_TAG, std::string()); |
2257 } | 2257 } |
2258 { | 2258 { |
2259 ReadTransaction trans(FROM_HERE, dir_.get()); | 2259 ReadTransaction trans(FROM_HERE, dir_.get()); |
2260 Entry by_tag(&trans, GET_BY_CLIENT_TAG, test_tag_); | 2260 Entry by_tag(&trans, GET_BY_CLIENT_TAG, test_tag_); |
2261 EXPECT_FALSE(by_tag.good()); | 2261 EXPECT_FALSE(by_tag.good()); |
2262 | 2262 |
2263 Entry by_id(&trans, GET_BY_ID, server_id); | 2263 Entry by_id(&trans, GET_BY_ID, server_id); |
2264 EXPECT_TRUE(by_id.good()); | 2264 EXPECT_TRUE(by_id.good()); |
2265 EXPECT_TRUE(by_id.Get(UNIQUE_CLIENT_TAG).empty()); | 2265 EXPECT_TRUE(by_id.Get(UNIQUE_CLIENT_TAG).empty()); |
2266 } | 2266 } |
(...skipping 27 matching lines...) Expand all Loading... |
2294 EXPECT_TRUE(CreateWithDefaultTag(factory_.NewServerId(), true)); | 2294 EXPECT_TRUE(CreateWithDefaultTag(factory_.NewServerId(), true)); |
2295 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewServerId(), true)); | 2295 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewServerId(), true)); |
2296 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewServerId(), false)); | 2296 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewServerId(), false)); |
2297 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewLocalId(), false)); | 2297 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewLocalId(), false)); |
2298 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewLocalId(), true)); | 2298 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewLocalId(), true)); |
2299 } | 2299 } |
2300 | 2300 |
2301 } // namespace | 2301 } // namespace |
2302 } // namespace syncable | 2302 } // namespace syncable |
2303 } // namespace syncer | 2303 } // namespace syncer |
OLD | NEW |