Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "base/utf_string_conversions.h" | 5 #include "base/utf_string_conversions.h" |
| 6 #include "testing/gtest/include/gtest/gtest.h" | 6 #include "testing/gtest/include/gtest/gtest.h" |
| 7 #include "webkit/database/database_util.h" | 7 #include "webkit/database/database_util.h" |
| 8 | 8 |
| 9 using webkit_database::DatabaseUtil; | 9 using webkit_database::DatabaseUtil; |
| 10 | 10 |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 TestVfsFilePath(true, "origin/db_name#", "origin", "db_name", ""); | 35 TestVfsFilePath(true, "origin/db_name#", "origin", "db_name", ""); |
| 36 TestVfsFilePath(true, "origin/db_name#suffix", "origin", "db_name", "suffix"); | 36 TestVfsFilePath(true, "origin/db_name#suffix", "origin", "db_name", "suffix"); |
| 37 TestVfsFilePath(false, "origindb_name#"); | 37 TestVfsFilePath(false, "origindb_name#"); |
| 38 TestVfsFilePath(false, "origindb_name#suffix"); | 38 TestVfsFilePath(false, "origindb_name#suffix"); |
| 39 TestVfsFilePath(false, "origin/db_name"); | 39 TestVfsFilePath(false, "origin/db_name"); |
| 40 TestVfsFilePath(false, "origin#db_name/suffix"); | 40 TestVfsFilePath(false, "origin#db_name/suffix"); |
| 41 TestVfsFilePath(false, "/db_name#"); | 41 TestVfsFilePath(false, "/db_name#"); |
| 42 TestVfsFilePath(false, "/db_name#suffix"); | 42 TestVfsFilePath(false, "/db_name#suffix"); |
| 43 } | 43 } |
| 44 | 44 |
| 45 TEST(DatabaseUtilTest, FileOriginIdentifiers) { | |
| 46 const GURL kFileOrigin(GURL("file:///").GetOrigin()); | |
| 47 string16 id = DatabaseUtil::GetOriginIdentifier(kFileOrigin); | |
| 48 GURL origin = DatabaseUtil::GetOriginFromIdentifier(id); | |
| 49 EXPECT_EQ(kFileOrigin, origin); | |
| 50 } | |
|
ericu
2011/05/25 02:38:42
How about a test for an http origin, while you're
michaeln
2011/05/25 03:23:36
Done.
| |
| 51 | |
| 45 } // namespace webkit_database | 52 } // namespace webkit_database |
| OLD | NEW |