| Index: components/password_manager/core/browser/password_ui_utils_unittest.cc
|
| diff --git a/components/password_manager/core/browser/password_ui_utils_unittest.cc b/components/password_manager/core/browser/password_ui_utils_unittest.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..4af70178cee473f122c9c965309d65e17a9a3165
|
| --- /dev/null
|
| +++ b/components/password_manager/core/browser/password_ui_utils_unittest.cc
|
| @@ -0,0 +1,37 @@
|
| +// Copyright 2015 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 "components/password_manager/core/browser/password_ui_utils.h"
|
| +
|
| +#include "testing/gtest/include/gtest/gtest.h"
|
| +
|
| +namespace password_manager {
|
| +
|
| +TEST(GetShownOriginTest, RemovePrefixes) {
|
| + const struct {
|
| + const std::string input;
|
| + const std::string output;
|
| + } kTestCases[] = {
|
| + {"http://subdomain.example.com:80/login/index.html?h=90&ind=hello#first",
|
| + "subdomain.example.com"},
|
| + {"https://www.example.com", "example.com"},
|
| + {"https://mobile.example.com", "example.com"},
|
| + {"https://m.example.com", "example.com"},
|
| + {"https://m.subdomain.example.net", "subdomain.example.net"},
|
| + {"https://mobile.de", "mobile.de"},
|
| + {"https://www.de", "www.de"},
|
| + {"https://m.de", "m.de"},
|
| + {"https://www.mobile.de", "mobile.de"},
|
| + {"https://m.mobile.de", "mobile.de"},
|
| + {"https://m.www.de", "www.de"},
|
| + {"https://Mobile.example.de", "example.de"},
|
| + {"https://WWW.Example.DE", "example.de"}};
|
| +
|
| + for (const auto& test_case : kTestCases) {
|
| + EXPECT_EQ(test_case.output, GetShownOrigin(GURL(test_case.input), ""))
|
| + << "for input " << test_case.input;
|
| + }
|
| +}
|
| +
|
| +} // namespace password_manager
|
|
|