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

Side by Side Diff: third_party/WebKit/Source/platform/exported/WebStringTest.cpp

Issue 2796233002: Rewrite references to "wtf/" to "platform/wtf/" in platform/exported. (Closed)
Patch Set: Created 3 years, 8 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
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "public/platform/WebString.h" 5 #include "public/platform/WebString.h"
6 6
7 #include "platform/wtf/text/WTFString.h"
7 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
8 #include "wtf/text/WTFString.h"
9 9
10 namespace blink { 10 namespace blink {
11 11
12 TEST(WebStringTest, UTF8ConversionRoundTrip) { 12 TEST(WebStringTest, UTF8ConversionRoundTrip) {
13 // Valid characters. 13 // Valid characters.
14 for (UChar uchar = 0; uchar <= 0xD7FF; ++uchar) { 14 for (UChar uchar = 0; uchar <= 0xD7FF; ++uchar) {
15 WebString utf16String(&uchar, 1); 15 WebString utf16String(&uchar, 1);
16 std::string utf8String(utf16String.utf8()); 16 std::string utf8String(utf16String.utf8());
17 WebString utf16NewString = 17 WebString utf16NewString =
18 WebString::fromUTF8(utf8String.data(), utf8String.length()); 18 WebString::fromUTF8(utf8String.data(), utf8String.length());
(...skipping 22 matching lines...) Expand all
41 WebString::UTF8ConversionMode::kStrictReplacingErrorsWithFFFD); 41 WebString::UTF8ConversionMode::kStrictReplacingErrorsWithFFFD);
42 EXPECT_FALSE(utf8String.empty()); 42 EXPECT_FALSE(utf8String.empty());
43 utf16NewString = 43 utf16NewString =
44 WebString::fromUTF8(utf8String.data(), utf8String.length()); 44 WebString::fromUTF8(utf8String.data(), utf8String.length());
45 EXPECT_FALSE(utf16NewString.isNull()); 45 EXPECT_FALSE(utf16NewString.isNull());
46 EXPECT_FALSE(utf16String == utf16NewString); 46 EXPECT_FALSE(utf16String == utf16NewString);
47 } 47 }
48 } 48 }
49 49
50 } // namespace blink 50 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/exported/WebString.cpp ('k') | third_party/WebKit/Source/platform/exported/WebURL.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698