OLD | NEW |
| (Empty) |
1 // Copyright 2013 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/autofill/autofill_dialog_types.h" | |
7 #include "testing/gtest/include/gtest/gtest.h" | |
8 | |
9 namespace autofill { | |
10 | |
11 // Tests for correct parsing of anchor text ranges. | |
12 TEST(AutofillDialogTypesTest, DialogNotificationLink) { | |
13 base::string16 text(base::ASCIIToUTF16("Notification without anchor text")); | |
14 DialogNotification notification(DialogNotification::WALLET_ERROR, text); | |
15 EXPECT_TRUE(notification.link_range().is_empty()); | |
16 | |
17 text = base::ASCIIToUTF16("Notification with |anchor text|"); | |
18 notification = DialogNotification(DialogNotification::WALLET_ERROR, text); | |
19 base::char16 bar = '|'; | |
20 EXPECT_EQ(base::string16::npos, notification.display_text().find(bar)); | |
21 EXPECT_FALSE(notification.link_range().is_empty()); | |
22 } | |
23 | |
24 } // namespace autofill | |
OLD | NEW |