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) { |