| Index: net/tools/dump_cache/url_to_filename_encoder_unittest.cc
|
| diff --git a/net/tools/dump_cache/url_to_filename_encoder_unittest.cc b/net/tools/dump_cache/url_to_filename_encoder_unittest.cc
|
| index 2e09e0b693ec41308edf3427565d823a208a46c2..23bbc6d51895d4eccc8b6d0e440d4afcfec0328b 100644
|
| --- a/net/tools/dump_cache/url_to_filename_encoder_unittest.cc
|
| +++ b/net/tools/dump_cache/url_to_filename_encoder_unittest.cc
|
| @@ -57,7 +57,8 @@ class UrlToFilenameEncoderTest : public ::testing::Test {
|
|
|
| void Validate(const string& in_word, const string& gold_word) {
|
| string escaped_word, url;
|
| - UrlToFilenameEncoder::EncodeSegment("", in_word, '/', &escaped_word);
|
| + UrlToFilenameEncoder::EncodeSegment(
|
| + std::string(), in_word, '/', &escaped_word);
|
| EXPECT_EQ(gold_word, escaped_word);
|
| CheckSegmentLength(escaped_word);
|
| CheckValidChars(escaped_word, '\\');
|
| @@ -67,7 +68,8 @@ class UrlToFilenameEncoderTest : public ::testing::Test {
|
|
|
| void ValidateAllSegmentsSmall(const string& in_word) {
|
| string escaped_word, url;
|
| - UrlToFilenameEncoder::EncodeSegment("", in_word, '/', &escaped_word);
|
| + UrlToFilenameEncoder::EncodeSegment(
|
| + std::string(), in_word, '/', &escaped_word);
|
| CheckSegmentLength(escaped_word);
|
| CheckValidChars(escaped_word, '\\');
|
| UrlToFilenameEncoder::Decode(escaped_word, '/', &url);
|
| @@ -106,13 +108,13 @@ class UrlToFilenameEncoderTest : public ::testing::Test {
|
|
|
| void ValidateUrlOldNew(const string& url, const string& gold_old_filename,
|
| const string& gold_new_filename) {
|
| - ValidateUrl(url, "", true, gold_old_filename);
|
| - ValidateUrl(url, "", false, gold_new_filename);
|
| + ValidateUrl(url, std::string(), true, gold_old_filename);
|
| + ValidateUrl(url, std::string(), false, gold_new_filename);
|
| }
|
|
|
| void ValidateEncodeSame(const string& url1, const string& url2) {
|
| - string filename1 = UrlToFilenameEncoder::Encode(url1, "", false);
|
| - string filename2 = UrlToFilenameEncoder::Encode(url2, "", false);
|
| + string filename1 = UrlToFilenameEncoder::Encode(url1, std::string(), false);
|
| + string filename2 = UrlToFilenameEncoder::Encode(url2, std::string(), false);
|
| EXPECT_EQ(filename1, filename2);
|
| }
|
|
|
| @@ -121,7 +123,7 @@ class UrlToFilenameEncoderTest : public ::testing::Test {
|
| };
|
|
|
| TEST_F(UrlToFilenameEncoderTest, DoesNotEscape) {
|
| - ValidateNoChange("");
|
| + ValidateNoChange(std::string());
|
| ValidateNoChange("abcdefg");
|
| ValidateNoChange("abcdefghijklmnopqrstuvwxyz");
|
| ValidateNoChange("ZYXWVUT");
|
| @@ -193,7 +195,8 @@ TEST_F(UrlToFilenameEncoderTest, EncodeUrlCorrectly) {
|
|
|
| // From bug: Double slash preserved.
|
| ValidateUrl("http://www.foo.com/u?site=http://www.google.com/index.html",
|
| - "", false,
|
| + std::string(),
|
| + false,
|
| "www.foo.com" + dir_sep_ + "u" + escape_ + "3Fsite=http" +
|
| escape_ + "3A" + dir_sep_ + escape_ + "2Fwww.google.com" +
|
| dir_sep_ + "index.html" + escape_);
|
| @@ -326,7 +329,8 @@ TEST_F(UrlToFilenameEncoderTest, BackslashSeparator) {
|
| string long_word;
|
| string escaped_word;
|
| long_word.append(UrlToFilenameEncoder::kMaximumSubdirectoryLength + 1, 'x');
|
| - UrlToFilenameEncoder::EncodeSegment("", long_word, '\\', &escaped_word);
|
| + UrlToFilenameEncoder::EncodeSegment(
|
| + std::string(), long_word, '\\', &escaped_word);
|
|
|
| // check that one backslash, plus the escape ",-", and the ending , got added.
|
| EXPECT_EQ(long_word.size() + 4, escaped_word.size());
|
|
|