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

Unified Diff: webkit/database/database_util_unittest.cc

Issue 7053007: We need this work-around for file:/// URIs as (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/database/database_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/database/database_util_unittest.cc
===================================================================
--- webkit/database/database_util_unittest.cc (revision 86470)
+++ webkit/database/database_util_unittest.cc (working copy)
@@ -26,6 +26,11 @@
EXPECT_EQ(ASCIIToUTF16(expected_sqlite_suffix), sqlite_suffix);
}
+static GURL ToAndFromOriginIdentifier(const GURL origin_url) {
+ string16 id = DatabaseUtil::GetOriginIdentifier(origin_url);
+ return DatabaseUtil::GetOriginFromIdentifier(id);
+}
+
namespace webkit_database {
// Test DatabaseUtil::CrackVfsFilePath on various inputs.
@@ -42,4 +47,11 @@
TestVfsFilePath(false, "/db_name#suffix");
}
+TEST(DatabaseUtilTest, OriginIdentifiers) {
+ const GURL kFileOrigin(GURL("file:///").GetOrigin());
+ const GURL kHttpOrigin(GURL("http://bar/").GetOrigin());
+ EXPECT_EQ(kFileOrigin, ToAndFromOriginIdentifier(kFileOrigin));
+ EXPECT_EQ(kHttpOrigin, ToAndFromOriginIdentifier(kHttpOrigin));
+}
+
} // namespace webkit_database
« no previous file with comments | « webkit/database/database_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698