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

Side by Side Diff: third_party/WebKit/Source/core/dom/URLSearchParamsTest.cpp

Issue 1998563002: Fix URLSearchParams to use the right encoding algorithm (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "core/dom/URLSearchParams.h" 5 #include "core/dom/URLSearchParams.h"
6 6
7 #include <gtest/gtest.h> 7 #include <gtest/gtest.h>
8 8
9 namespace blink { 9 namespace blink {
10 10
11 using URLSearchParamsTest = ::testing::Test; 11 using URLSearchParamsTest = ::testing::Test;
12 12
13 TEST_F(URLSearchParamsTest, EncodedFormData) 13 TEST_F(URLSearchParamsTest, ToEncodedFormData)
14 { 14 {
15 URLSearchParams* params = new URLSearchParams(String()); 15 URLSearchParams* params = URLSearchParams::create(String());
16 EXPECT_EQ("", params->encodeFormData()->flattenToString()); 16 EXPECT_EQ("", params->toEncodedFormData()->flattenToString());
17 17
18 params->append("name", "value"); 18 params->append("name", "value");
19 EXPECT_EQ("name=value", params->encodeFormData()->flattenToString()); 19 EXPECT_EQ("name=value", params->toEncodedFormData()->flattenToString());
20 20
21 params->append("another name", "another value"); 21 params->append("another name", "another value");
22 EXPECT_EQ("name=value&another+name=another+value", params->encodeFormData()- >flattenToString()); 22 EXPECT_EQ("name=value&another+name=another+value", params->toEncodedFormData ()->flattenToString());
23 } 23 }
24 24
25 } // namespace blink 25 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/URLSearchParams.cpp ('k') | third_party/WebKit/Source/core/loader/FormSubmission.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698