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

Side by Side Diff: jingle/notifier/listener/notification_defines_unittest.cc

Issue 16684003: Use a direct include of strings headers in ipc/, jingle/, media/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <string> 5 #include <string>
6 6
7 #include "base/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "jingle/notifier/listener/notification_defines.h" 8 #include "jingle/notifier/listener/notification_defines.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 namespace notifier { 11 namespace notifier {
12 namespace { 12 namespace {
13 13
14 class NotificationTest : public testing::Test {}; 14 class NotificationTest : public testing::Test {};
15 15
16 // Create a notification with binary data in the data field. 16 // Create a notification with binary data in the data field.
17 // Converting it to string shouldn't cause a crash. 17 // Converting it to string shouldn't cause a crash.
18 TEST_F(NotificationTest, BinaryData) { 18 TEST_F(NotificationTest, BinaryData) {
19 const char kNonUtf8Data[] = { '\xff', '\0' }; 19 const char kNonUtf8Data[] = { '\xff', '\0' };
20 EXPECT_FALSE(IsStringUTF8(kNonUtf8Data)); 20 EXPECT_FALSE(IsStringUTF8(kNonUtf8Data));
21 Notification notification; 21 Notification notification;
22 notification.data = kNonUtf8Data; 22 notification.data = kNonUtf8Data;
23 EXPECT_EQ("{ channel: \"\", data: \"\\u00FF\" }", notification.ToString()); 23 EXPECT_EQ("{ channel: \"\", data: \"\\u00FF\" }", notification.ToString());
24 } 24 }
25 25
26 } // namespace 26 } // namespace
27 } // namespace notifier 27 } // namespace notifier
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698