Lines Matching +full:test +full:- +full:static +full:- +full:rel
2 // Use of this source code is governed by a BSD-style license that can be
13 #include "testing/gtest/include/gtest/gtest-message.h"
22 class URLUtilTest : public testing::Test {
101 static const char kFooScheme[] = "foo"; in TEST_F()
110 static const char kFooScheme[] = "foo"; in TEST_F()
162 replacements.SetRef("test", Component(0, 4)); in TEST_F()
167 replacements.SetHost("test", Component(0, 4)); in TEST_F()
181 static std::string CheckReplaceScheme(const char* base_url, in CheckReplaceScheme()
243 " !\"#$%&'()*+,-.//"}, in TEST_F()
286 // Test the error behavior for invalid UTF-8. in TEST_F()
292 // %e5%a5%bd is a valid UTF-8 sequence. U+597D in TEST_F()
329 {" !\"#$%&'()*+,-./", in TEST_F()
330 "%20!%22%23%24%25%26%27()*%2B%2C-.%2F"}, in TEST_F()
352 // This tests non-standard (in the sense that IsStandard() == false) in TEST_F()
356 const char* rel; in TEST_F() member
360 // Resolving a relative path against a non-hierarchical URL should fail. in TEST_F()
362 // Resolving a relative path against a non-standard authority-based base in TEST_F()
365 // A non-standard hierarchical base is resolved with path URL in TEST_F()
372 // Path URL canonicalization rules also apply to non-standard authority- in TEST_F()
386 // rules, even though the base was non-standard. in TEST_F()
393 // Fragment URLs can be resolved against a non-standard base. in TEST_F()
398 // Resolving should fail if the base URL is authority-based but is in TEST_F()
401 // Test resolving a fragment (only) against any kind of base-URL. in TEST_F()
411 // non-standard URL, but they will be treated as a path separators, in TEST_F()
420 for (const auto& test : resolve_non_standard_cases) { in TEST_F() local
422 << "base: " << test.base << ", rel: " << test.rel); in TEST_F()
425 ParsePathURL(test.base, strlen(test.base), false, &base_parsed); in TEST_F()
431 ResolveRelative(test.base, strlen(test.base), base_parsed, test.rel, in TEST_F()
432 strlen(test.rel), nullptr, &output, &resolved_parsed); in TEST_F()
435 EXPECT_EQ(test.is_valid, valid); in TEST_F()
436 if (test.is_valid && valid) { in TEST_F()
437 EXPECT_EQ(test.out, resolved); in TEST_F()
443 // The hash-mark must be ignored when mailto: scheme is parsed, in TEST_F()
446 const char* rel = "any#body"; in TEST_F() local
455 bool valid = ResolveRelative(base, strlen(base), base_parsed, rel, in TEST_F()
456 strlen(rel), nullptr, &output, &resolved_parsed); in TEST_F()
464 const char* rel; in TEST_F() member
489 for (const auto& test : cases) { in TEST_F() local
490 SCOPED_TRACE(::testing::Message() << test.base << ", " << test.rel); in TEST_F()
492 ParseStandardURL(test.base, strlen(test.base), &base_parsed); in TEST_F()
498 ResolveRelative(test.base, strlen(test.base), base_parsed, test.rel, in TEST_F()
499 strlen(test.rel), nullptr, &output, &resolved_parsed); in TEST_F()
503 EXPECT_EQ(test.potentially_dangling_markup, in TEST_F()
505 EXPECT_EQ(test.out, resolved); in TEST_F()
559 {"www.google.com", "Google.com", false}, // The input is not lower-cased. in TEST_F()
607 // Regression test for https://crbug.com/1252658.
609 auto PrefixWithNUL = [](std::string&& s) -> std::string { return '\0' + s; }; in TEST_F()
657 {"\xC2\xA3", false}, // UTF-8 encoded '£'. in TEST_F()
661 {"Here: [%25] <-- a percent-encoded percent character.", false}, in TEST_F()
663 // Valid %-escaped sequences ('%' followed by two hex digits). in TEST_F()
694 {"%\xC2\xA3", true}, //% followed by UTF-8 encoded '£'. in TEST_F()
696 // String ends on a potential escape sequence but without two hex-digits in TEST_F()
703 // One hex and one non-hex digit is invalid. in TEST_F()
709 {"%-1", true}, in TEST_F()
710 {"%1-", true}, in TEST_F()