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

Unified Diff: chrome/browser/chromeos/arc/arc_downloads_watcher_service_unittest.cc

Issue 2379323002: arc: Exclude non-media files from Android media scanning. (Closed)
Patch Set: Addressed comments from yusukes. Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/arc/arc_downloads_watcher_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/arc/arc_downloads_watcher_service_unittest.cc
diff --git a/chrome/browser/chromeos/arc/arc_downloads_watcher_service_unittest.cc b/chrome/browser/chromeos/arc/arc_downloads_watcher_service_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..dc69211ddf4b4718ec4c3b0a810c55c7a4ecd919
--- /dev/null
+++ b/chrome/browser/chromeos/arc/arc_downloads_watcher_service_unittest.cc
@@ -0,0 +1,37 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/chromeos/arc/arc_downloads_watcher_service.h"
+
+#include "base/files/file_path.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace arc {
+
+TEST(ArcDownloadsWatcherServiceTest, HasAndroidSupportedMediaExtension) {
+ EXPECT_TRUE(HasAndroidSupportedMediaExtension(
+ base::FilePath(FILE_PATH_LITERAL("/tmp/kitten.3g2"))));
+ EXPECT_TRUE(HasAndroidSupportedMediaExtension(
+ base::FilePath(FILE_PATH_LITERAL("/tmp/kitten.jpg"))));
+ EXPECT_TRUE(HasAndroidSupportedMediaExtension(
+ base::FilePath(FILE_PATH_LITERAL("/tmp/kitten.png"))));
+ EXPECT_TRUE(HasAndroidSupportedMediaExtension(
+ base::FilePath(FILE_PATH_LITERAL("/tmp/kitten.xmf"))));
+
+ EXPECT_TRUE(HasAndroidSupportedMediaExtension(
+ base::FilePath(FILE_PATH_LITERAL("/tmp/kitten.JPEG"))));
+ EXPECT_TRUE(HasAndroidSupportedMediaExtension(
+ base::FilePath(FILE_PATH_LITERAL("/tmp/kitten.cute.jpg"))));
+ EXPECT_TRUE(HasAndroidSupportedMediaExtension(
+ base::FilePath(FILE_PATH_LITERAL("/tmp/.kitten.jpg"))));
+
+ EXPECT_FALSE(HasAndroidSupportedMediaExtension(
+ base::FilePath(FILE_PATH_LITERAL("/tmp/kitten.txt"))));
+ EXPECT_FALSE(HasAndroidSupportedMediaExtension(
+ base::FilePath(FILE_PATH_LITERAL("/tmp/kitten.jpg.exe"))));
+ EXPECT_FALSE(HasAndroidSupportedMediaExtension(
+ base::FilePath(FILE_PATH_LITERAL("/tmp/kitten"))));
+}
+
+} // namespace arc
« no previous file with comments | « chrome/browser/chromeos/arc/arc_downloads_watcher_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698