| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 // Basic tests that verify our KURL's interface behaves the same as the | 31 // Basic tests that verify our KURL's interface behaves the same as the |
| 32 // original KURL's. | 32 // original KURL's. |
| 33 | 33 |
| 34 #include "config.h" | 34 #include "config.h" |
| 35 | 35 |
| 36 #include <gtest/gtest.h> | 36 #include <gtest/gtest.h> |
| 37 | 37 |
| 38 #include "KURL.h" | 38 #include "core/platform/KURL.h" |
| 39 | 39 |
| 40 namespace WTF { | 40 namespace WTF { |
| 41 | 41 |
| 42 // Output stream operator so gTest's macros work with WebCore strings. | 42 // Output stream operator so gTest's macros work with WebCore strings. |
| 43 static std::ostream& operator<<(std::ostream& out, const String& str) | 43 static std::ostream& operator<<(std::ostream& out, const String& str) |
| 44 { | 44 { |
| 45 return str.isEmpty() ? out : out << str.utf8().data(); | 45 return str.isEmpty() ? out : out << str.utf8().data(); |
| 46 } | 46 } |
| 47 | 47 |
| 48 } // namespace WTF | 48 } // namespace WTF |
| (...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 WebCore::KURL url1(WebCore::ParsedURLString, "foo://bar"); | 622 WebCore::KURL url1(WebCore::ParsedURLString, "foo://bar"); |
| 623 EXPECT_TRUE(url1.protocolIs("foo")); | 623 EXPECT_TRUE(url1.protocolIs("foo")); |
| 624 EXPECT_FALSE(url1.protocolIs("foo-bar")); | 624 EXPECT_FALSE(url1.protocolIs("foo-bar")); |
| 625 | 625 |
| 626 WebCore::KURL url2(WebCore::ParsedURLString, "foo-bar:"); | 626 WebCore::KURL url2(WebCore::ParsedURLString, "foo-bar:"); |
| 627 EXPECT_TRUE(url2.protocolIs("foo-bar")); | 627 EXPECT_TRUE(url2.protocolIs("foo-bar")); |
| 628 EXPECT_FALSE(url2.protocolIs("foo")); | 628 EXPECT_FALSE(url2.protocolIs("foo")); |
| 629 } | 629 } |
| 630 | 630 |
| 631 } // namespace | 631 } // namespace |
| OLD | NEW |