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

Unified Diff: third_party/WebKit/Source/platform/weborigin/KURLTest.cpp

Issue 2270373002: Remove stale comments for blink::decodeURLEscapeSequences() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: a Created 4 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 | « third_party/WebKit/Source/platform/weborigin/KURL.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/weborigin/KURLTest.cpp
diff --git a/third_party/WebKit/Source/platform/weborigin/KURLTest.cpp b/third_party/WebKit/Source/platform/weborigin/KURLTest.cpp
index 2f9bd56ba26b69729db87b8379737497843ce979..b3c0a2a4b50b0bba49197911801c4624ffd6189e 100644
--- a/third_party/WebKit/Source/platform/weborigin/KURLTest.cpp
+++ b/third_party/WebKit/Source/platform/weborigin/KURLTest.cpp
@@ -34,6 +34,7 @@
#include "platform/weborigin/KURL.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "wtf/StdLibExtras.h"
#include "wtf/text/CString.h"
#include "wtf/text/WTFString.h"
@@ -295,6 +296,11 @@ TEST(KURLTest, Decode)
String zero = decodeURLEscapeSequences("%00");
EXPECT_STRNE("%00", zero.utf8().data());
+ // Decode UTF-8.
+ String decoded = decodeURLEscapeSequences("%e6%bc%a2%e5%ad%97");
+ const UChar decodedExpected[] = {0x6F22, 0x5b57};
+ EXPECT_EQ(String(decodedExpected, WTF_ARRAY_LENGTH(decodedExpected)), decoded);
+
// Test the error behavior for invalid UTF-8 (we differ from WebKit here).
String invalid = decodeURLEscapeSequences("%e4%a0%e5%a5%bd");
UChar invalidExpectedHelper[4] = { 0x00e4, 0x00a0, 0x597d, 0 };
« no previous file with comments | « third_party/WebKit/Source/platform/weborigin/KURL.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698