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

Unified Diff: chrome/browser/ui/autofill/autofill_dialog_types_unittest.cc

Issue 23495006: rAc: better Wallet error messages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tests Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/autofill/autofill_dialog_types.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/autofill/autofill_dialog_types_unittest.cc
diff --git a/chrome/browser/ui/autofill/autofill_dialog_types_unittest.cc b/chrome/browser/ui/autofill/autofill_dialog_types_unittest.cc
index d024e18ec188059eda4f3f8de0a26e751293805a..77f480dd03be666faf7cabcb67fe06799a654134 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_types_unittest.cc
+++ b/chrome/browser/ui/autofill/autofill_dialog_types_unittest.cc
@@ -2,6 +2,7 @@
// 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/autofill/autofill_dialog_types.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -17,4 +18,17 @@ TEST(AutofillDialogTypesTest, WarningColorMatches) {
}
#endif
+// Tests for correct parsing of anchor text ranges.
+TEST(AutofillDialogTypesTest, DialogNotificationLink) {
+ base::string16 text(ASCIIToUTF16("Notification without anchor text"));
+ DialogNotification notification(DialogNotification::WALLET_ERROR, text);
+ EXPECT_TRUE(notification.link_range().is_empty());
+
+ text = ASCIIToUTF16("Notification with |anchor text|");
+ notification = DialogNotification(DialogNotification::WALLET_ERROR, text);
+ base::char16 bar = '|';
+ EXPECT_EQ(base::string16::npos, notification.display_text().find(bar));
+ EXPECT_FALSE(notification.link_range().is_empty());
+}
+
} // namespace autofill
« no previous file with comments | « chrome/browser/ui/autofill/autofill_dialog_types.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698