This source file includes following definitions.
- TEST
#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"));
}
}
}