Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: chrome/browser/sync/glue/autofill_model_associator_unittest.cc

Issue 4683003: Sending the proto files for review to unblcok the server team Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "base/string16.h" 5 #include "base/string16.h"
6 #include "base/utf_string_conversions.h" 6 #include "base/utf_string_conversions.h"
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "chrome/browser/sync/glue/autofill_model_associator.h" 8 #include "chrome/browser/sync/glue/autofill_model_associator.h"
9 #include "chrome/browser/sync/glue/autofill_model_associator2.h"
9 10
10 using browser_sync::AutofillModelAssociator; 11 using browser_sync::AutofillModelAssociator;
11 12
12 class AutofillModelAssociatorTest : public testing::Test { 13 class AutofillModelAssociatorTest : public testing::Test {
13 }; 14 };
14 15
15 TEST_F(AutofillModelAssociatorTest, KeyToTag) { 16 TEST_F(AutofillModelAssociatorTest, KeyToTag) {
16 EXPECT_EQ("autofill_entry|foo|bar", 17 EXPECT_EQ("autofill_entry|foo|bar",
17 AutofillModelAssociator::KeyToTag(UTF8ToUTF16("foo"), 18 AutofillModelAssociator::KeyToTag(UTF8ToUTF16("foo"),
18 UTF8ToUTF16("bar"))); 19 UTF8ToUTF16("bar")));
19 EXPECT_EQ("autofill_entry|%7C|%7C", 20 EXPECT_EQ("autofill_entry|%7C|%7C",
20 AutofillModelAssociator::KeyToTag(UTF8ToUTF16("|"), 21 AutofillModelAssociator::KeyToTag(UTF8ToUTF16("|"),
21 UTF8ToUTF16("|"))); 22 UTF8ToUTF16("|")));
22 EXPECT_EQ("autofill_entry|%7C|", 23 EXPECT_EQ("autofill_entry|%7C|",
23 AutofillModelAssociator::KeyToTag(UTF8ToUTF16("|"), 24 AutofillModelAssociator::KeyToTag(UTF8ToUTF16("|"),
24 UTF8ToUTF16(""))); 25 UTF8ToUTF16("")));
25 EXPECT_EQ("autofill_entry||%7C", 26 EXPECT_EQ("autofill_entry||%7C",
26 AutofillModelAssociator::KeyToTag(UTF8ToUTF16(""), 27 AutofillModelAssociator::KeyToTag(UTF8ToUTF16(""),
27 UTF8ToUTF16("|"))); 28 UTF8ToUTF16("|")));
28 } 29 }
29
30 TEST_F(AutofillModelAssociatorTest, ProfileLabelToTag) {
31 string16 label(ASCIIToUTF16("awesome_address"));
32 EXPECT_EQ("autofill_profile|awesome_address",
33 AutofillModelAssociator::ProfileLabelToTag(label));
34
35 EXPECT_EQ("autofill_profile|%7C%7C",
36 AutofillModelAssociator::ProfileLabelToTag(ASCIIToUTF16("||")));
37 EXPECT_NE(AutofillModelAssociator::KeyToTag(ASCIIToUTF16("autofill_profile"),
38 ASCIIToUTF16("home")),
39 AutofillModelAssociator::ProfileLabelToTag(ASCIIToUTF16("home")));
40 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/autofill_model_associator2.cc ('k') | chrome/browser/sync/glue/autofill_profile_change_processor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698