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

Unified Diff: ui/message_center/views/notification_view_unittest.cc

Issue 2127373006: Use base::StartWith() in more places when appropriate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, resolve conflict Created 4 years, 5 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 | « ui/display/chromeos/x11/display_util_x11.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/views/notification_view_unittest.cc
diff --git a/ui/message_center/views/notification_view_unittest.cc b/ui/message_center/views/notification_view_unittest.cc
index fd236177566a897209f85a129827b8e6f3f07db8..cbf4bac709f7424670def1514faf9f70bb8a212e 100644
--- a/ui/message_center/views/notification_view_unittest.cc
+++ b/ui/message_center/views/notification_view_unittest.cc
@@ -7,6 +7,7 @@
#include <memory>
#include "base/macros.h"
+#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkBitmap.h"
@@ -641,10 +642,12 @@ TEST_F(NotificationViewTest, FormatContextMessageTest) {
// The url has been elided (it starts with an ellipsis)
// The end of the domainsuffix is shown
// the url piece is not shown
- EXPECT_TRUE(base::UTF16ToUTF8(result).find(
- ".veryveryveyrylong.chromium.org") != std::string::npos);
- EXPECT_TRUE(base::UTF16ToUTF8(result).find("\xE2\x80\xA6") == 0);
- EXPECT_TRUE(base::UTF16ToUTF8(result).find("hello") == std::string::npos);
+ std::string result_utf8 = base::UTF16ToUTF8(result);
+ EXPECT_TRUE(result_utf8.find(".veryveryveyrylong.chromium.org") !=
+ std::string::npos);
+ EXPECT_TRUE(base::StartsWith(result_utf8, "\xE2\x80\xA6",
+ base::CompareCase::SENSITIVE));
+ EXPECT_TRUE(result_utf8.find("hello") == std::string::npos);
}
TEST_F(NotificationViewTest, SlideOut) {
« no previous file with comments | « ui/display/chromeos/x11/display_util_x11.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698