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

Unified Diff: chrome/browser/chromeos/file_system_provider/mount_path_util_unittest.cc

Issue 210803003: [fsp] Decouple file_service_provider::Service. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments. Created 6 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/file_system_provider/mount_path_util_unittest.cc
diff --git a/chrome/browser/chromeos/file_system_provider/mount_path_util_unittest.cc b/chrome/browser/chromeos/file_system_provider/mount_path_util_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..2b24956bc372fdca1cbf4688d27dad0a7d7583e8
--- /dev/null
+++ b/chrome/browser/chromeos/file_system_provider/mount_path_util_unittest.cc
@@ -0,0 +1,48 @@
+// Copyright 2014 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 <string>
+
+#include "base/files/file.h"
+#include "chrome/browser/chromeos/file_system_provider/mount_path_util.h"
+#include "chrome/browser/chromeos/login/fake_user_manager.h"
+#include "chrome/test/base/testing_profile.h"
+#include "content/public/test/test_browser_thread_bundle.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace chromeos {
+namespace file_system_provider {
+namespace util {
+
+class FileSystemProviderMountPathUtilTest : public testing::Test {
+ protected:
+ FileSystemProviderMountPathUtilTest() {}
+ virtual ~FileSystemProviderMountPathUtilTest() {}
+
+ virtual void SetUp() OVERRIDE {
+ user_manager_ = new FakeUserManager();
+ user_manager_enabler_.reset(new ScopedUserManagerEnabler(user_manager_));
+ profile_.reset(new TestingProfile);
+ user_manager_->AddUser(profile_->GetProfileName());
+ }
+
+ content::TestBrowserThreadBundle thread_bundle_;
+ scoped_ptr<TestingProfile> profile_;
+ scoped_ptr<ScopedUserManagerEnabler> user_manager_enabler_;
+ FakeUserManager* user_manager_;
+};
+
+TEST_F(FileSystemProviderMountPathUtilTest, GetMountPointPath) {
+ const std::string kExtensionId = "mbflcebpggnecokmikipoihdbecnjfoj";
+ const int kFileSystemId = 1;
+
+ base::FilePath result =
+ GetMountPointPath(profile_.get(), kExtensionId, kFileSystemId);
+ EXPECT_EQ("/provided/mbflcebpggnecokmikipoihdbecnjfoj-1-testing_profile-hash",
+ result.AsUTF8Unsafe());
+}
+
+} // namespace util
+} // namespace file_system_provider
+} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698