| OLD | NEW |
| 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 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 const char* expected; | 498 const char* expected; |
| 499 } file_cases[] = { | 499 } file_cases[] = { |
| 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"}, |
| 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 {"http://www.google.com/foo;/bar.html", "bar.html"}, |
| 511 {"http://www.google.com/foo;/", ""}, |
| 512 {"http://www.google.com/foo;", "foo"}, |
| 513 {"http://www.google.com/;", ""}, |
| 514 {"http://www.google.com/foo;bar;html", "foo"}, |
| 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 Loading... |
| 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 |
| OLD | NEW |