OLD | NEW |
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 |
OLD | NEW |