| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2014 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/strings/utf_string_conversions.h" |
| 6 #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h" |
| 7 #include "components/password_manager/core/browser/mock_password_store.h" |
| 8 #include "testing/gmock/include/gmock/gmock.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 |
| 11 class ManagePasswordsBubbleModelTest : public testing::Test { |
| 12 protected: |
| 13 ManagePasswordsBubbleModelTest() {} |
| 14 |
| 15 virtual ~ManagePasswordsBubbleModelTest() {} |
| 16 |
| 17 private: |
| 18 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleModelTest); |
| 19 }; |
| 20 |
| 21 namespace { |
| 22 |
| 23 TEST_F(ManagePasswordsBubbleModelTest, PasswordDisplayStringGeneration) { |
| 24 base::string16 test1 = base::WideToUTF16(L"Password"); |
| 25 base::string16 test2 = base::WideToUTF16(L"Ümläütß"); |
| 26 |
| 27 base::string16 result = |
| 28 ManagePasswordsBubbleModel::GetPasswordDisplayString(test1); |
| 29 EXPECT_EQ(8UL, result.length()); |
| 30 EXPECT_EQ( |
| 31 base::WideToUTF16(L"\x2022\x2022\x2022\x2022\x2022\x2022\x2022\x2022"), |
| 32 result); |
| 33 |
| 34 result = ManagePasswordsBubbleModel::GetPasswordDisplayString(test2); |
| 35 EXPECT_EQ(7UL, result.length()); |
| 36 EXPECT_EQ(base::WideToUTF16(L"\x2022\x2022\x2022\x2022\x2022\x2022\x2022"), |
| 37 result); |
| 38 } |
| 39 |
| 40 } // namespace |
| OLD | NEW |