OLD | NEW |
1 // Copyright (c) 2008, Google Inc. | 1 // Copyright (c) 2008, Google Inc. |
2 // All rights reserved. | 2 // 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 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 const char url[] = "http://www.google.com/"; | 592 const char url[] = "http://www.google.com/"; |
593 WebCore::KURL src(WebCore::ParsedURLString, url); | 593 WebCore::KURL src(WebCore::ParsedURLString, url); |
594 EXPECT_TRUE(src.string() == url); // This really just initializes the cache. | 594 EXPECT_TRUE(src.string() == url); // This really just initializes the cache. |
595 WebCore::KURL dest = src.copy(); | 595 WebCore::KURL dest = src.copy(); |
596 EXPECT_TRUE(dest.string() == url); // This really just initializes the cache. | 596 EXPECT_TRUE(dest.string() == url); // This really just initializes the cache. |
597 | 597 |
598 // The pointers should be different for both UTF-8 and UTF-16. | 598 // The pointers should be different for both UTF-8 and UTF-16. |
599 EXPECT_NE(dest.string().characters(), src.string().characters()); | 599 EXPECT_NE(dest.string().characters(), src.string().characters()); |
600 EXPECT_NE(dest.utf8String().data(), src.utf8String().data()); | 600 EXPECT_NE(dest.utf8String().data(), src.utf8String().data()); |
601 } | 601 } |
| 602 |
| 603 TEST(GKURL, ProtocolIs) { |
| 604 WebCore::KURL url1(WebCore::ParsedURLString,"foo://bar"); |
| 605 EXPECT_TRUE(url1.protocolIs("foo")); |
| 606 EXPECT_FALSE(url1.protocolIs("foo-bar")); |
| 607 |
| 608 WebCore::KURL url2(WebCore::ParsedURLString,"foo-bar:"); |
| 609 EXPECT_TRUE(url2.protocolIs("foo-bar")); |
| 610 EXPECT_FALSE(url2.protocolIs("foo")); |
| 611 } |
OLD | NEW |