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 3 // found in the LICENSE file. 4 5 #include "base/string16.h" 6 #include "base/utf_string_conversions.h" 7 #include "testing/gtest/include/gtest/gtest.h" 8 #include "chrome/browser/sync/glue/autofill_model_associator.h" 9 10 using browser_sync::AutofillModelAssociator; 11 12 class AutofillModelAssociatorTest : public testing::Test { 13 }; 14 15 TEST_F(AutofillModelAssociatorTest, KeyToTag) { 16 EXPECT_EQ("autofill_entry|foo|bar", 17 AutofillModelAssociator::KeyToTag(UTF8ToUTF16("foo"), 18 UTF8ToUTF16("bar"))); 19 EXPECT_EQ("autofill_entry|%7C|%7C", 20 AutofillModelAssociator::KeyToTag(UTF8ToUTF16("|"), 21 UTF8ToUTF16("|"))); 22 EXPECT_EQ("autofill_entry|%7C|", 23 AutofillModelAssociator::KeyToTag(UTF8ToUTF16("|"), 24 UTF8ToUTF16(""))); 25 EXPECT_EQ("autofill_entry||%7C", 26 AutofillModelAssociator::KeyToTag(UTF8ToUTF16(""), 27 UTF8ToUTF16("|"))); 28 } 29