| 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/gurl.h" | 9 #include "url/gurl.h" |
| 10 #include "url/url_canon.h" | 10 #include "url/url_canon.h" |
| (...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 | 653 |
| 654 TEST(GURLTest, IsStandard) { | 654 TEST(GURLTest, IsStandard) { |
| 655 GURL a("http:foo/bar"); | 655 GURL a("http:foo/bar"); |
| 656 EXPECT_TRUE(a.IsStandard()); | 656 EXPECT_TRUE(a.IsStandard()); |
| 657 | 657 |
| 658 GURL b("foo:bar/baz"); | 658 GURL b("foo:bar/baz"); |
| 659 EXPECT_FALSE(b.IsStandard()); | 659 EXPECT_FALSE(b.IsStandard()); |
| 660 | 660 |
| 661 GURL c("foo://bar/baz"); | 661 GURL c("foo://bar/baz"); |
| 662 EXPECT_FALSE(c.IsStandard()); | 662 EXPECT_FALSE(c.IsStandard()); |
| 663 |
| 664 GURL d("cid:bar@baz"); |
| 665 EXPECT_FALSE(d.IsStandard()); |
| 663 } | 666 } |
| 664 | 667 |
| 665 TEST(GURLTest, SchemeIsHTTPOrHTTPS) { | 668 TEST(GURLTest, SchemeIsHTTPOrHTTPS) { |
| 666 EXPECT_TRUE(GURL("http://bar/").SchemeIsHTTPOrHTTPS()); | 669 EXPECT_TRUE(GURL("http://bar/").SchemeIsHTTPOrHTTPS()); |
| 667 EXPECT_TRUE(GURL("HTTPS://BAR").SchemeIsHTTPOrHTTPS()); | 670 EXPECT_TRUE(GURL("HTTPS://BAR").SchemeIsHTTPOrHTTPS()); |
| 668 EXPECT_FALSE(GURL("ftp://bar/").SchemeIsHTTPOrHTTPS()); | 671 EXPECT_FALSE(GURL("ftp://bar/").SchemeIsHTTPOrHTTPS()); |
| 669 } | 672 } |
| 670 | 673 |
| 671 TEST(GURLTest, SchemeIsWSOrWSS) { | 674 TEST(GURLTest, SchemeIsWSOrWSS) { |
| 672 EXPECT_TRUE(GURL("WS://BAR/").SchemeIsWSOrWSS()); | 675 EXPECT_TRUE(GURL("WS://BAR/").SchemeIsWSOrWSS()); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 699 }; | 702 }; |
| 700 | 703 |
| 701 for (const auto& test : cases) { | 704 for (const auto& test : cases) { |
| 702 GURL url(test.url); | 705 GURL url(test.url); |
| 703 EXPECT_EQ(test.expected, url.path()) << test.url; | 706 EXPECT_EQ(test.expected, url.path()) << test.url; |
| 704 EXPECT_EQ(test.expected, url.GetContent()) << test.url; | 707 EXPECT_EQ(test.expected, url.GetContent()) << test.url; |
| 705 } | 708 } |
| 706 } | 709 } |
| 707 | 710 |
| 708 } // namespace url | 711 } // namespace url |
| OLD | NEW |