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

Unified Diff: chrome/browser/chromeos/extensions/file_manager/file_manager_notifications_unittest.cc

Issue 14020002: chromeos: Move chrome/browser/chromeos/extensions/file_browser* to chrome/browser/chromeos/file_man… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename classes/files Created 7 years, 8 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
Index: chrome/browser/chromeos/extensions/file_manager/file_manager_notifications_unittest.cc
diff --git a/chrome/browser/chromeos/extensions/file_browser_notifications_unittest.cc b/chrome/browser/chromeos/extensions/file_manager/file_manager_notifications_unittest.cc
similarity index 64%
rename from chrome/browser/chromeos/extensions/file_browser_notifications_unittest.cc
rename to chrome/browser/chromeos/extensions/file_manager/file_manager_notifications_unittest.cc
index 3fbf4cc20b63dcefe4c772e495ece0c040aa893c..68a390044b6b09237b7613e2c792b58e31d72c93 100644
--- a/chrome/browser/chromeos/extensions/file_browser_notifications_unittest.cc
+++ b/chrome/browser/chromeos/extensions/file_manager/file_manager_notifications_unittest.cc
@@ -7,8 +7,8 @@
#include <string>
#include "base/utf_string_conversions.h"
+#include "chrome/browser/chromeos/extensions/file_manager/file_manager_notifications.h"
#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/chromeos/extensions/file_browser_notifications.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
@@ -22,13 +22,13 @@ namespace chromeos {
namespace {
-class MockFileBrowserNotificationsOnMount : public FileBrowserNotifications {
+class MockFileManagerNotificationsOnMount : public FileManagerNotifications {
public:
- explicit MockFileBrowserNotificationsOnMount(Profile* profile)
- : FileBrowserNotifications(profile) {
+ explicit MockFileManagerNotificationsOnMount(Profile* profile)
+ : FileManagerNotifications(profile) {
}
- virtual ~MockFileBrowserNotificationsOnMount() {}
+ virtual ~MockFileManagerNotificationsOnMount() {}
MOCK_METHOD3(ShowNotificationWithMessage, void(NotificationType,
const std::string&, const string16&));
@@ -41,10 +41,10 @@ MATCHER_P2(String16Equals, id, label, "") {
} // namespace
-TEST(FileBrowserMountNotificationsTest, GoodDevice) {
- MockFileBrowserNotificationsOnMount* mocked_notifications =
- new MockFileBrowserNotificationsOnMount(NULL);
- scoped_ptr<FileBrowserNotifications> notifications(mocked_notifications);
+TEST(FileManagerMountNotificationsTest, GoodDevice) {
+ MockFileManagerNotificationsOnMount* mocked_notifications =
+ new MockFileManagerNotificationsOnMount(NULL);
+ scoped_ptr<FileManagerNotifications> notifications(mocked_notifications);
std::string notification_path("system_path_prefix");
std::string device_label("label");
@@ -52,16 +52,16 @@ TEST(FileBrowserMountNotificationsTest, GoodDevice) {
notifications->RegisterDevice(notification_path);
EXPECT_CALL(*mocked_notifications, HideNotification(
- FileBrowserNotifications::DEVICE, StrEq(notification_path)));
+ FileManagerNotifications::DEVICE, StrEq(notification_path)));
notifications->ManageNotificationsOnMountCompleted(notification_path,
device_label, true, true, false);
};
-TEST(FileBrowserMountNotificationsTest, GoodDeviceWithBadParent) {
- MockFileBrowserNotificationsOnMount* mocked_notifications =
- new MockFileBrowserNotificationsOnMount(NULL);
- scoped_ptr<FileBrowserNotifications> notifications(mocked_notifications);
+TEST(FileManagerMountNotificationsTest, GoodDeviceWithBadParent) {
+ MockFileManagerNotificationsOnMount* mocked_notifications =
+ new MockFileManagerNotificationsOnMount(NULL);
+ scoped_ptr<FileManagerNotifications> notifications(mocked_notifications);
std::string notification_path("system_path_prefix");
std::string device_label("label");
@@ -69,15 +69,15 @@ TEST(FileBrowserMountNotificationsTest, GoodDeviceWithBadParent) {
notifications->RegisterDevice(notification_path);
EXPECT_CALL(*mocked_notifications, HideNotification(
- FileBrowserNotifications::DEVICE, StrEq(notification_path)));
+ FileManagerNotifications::DEVICE, StrEq(notification_path)));
{
InSequence s;
EXPECT_CALL(*mocked_notifications, ShowNotificationWithMessage(
- FileBrowserNotifications::DEVICE_FAIL, StrEq(notification_path), _));
+ FileManagerNotifications::DEVICE_FAIL, StrEq(notification_path), _));
EXPECT_CALL(*mocked_notifications, HideNotification(
- FileBrowserNotifications::DEVICE_FAIL,
+ FileManagerNotifications::DEVICE_FAIL,
StrEq(notification_path)));
}
@@ -89,10 +89,10 @@ TEST(FileBrowserMountNotificationsTest, GoodDeviceWithBadParent) {
device_label, false, true, false);
}
-TEST(FileBrowserMountNotificationsTest, UnsupportedDevice) {
- MockFileBrowserNotificationsOnMount* mocked_notifications =
- new MockFileBrowserNotificationsOnMount(NULL);
- scoped_ptr<FileBrowserNotifications> notifications(mocked_notifications);
+TEST(FileManagerMountNotificationsTest, UnsupportedDevice) {
+ MockFileManagerNotificationsOnMount* mocked_notifications =
+ new MockFileManagerNotificationsOnMount(NULL);
+ scoped_ptr<FileManagerNotifications> notifications(mocked_notifications);
std::string notification_path("system_path_prefix");
std::string device_label("label");
@@ -100,19 +100,19 @@ TEST(FileBrowserMountNotificationsTest, UnsupportedDevice) {
notifications->RegisterDevice(notification_path);
EXPECT_CALL(*mocked_notifications, HideNotification(
- FileBrowserNotifications::DEVICE, StrEq(notification_path)));
+ FileManagerNotifications::DEVICE, StrEq(notification_path)));
EXPECT_CALL(*mocked_notifications, ShowNotificationWithMessage(
- FileBrowserNotifications::DEVICE_FAIL, StrEq(notification_path),
+ FileManagerNotifications::DEVICE_FAIL, StrEq(notification_path),
String16Equals(IDS_DEVICE_UNSUPPORTED_MESSAGE, device_label)));
notifications->ManageNotificationsOnMountCompleted(notification_path,
device_label, false, false, true);
}
-TEST(FileBrowserMountNotificationsTest, UnsupportedWithUnknownParent) {
- MockFileBrowserNotificationsOnMount* mocked_notifications =
- new MockFileBrowserNotificationsOnMount(NULL);
- scoped_ptr<FileBrowserNotifications> notifications(mocked_notifications);
+TEST(FileManagerMountNotificationsTest, UnsupportedWithUnknownParent) {
+ MockFileManagerNotificationsOnMount* mocked_notifications =
+ new MockFileManagerNotificationsOnMount(NULL);
+ scoped_ptr<FileManagerNotifications> notifications(mocked_notifications);
std::string notification_path("system_path_prefix");
std::string device_label("label");
@@ -120,17 +120,17 @@ TEST(FileBrowserMountNotificationsTest, UnsupportedWithUnknownParent) {
notifications->RegisterDevice(notification_path);
EXPECT_CALL(*mocked_notifications, HideNotification(
- FileBrowserNotifications::DEVICE, StrEq(notification_path)));
+ FileManagerNotifications::DEVICE, StrEq(notification_path)));
{
InSequence s;
EXPECT_CALL(*mocked_notifications, ShowNotificationWithMessage(
- FileBrowserNotifications::DEVICE_FAIL, StrEq(notification_path), _));
+ FileManagerNotifications::DEVICE_FAIL, StrEq(notification_path), _));
EXPECT_CALL(*mocked_notifications, HideNotification(
- FileBrowserNotifications::DEVICE_FAIL, StrEq(notification_path)));
+ FileManagerNotifications::DEVICE_FAIL, StrEq(notification_path)));
EXPECT_CALL(*mocked_notifications, ShowNotificationWithMessage(
- FileBrowserNotifications::DEVICE_FAIL, StrEq(notification_path),
+ FileManagerNotifications::DEVICE_FAIL, StrEq(notification_path),
String16Equals(IDS_DEVICE_UNSUPPORTED_MESSAGE,
device_label)));
}
@@ -141,19 +141,19 @@ TEST(FileBrowserMountNotificationsTest, UnsupportedWithUnknownParent) {
device_label, false, false, true);
}
-TEST(FileBrowserMountNotificationsTest, MountPartialSuccess) {
- MockFileBrowserNotificationsOnMount* mocked_notifications =
- new MockFileBrowserNotificationsOnMount(NULL);
- scoped_ptr<FileBrowserNotifications> notifications(mocked_notifications);
+TEST(FileManagerMountNotificationsTest, MountPartialSuccess) {
+ MockFileManagerNotificationsOnMount* mocked_notifications =
+ new MockFileManagerNotificationsOnMount(NULL);
+ scoped_ptr<FileManagerNotifications> notifications(mocked_notifications);
std::string notification_path("system_path_prefix");
std::string device_label("label");
notifications->RegisterDevice(notification_path);
EXPECT_CALL(*mocked_notifications, HideNotification(
- FileBrowserNotifications::DEVICE, StrEq(notification_path)));
+ FileManagerNotifications::DEVICE, StrEq(notification_path)));
EXPECT_CALL(*mocked_notifications, ShowNotificationWithMessage(
- FileBrowserNotifications::DEVICE_FAIL, StrEq(notification_path),
+ FileManagerNotifications::DEVICE_FAIL, StrEq(notification_path),
String16Equals(IDS_MULTIPART_DEVICE_UNSUPPORTED_MESSAGE,
device_label)));
@@ -163,51 +163,51 @@ TEST(FileBrowserMountNotificationsTest, MountPartialSuccess) {
device_label, false, false, true);
}
-TEST(FileBrowserMountNotificationsTest, Unknown) {
- MockFileBrowserNotificationsOnMount* mocked_notifications =
- new MockFileBrowserNotificationsOnMount(NULL);
- scoped_ptr<FileBrowserNotifications> notifications(mocked_notifications);
+TEST(FileManagerMountNotificationsTest, Unknown) {
+ MockFileManagerNotificationsOnMount* mocked_notifications =
+ new MockFileManagerNotificationsOnMount(NULL);
+ scoped_ptr<FileManagerNotifications> notifications(mocked_notifications);
std::string notification_path("system_path_prefix");
std::string device_label("label");
notifications->RegisterDevice(notification_path);
EXPECT_CALL(*mocked_notifications, HideNotification(
- FileBrowserNotifications::DEVICE, StrEq(notification_path)));
+ FileManagerNotifications::DEVICE, StrEq(notification_path)));
EXPECT_CALL(*mocked_notifications, ShowNotificationWithMessage(
- FileBrowserNotifications::DEVICE_FAIL, StrEq(notification_path),
+ FileManagerNotifications::DEVICE_FAIL, StrEq(notification_path),
String16Equals(IDS_DEVICE_UNKNOWN_MESSAGE, device_label)));
notifications->ManageNotificationsOnMountCompleted(notification_path,
device_label, false, false, false);
}
-TEST(FileBrowserMountNotificationsTest, MulitpleFail) {
- MockFileBrowserNotificationsOnMount* mocked_notifications =
- new MockFileBrowserNotificationsOnMount(NULL);
- scoped_ptr<FileBrowserNotifications> notifications(mocked_notifications);
+TEST(FileManagerMountNotificationsTest, MulitpleFail) {
+ MockFileManagerNotificationsOnMount* mocked_notifications =
+ new MockFileManagerNotificationsOnMount(NULL);
+ scoped_ptr<FileManagerNotifications> notifications(mocked_notifications);
std::string notification_path("system_path_prefix");
std::string device_label("label");
notifications->RegisterDevice(notification_path);
EXPECT_CALL(*mocked_notifications, HideNotification(
- FileBrowserNotifications::DEVICE, StrEq(notification_path)));
+ FileManagerNotifications::DEVICE, StrEq(notification_path)));
{
InSequence s;
EXPECT_CALL(*mocked_notifications, ShowNotificationWithMessage(
- FileBrowserNotifications::DEVICE_FAIL, StrEq(notification_path),
+ FileManagerNotifications::DEVICE_FAIL, StrEq(notification_path),
String16Equals(IDS_DEVICE_UNKNOWN_MESSAGE, device_label)))
.RetiresOnSaturation();
EXPECT_CALL(*mocked_notifications, HideNotification(
- FileBrowserNotifications::DEVICE_FAIL, notification_path));
+ FileManagerNotifications::DEVICE_FAIL, notification_path));
EXPECT_CALL(*mocked_notifications, ShowNotificationWithMessage(
- FileBrowserNotifications::DEVICE_FAIL, StrEq(notification_path),
+ FileManagerNotifications::DEVICE_FAIL, StrEq(notification_path),
String16Equals(IDS_DEVICE_UNKNOWN_MESSAGE, device_label)));
EXPECT_CALL(*mocked_notifications, HideNotification(
- FileBrowserNotifications::DEVICE_FAIL, notification_path));
+ FileManagerNotifications::DEVICE_FAIL, notification_path));
EXPECT_CALL(*mocked_notifications, ShowNotificationWithMessage(
- FileBrowserNotifications::DEVICE_FAIL, StrEq(notification_path),
+ FileManagerNotifications::DEVICE_FAIL, StrEq(notification_path),
String16Equals(IDS_MULTIPART_DEVICE_UNSUPPORTED_MESSAGE,
device_label)));
}

Powered by Google App Engine
This is Rietveld 408576698