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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "url/third_party/mozilla/url_parse.h" | 9 #include "url/third_party/mozilla/url_parse.h" |
10 #include "url/url_canon.h" | 10 #include "url/url_canon.h" |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
410 SCOPED_TRACE(testing::Message() << "(host, domain): (" | 410 SCOPED_TRACE(testing::Message() << "(host, domain): (" |
411 << test_case.canonicalized_host << ", " | 411 << test_case.canonicalized_host << ", " |
412 << test_case.lower_ascii_domain << ")"); | 412 << test_case.lower_ascii_domain << ")"); |
413 | 413 |
414 EXPECT_EQ( | 414 EXPECT_EQ( |
415 test_case.expected_domain_is, | 415 test_case.expected_domain_is, |
416 DomainIs(test_case.canonicalized_host, test_case.lower_ascii_domain)); | 416 DomainIs(test_case.canonicalized_host, test_case.lower_ascii_domain)); |
417 } | 417 } |
418 } | 418 } |
419 | 419 |
420 TEST(URLUtilTest, IsAboutBlank) { | |
421 const std::string kAboutBlankURLS[] = {"about:blank", "about:blank?foo", | |
Charlie Reis
2017/01/20 20:31:02
Minor nit: Lowercase s at the end (kAboutBlankURLs
clamy
2017/01/23 12:26:27
Done.
| |
422 "about:blank/#foo", | |
423 "about:blank?foo#foo"}; | |
424 for (const auto& url : kAboutBlankURLS) | |
425 EXPECT_TRUE(IsAboutBlank(GURL(url))); | |
426 | |
427 const std::string kNotAboutBlankURLS[] = { | |
428 "http:blank", "about:blan", "about://blank", | |
429 "about:blank/foo", "about://:8000/blank", "about://foo:foo@/blank"}; | |
Charlie Reis
2017/01/20 20:31:02
A few more to add:
foo@about:blank
foo:bar@about:b
clamy
2017/01/23 12:26:27
Done.
| |
430 for (const auto& url : kNotAboutBlankURLS) | |
431 EXPECT_FALSE(IsAboutBlank(GURL(url))); | |
432 } | |
433 | |
420 } // namespace url | 434 } // namespace url |
OLD | NEW |