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

Unified Diff: components/dom_distiller/core/url_utils_unittest.cc

Issue 151003006: Add support for distilling arbitrary URLs in DOM Distiller Viewer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added new strings to iOS whitelist Created 6 years, 10 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 | « components/dom_distiller/core/url_utils.cc ('k') | components/dom_distiller/webui/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/dom_distiller/core/url_utils_unittest.cc
diff --git a/components/dom_distiller/core/url_utils_unittest.cc b/components/dom_distiller/core/url_utils_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..366433f6894edae227efeedd44335a038b5efd74
--- /dev/null
+++ b/components/dom_distiller/core/url_utils_unittest.cc
@@ -0,0 +1,25 @@
+// Copyright 2014 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 "components/dom_distiller/core/url_utils.h"
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace dom_distiller {
+
+namespace url_utils {
+
+TEST(DomDistillerUrlUtilsTest, TestPathUtil) {
+ const std::string single_key = "mypath?foo=bar";
+ EXPECT_EQ("bar", GetValueForKeyInUrlPathQuery(single_key, "foo"));
+ const std::string two_keys = "mypath?key1=foo&key2=bar";
+ EXPECT_EQ("foo", GetValueForKeyInUrlPathQuery(two_keys, "key1"));
+ EXPECT_EQ("bar", GetValueForKeyInUrlPathQuery(two_keys, "key2"));
+ const std::string multiple_same_key = "mypath?key=foo&key=bar";
+ EXPECT_EQ("foo", GetValueForKeyInUrlPathQuery(multiple_same_key, "key"));
+}
+
+} // namespace url_utils
+
+} // namespace dom_distiller
« no previous file with comments | « components/dom_distiller/core/url_utils.cc ('k') | components/dom_distiller/webui/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698