| Index: chrome/browser/ui/passwords/manage_passwords_bubble_model_unittest.cc
|
| diff --git a/chrome/browser/ui/passwords/manage_passwords_bubble_model_unittest.cc b/chrome/browser/ui/passwords/manage_passwords_bubble_model_unittest.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..4b791f120ccb3973ff7f803c0e5b8ca25c000b17
|
| --- /dev/null
|
| +++ b/chrome/browser/ui/passwords/manage_passwords_bubble_model_unittest.cc
|
| @@ -0,0 +1,40 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "base/strings/utf_string_conversions.h"
|
| +#include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h"
|
| +#include "components/password_manager/core/browser/mock_password_store.h"
|
| +#include "testing/gmock/include/gmock/gmock.h"
|
| +#include "testing/gtest/include/gtest/gtest.h"
|
| +
|
| +class ManagePasswordsBubbleModelTest : public testing::Test {
|
| + protected:
|
| + ManagePasswordsBubbleModelTest() {}
|
| +
|
| + virtual ~ManagePasswordsBubbleModelTest() {}
|
| +
|
| + private:
|
| + DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleModelTest);
|
| +};
|
| +
|
| +namespace {
|
| +
|
| +TEST_F(ManagePasswordsBubbleModelTest, PasswordDisplayStringGeneration) {
|
| + base::string16 test1 = base::WideToUTF16(L"Password");
|
| + base::string16 test2 = base::WideToUTF16(L"Ümläütß");
|
| +
|
| + base::string16 result =
|
| + ManagePasswordsBubbleModel::GetPasswordDisplayString(test1);
|
| + EXPECT_EQ(8UL, result.length());
|
| + EXPECT_EQ(
|
| + base::WideToUTF16(L"\x2022\x2022\x2022\x2022\x2022\x2022\x2022\x2022"),
|
| + result);
|
| +
|
| + result = ManagePasswordsBubbleModel::GetPasswordDisplayString(test2);
|
| + EXPECT_EQ(7UL, result.length());
|
| + EXPECT_EQ(base::WideToUTF16(L"\x2022\x2022\x2022\x2022\x2022\x2022\x2022"),
|
| + result);
|
| +}
|
| +
|
| +} // namespace
|
|
|