OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/passwords/manage_passwords_view_utils.h" | 5 #include "chrome/browser/ui/passwords/manage_passwords_view_utils.h" |
6 | 6 |
7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "ui/gfx/range/range.h" | 10 #include "ui/gfx/range/range.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
55 for (size_t i = 0; i < arraysize(test_cases); ++i) { | 55 for (size_t i = 0; i < arraysize(test_cases); ++i) { |
56 SCOPED_TRACE(testing::Message() | 56 SCOPED_TRACE(testing::Message() |
57 << "user_visible_url = " << test_cases[i].user_visible_url | 57 << "user_visible_url = " << test_cases[i].user_visible_url |
58 << ", form_origin_url = " << test_cases[i].form_origin_url); | 58 << ", form_origin_url = " << test_cases[i].form_origin_url); |
59 | 59 |
60 base::string16 title; | 60 base::string16 title; |
61 gfx::Range title_link_range; | 61 gfx::Range title_link_range; |
62 GetSavePasswordDialogTitleTextAndLinkRange( | 62 GetSavePasswordDialogTitleTextAndLinkRange( |
63 GURL(test_cases[i].user_visible_url), | 63 GURL(test_cases[i].user_visible_url), |
64 GURL(test_cases[i].form_origin_url), | 64 GURL(test_cases[i].form_origin_url), |
65 test_cases[i].is_smartlock_branding_enabled, &title, &title_link_range); | 65 test_cases[i].is_smartlock_branding_enabled, false, &title, |
vasilii
2015/07/23 15:15:13
The true value would be also nice to test.
dvadym
2015/07/24 16:42:39
Sure, the tests will be in next PatchSets
| |
66 &title_link_range); | |
66 | 67 |
67 // Verify against expectations. | 68 // Verify against expectations. |
68 EXPECT_TRUE(base::EndsWith( | 69 EXPECT_TRUE(base::EndsWith( |
69 title, base::ASCIIToUTF16(test_cases[i].expected_title_text_ends_with), | 70 title, base::ASCIIToUTF16(test_cases[i].expected_title_text_ends_with), |
70 base::CompareCase::INSENSITIVE_ASCII)); | 71 base::CompareCase::INSENSITIVE_ASCII)); |
71 EXPECT_EQ(test_cases[i].expected_link_range_start, | 72 EXPECT_EQ(test_cases[i].expected_link_range_start, |
72 title_link_range.start()); | 73 title_link_range.start()); |
73 EXPECT_EQ(test_cases[i].expected_link_range_end, title_link_range.end()); | 74 EXPECT_EQ(test_cases[i].expected_link_range_end, title_link_range.end()); |
74 } | 75 } |
75 } | 76 } |
OLD | NEW |