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

Unified Diff: chrome/browser/drive/drive_api_util_unittest.cc

Issue 416223003: Unify HasGDocFileExtension and IsHostedDocumentByExtentoin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | « chrome/browser/drive/drive_api_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/drive/drive_api_util_unittest.cc
diff --git a/chrome/browser/drive/drive_api_util_unittest.cc b/chrome/browser/drive/drive_api_util_unittest.cc
index 7d32a4278a164491137ec2bedfb53540195fc4e5..201fba76ee4d69f2f1c4b5dd29b646ef3b594b68 100644
--- a/chrome/browser/drive/drive_api_util_unittest.cc
+++ b/chrome/browser/drive/drive_api_util_unittest.cc
@@ -164,5 +164,29 @@ TEST(DriveAPIUtilTest, GetMd5Digest) {
EXPECT_EQ(base::MD5String(kTestData), GetMd5Digest(path));
}
+TEST(DriveAPIUtilTest, HasHostedDocumentExtension) {
+ EXPECT_TRUE(
+ HasHostedDocumentExtension(base::FilePath::FromUTF8Unsafe("xx.gdoc")));
+ EXPECT_TRUE(
+ HasHostedDocumentExtension(base::FilePath::FromUTF8Unsafe("xx.gsheet")));
+ EXPECT_TRUE(
+ HasHostedDocumentExtension(base::FilePath::FromUTF8Unsafe("xx.gslides")));
+ EXPECT_TRUE(
+ HasHostedDocumentExtension(base::FilePath::FromUTF8Unsafe("xx.gdraw")));
+ EXPECT_TRUE(
+ HasHostedDocumentExtension(base::FilePath::FromUTF8Unsafe("xx.gtable")));
+ EXPECT_TRUE(
+ HasHostedDocumentExtension(base::FilePath::FromUTF8Unsafe("xx.gform")));
+ EXPECT_TRUE(
+ HasHostedDocumentExtension(base::FilePath::FromUTF8Unsafe("xx.glink")));
hashimoto 2014/07/25 06:19:59 Seems this results in returning false?
kinaba 2014/07/25 06:24:38 Removed the check. It will come back in the next C
+
+ EXPECT_FALSE(
+ HasHostedDocumentExtension(base::FilePath::FromUTF8Unsafe("xx.gdocs")));
+ EXPECT_FALSE(
+ HasHostedDocumentExtension(base::FilePath::FromUTF8Unsafe("xx.docx")));
+ EXPECT_FALSE(
+ HasHostedDocumentExtension(base::FilePath::FromUTF8Unsafe("xx.jpg")));
+}
+
} // namespace util
} // namespace drive
« no previous file with comments | « chrome/browser/drive/drive_api_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698