Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Side by Side Diff: webkit/tools/webcore_unit_tests/GKURL_unittest.cpp

Issue 261058: Unit test for https://bugs.webkit.org/show_bug.cgi?id=30262... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698