| 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 "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
| 6 #include "url/gurl.h" | 6 #include "url/gurl.h" |
| 7 #include "url/url_canon.h" | 7 #include "url/url_canon.h" |
| 8 #include "url/url_test_utils.h" | 8 #include "url/url_test_utils.h" |
| 9 | 9 |
| 10 // Some implementations of base/basictypes.h may define ARRAYSIZE. | 10 // Some implementations of base/basictypes.h may define ARRAYSIZE. |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 TEST(GURLTest, IsStandard) { | 522 TEST(GURLTest, IsStandard) { |
| 523 GURL a("http:foo/bar"); | 523 GURL a("http:foo/bar"); |
| 524 EXPECT_TRUE(a.IsStandard()); | 524 EXPECT_TRUE(a.IsStandard()); |
| 525 | 525 |
| 526 GURL b("foo:bar/baz"); | 526 GURL b("foo:bar/baz"); |
| 527 EXPECT_FALSE(b.IsStandard()); | 527 EXPECT_FALSE(b.IsStandard()); |
| 528 | 528 |
| 529 GURL c("foo://bar/baz"); | 529 GURL c("foo://bar/baz"); |
| 530 EXPECT_FALSE(c.IsStandard()); | 530 EXPECT_FALSE(c.IsStandard()); |
| 531 } | 531 } |
| 532 |
| 533 TEST(GURLTest, SchemeIsHTTPOrHTTPS) { |
| 534 EXPECT_TRUE(GURL("http://bar/").SchemeIsHTTPOrHTTPS()); |
| 535 EXPECT_TRUE(GURL("HTTPS://BAR").SchemeIsHTTPOrHTTPS()); |
| 536 EXPECT_FALSE(GURL("ftp://bar/").SchemeIsHTTPOrHTTPS()); |
| 537 } |
| 538 |
| 539 TEST(GURLTest, SchemeIsWSOrWSS) { |
| 540 EXPECT_TRUE(GURL("WS://BAR/").SchemeIsWSOrWSS()); |
| 541 EXPECT_TRUE(GURL("wss://bar/").SchemeIsWSOrWSS()); |
| 542 EXPECT_FALSE(GURL("http://bar/").SchemeIsWSOrWSS()); |
| 543 } |
| OLD | NEW |