| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "net/base/url_util.h" | 5 #include "net/base/url_util.h" |
| 6 | 6 |
| 7 #include "googleurl/src/gurl.h" | |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 #include "url/gurl.h" |
| 9 | 9 |
| 10 namespace net { | 10 namespace net { |
| 11 namespace { | 11 namespace { |
| 12 | 12 |
| 13 TEST(UrlUtilTest, AppendQueryParameter) { | 13 TEST(UrlUtilTest, AppendQueryParameter) { |
| 14 // Appending a name-value pair to a URL without a query component. | 14 // Appending a name-value pair to a URL without a query component. |
| 15 EXPECT_EQ("http://example.com/path?name=value", | 15 EXPECT_EQ("http://example.com/path?name=value", |
| 16 AppendQueryParameter(GURL("http://example.com/path"), | 16 AppendQueryParameter(GURL("http://example.com/path"), |
| 17 "name", "value").spec()); | 17 "name", "value").spec()); |
| 18 | 18 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 | 95 |
| 96 EXPECT_TRUE(GetValueForKeyInQuery(url, "boolParam", &value)); | 96 EXPECT_TRUE(GetValueForKeyInQuery(url, "boolParam", &value)); |
| 97 EXPECT_EQ("", value); | 97 EXPECT_EQ("", value); |
| 98 | 98 |
| 99 EXPECT_TRUE(GetValueForKeyInQuery(url, "url", &value)); | 99 EXPECT_TRUE(GetValueForKeyInQuery(url, "url", &value)); |
| 100 EXPECT_EQ("http://test.com/q?n1=v1&n2", value); | 100 EXPECT_EQ("http://test.com/q?n1=v1&n2", value); |
| 101 } | 101 } |
| 102 | 102 |
| 103 } // namespace | 103 } // namespace |
| 104 } // namespace net | 104 } // namespace net |
| OLD | NEW |