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

Unified Diff: chrome/common/net/url_util_unittest.cc

Issue 10413016: It seems GAIA had changed dosserver rules today, so we can go back to accounts.google.com. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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 | « chrome/common/net/url_util.cc ('k') | chrome/common/url_constants.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/net/url_util_unittest.cc
===================================================================
--- chrome/common/net/url_util_unittest.cc (revision 137977)
+++ chrome/common/net/url_util_unittest.cc (working copy)
@@ -80,4 +80,23 @@
"name", "new").spec());
}
+TEST(BrowserUrlUtilTest, GetValueForKeyInQuery) {
+ GURL url("http://example.com/path?name=value&boolParam&"
+ "url=http://test.com/q?n1%3Dv1%26n2");
+ std::string value;
+
+ // False when getting a non-existent query param.
+ EXPECT_FALSE(GetValueForKeyInQuery(url, "non-exist", &value));
+
+ // True when query param exist.
+ EXPECT_TRUE(GetValueForKeyInQuery(url, "name", &value));
+ EXPECT_EQ("value", value);
+
+ EXPECT_TRUE(GetValueForKeyInQuery(url, "boolParam", &value));
+ EXPECT_EQ("", value);
+
+ EXPECT_TRUE(GetValueForKeyInQuery(url, "url", &value));
+ EXPECT_EQ("http://test.com/q?n1=v1&n2", value);
+}
+
} // namespace chrome_common_net.
Property changes on: chrome/common/net/url_util_unittest.cc
___________________________________________________________________
Added: svn:mergeinfo
« no previous file with comments | « chrome/common/net/url_util.cc ('k') | chrome/common/url_constants.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698