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

Side by Side Diff: url/url_parse_unittest.cc

Issue 560283003: Wrong filename on file upload (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added unit testcases and modified code accordingly Created 6 years, 3 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 unified diff | Download patch
OLDNEW
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 "url/url_parse.h" 5 #include "url/url_parse.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "url/url_parse.h" 9 #include "url/url_parse.h"
10 10
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 {"http://www.google.com", NULL}, 500 {"http://www.google.com", NULL},
501 {"http://www.google.com/", ""}, 501 {"http://www.google.com/", ""},
502 {"http://www.google.com/search", "search"}, 502 {"http://www.google.com/search", "search"},
503 {"http://www.google.com/search/", ""}, 503 {"http://www.google.com/search/", ""},
504 {"http://www.google.com/foo/bar.html?baz=22", "bar.html"}, 504 {"http://www.google.com/foo/bar.html?baz=22", "bar.html"},
505 {"http://www.google.com/foo/bar.html#ref", "bar.html"}, 505 {"http://www.google.com/foo/bar.html#ref", "bar.html"},
506 {"http://www.google.com/search/;param", ""}, 506 {"http://www.google.com/search/;param", ""},
507 {"http://www.google.com/foo/bar.html;param#ref", "bar.html"}, 507 {"http://www.google.com/foo/bar.html;param#ref", "bar.html"},
508 {"http://www.google.com/foo/bar.html;foo;param#ref", "bar.html;foo"}, 508 {"http://www.google.com/foo/bar.html;foo;param#ref", "bar.html;foo"},
509 {"http://www.google.com/foo/bar.html?query#ref", "bar.html"}, 509 {"http://www.google.com/foo/bar.html?query#ref", "bar.html"},
510 // Test cases added to verify Issue - 323156
brettw 2014/09/16 22:37:10 I don't think you need this comment. Can you add s
arun87.kumar 2014/09/17 11:39:12 Done.
511 {"http://www.google.com/foo;/bar.html", "bar.html"},
512 {"http://www.google.com/foo;/", ""},
513 {"http://www.google.com/foo;", "foo"},
514 {"http://www.google.com/;", ""},
510 }; 515 };
511 516
512 for (size_t i = 0; i < ARRAYSIZE(file_cases); i++) { 517 for (size_t i = 0; i < ARRAYSIZE(file_cases); i++) {
513 const char* url = file_cases[i].input; 518 const char* url = file_cases[i].input;
514 int len = static_cast<int>(strlen(url)); 519 int len = static_cast<int>(strlen(url));
515 520
516 Parsed parsed; 521 Parsed parsed;
517 ParseStandardURL(url, len, &parsed); 522 ParseStandardURL(url, len, &parsed);
518 523
519 Component file_name; 524 Component file_name;
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 // The remaining components are never used for filesystem urls. 686 // The remaining components are never used for filesystem urls.
682 ExpectInvalidComponent(parsed.username); 687 ExpectInvalidComponent(parsed.username);
683 ExpectInvalidComponent(parsed.password); 688 ExpectInvalidComponent(parsed.password);
684 ExpectInvalidComponent(parsed.host); 689 ExpectInvalidComponent(parsed.host);
685 ExpectInvalidComponent(parsed.port); 690 ExpectInvalidComponent(parsed.port);
686 } 691 }
687 } 692 }
688 693
689 } // namespace 694 } // namespace
690 } // namespace url 695 } // namespace url
OLDNEW
« url/third_party/mozilla/url_parse.cc ('K') | « url/third_party/mozilla/url_parse.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698