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

Side by Side Diff: chrome/browser/ui/passwords/manage_passwords_bubble_model_unittest.cc

Issue 221853003: Password bubble: Add a test for displayed password length. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 months 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
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698