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

Unified Diff: chrome/browser/extensions/api/media_galleries_private/media_galleries_watch_apitest.cc

Issue 332003002: Enable gallery watches on Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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/extensions/api/media_galleries_private/media_galleries_private_api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/media_galleries_private/media_galleries_watch_apitest.cc
diff --git a/chrome/browser/extensions/api/media_galleries_private/media_galleries_watch_apitest.cc b/chrome/browser/extensions/api/media_galleries_private/media_galleries_watch_apitest.cc
index 10081e8bb051e3b989a24c95b56f1c677d9421f6..547895aaebc6c6e171221b0eba9102aa75d28a45 100644
--- a/chrome/browser/extensions/api/media_galleries_private/media_galleries_watch_apitest.cc
+++ b/chrome/browser/extensions/api/media_galleries_private/media_galleries_watch_apitest.cc
@@ -27,19 +27,16 @@ namespace {
const char kTestExtensionId[] = "gceegfkgibmgpfopknlcgleimclbknie";
const char kTestExtensionPath[] = "media_galleries_private/gallerywatch";
-#if !defined(OS_CHROMEOS)
vandebo (ex-Chrome) 2014/06/14 00:45:11 We'll see what happens when this comes out...
// JS commands.
const char kGetAllWatchedGalleryIdsCmd[] = "getAllWatchedGalleryIds()";
const char kGetMediaFileSystemsCmd[] = "getMediaFileSystems()";
const char kSetupWatchOnValidGalleriesCmd[] = "setupWatchOnValidGalleries()";
-#if defined(OS_WIN) || defined(OS_LINUX)
const char kAddGalleryChangedListenerCmd[] = "addGalleryChangedListener()";
const char kRemoveAllGalleryWatchCmd[] = "removeAllGalleryWatch()";
const char kRemoveGalleryChangedListenerCmd[] =
"removeGalleryChangedListener()";
const char kRemoveGalleryWatchCmd[] = "removeGalleryWatch()";
const char kSetupWatchOnInvalidGalleryCmd[] = "setupWatchOnInvalidGallery()";
-#endif // defined(OS_WIN) || defined(OS_LINUX)
// And JS reply messages.
const char kAddGalleryWatchOK[] = "add_gallery_watch_ok";
@@ -47,24 +44,19 @@ const char kGetAllGalleryWatchOK[] = "get_all_gallery_watch_ok";
const char kGetMediaFileSystemsCallbackOK[] =
"get_media_file_systems_callback_ok";
const char kGetMediaFileSystemsOK[] = "get_media_file_systems_ok";
-#if defined(OS_WIN) || defined(OS_LINUX)
const char kAddGalleryChangedListenerOK[] = "add_gallery_changed_listener_ok";
const char kRemoveAllGalleryWatchOK[] = "remove_all_gallery_watch_ok";
const char kRemoveGalleryChangedListenerOK[] =
"remove_gallery_changed_listener_ok";
const char kRemoveGalleryWatchOK[] = "remove_gallery_watch_ok";
-#endif // defined(OS_WIN) || defined(OS_LINUX)
// Test reply messages.
const char kGetAllGalleryWatchResultA[] = "gallery_watchers_does_not_exists";
const char kAddGalleryWatchRequestFailed[] = "add_watch_request_failed";
-#if defined(OS_WIN) || defined(OS_LINUX)
const char kAddGalleryWatchRequestSucceeded[] = "add_watch_request_succeeded";
const char kGalleryChangedEventReceived[] = "gallery_changed_event_received";
const char kGetAllGalleryWatchResultB[] =
"watchers_for_galleries_{1, 2, 3}_found";
-#endif // defined(OS_WIN) || defined(OS_LINUX)
-#endif // !defined(OS_CHROMEOS)
} // namespace
@@ -128,8 +120,6 @@ class MediaGalleriesPrivateGalleryWatchApiTest : public ExtensionApiTest {
DISALLOW_COPY_AND_ASSIGN(MediaGalleriesPrivateGalleryWatchApiTest);
};
-
-#if defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS))
IN_PROC_BROWSER_TEST_F(MediaGalleriesPrivateGalleryWatchApiTest,
BasicGalleryWatch) {
EnsureMediaDirectoriesExists media_directories;
@@ -375,56 +365,3 @@ IN_PROC_BROWSER_TEST_F(MediaGalleriesPrivateGalleryWatchApiTest,
kGetAllGalleryWatchOK);
EXPECT_TRUE(final_get_all_check_finished.WaitUntilSatisfied());
}
-#endif // defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS))
-
-#if defined(OS_MACOSX)
-// Gallery watch request is not enabled on Mac: crbug.com/144491.
-IN_PROC_BROWSER_TEST_F(MediaGalleriesPrivateGalleryWatchApiTest,
- SetupGalleryWatch) {
- EnsureMediaDirectoriesExists media_directories;
- content::RenderViewHost* host = GetBackgroundHostForTestExtension();
- ASSERT_TRUE(host);
-
- // Get media file systems.
- ExtensionTestMessageListener get_media_systems_finished(
- kGetMediaFileSystemsCallbackOK, false /* no reply */);
- ExecuteCmdAndCheckReply(host, kGetMediaFileSystemsCmd,
- kGetMediaFileSystemsOK);
- EXPECT_TRUE(get_media_systems_finished.WaitUntilSatisfied());
-
- // Set up a invalid gallery watch.
- ExtensionTestMessageListener gallery_watch_request_finished(
- kAddGalleryWatchRequestFailed, false /* no reply */);
- // Set up gallery watch.
- ExecuteCmdAndCheckReply(host, kSetupWatchOnValidGalleriesCmd,
- kAddGalleryWatchOK);
- EXPECT_TRUE(gallery_watch_request_finished.WaitUntilSatisfied());
-}
-
-IN_PROC_BROWSER_TEST_F(MediaGalleriesPrivateGalleryWatchApiTest,
- GetAllGalleryWatch) {
- EnsureMediaDirectoriesExists media_directories;
- content::RenderViewHost* host = GetBackgroundHostForTestExtension();
- ASSERT_TRUE(host);
-
- // Get media file systems.
- ExtensionTestMessageListener get_media_systems_finished(
- kGetMediaFileSystemsCallbackOK, false /* no reply */);
- ExecuteCmdAndCheckReply(host, kGetMediaFileSystemsCmd,
- kGetMediaFileSystemsOK);
- EXPECT_TRUE(get_media_systems_finished.WaitUntilSatisfied());
-
- // Set up gallery watch.
- ExecuteCmdAndCheckReply(host, kSetupWatchOnValidGalleriesCmd,
- kAddGalleryWatchOK);
-
- // Gallery watchers does not exists.
- // chrome.mediaGalleriesPrivate.getAllGalleryWatch should return an empty
- // list.
- ExtensionTestMessageListener get_all_gallery_watch_finished(
- kGetAllGalleryWatchResultA, false /* no reply */);
- ExecuteCmdAndCheckReply(host, kGetAllWatchedGalleryIdsCmd,
- kGetAllGalleryWatchOK);
- EXPECT_TRUE(get_all_gallery_watch_finished.WaitUntilSatisfied());
-}
-#endif // defined(OS_MACOSX)
« no previous file with comments | « chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698