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: third_party/WebKit/Source/core/dom/URLSearchParamsTest.cpp

Issue 1456553002: Support 'URLSearchParams' as the body of a Request (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@URLSearchParams
Patch Set: Feedback Created 5 years, 1 month 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
Index: third_party/WebKit/Source/core/dom/URLSearchParamsTest.cpp
diff --git a/third_party/WebKit/Source/core/dom/URLSearchParamsTest.cpp b/third_party/WebKit/Source/core/dom/URLSearchParamsTest.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..9f883473b4073e9a393a895d3fbcfdff8f952297
--- /dev/null
+++ b/third_party/WebKit/Source/core/dom/URLSearchParamsTest.cpp
@@ -0,0 +1,26 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+#include "core/dom/URLSearchParams.h"
+
+#include <gtest/gtest.h>
+
+namespace blink {
+
+using URLSearchParamsTest = ::testing::Test;
+
+TEST_F(URLSearchParamsTest, EncodedFormData)
+{
+ URLSearchParams* params = new URLSearchParams(String());
+ EXPECT_EQ("", params->encodeFormData()->flattenToString());
+
+ params->append("name", "value");
+ EXPECT_EQ("name=value", params->encodeFormData()->flattenToString());
+
+ params->append("another name", "another value");
+ EXPECT_EQ("name=value&another+name=another+value", params->encodeFormData()->flattenToString());
+}
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/dom/URLSearchParams.cpp ('k') | third_party/WebKit/Source/modules/fetch/RequestInit.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698