#include "chrome/browser/sync_file_system/drive_backend/sync_task_manager.h"
#include "chrome/browser/sync_file_system/drive_backend/sync_task_token.h"
#include "chrome/browser/sync_file_system/sync_file_system_test_util.h"
+#include "storage/common/fileapi/file_system_util.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "webkit/common/fileapi/file_system_util.h"
#define MAKE_PATH(path) \
- base::FilePath(fileapi::VirtualPath::GetNormalizedFilePath( \
+ base::FilePath(storage::VirtualPath::GetNormalizedFilePath( \
base::FilePath(FILE_PATH_LITERAL(path))))
namespace sync_file_system {
}
virtual void RunPreflight(scoped_ptr<SyncTaskToken> token) OVERRIDE {
- scoped_ptr<BlockingFactor> blocking_factor(new BlockingFactor);
- blocking_factor->app_id = app_id_;
- blocking_factor->paths.push_back(path_);
+ scoped_ptr<TaskBlocker> task_blocker(new TaskBlocker);
+ task_blocker->app_id = app_id_;
+ task_blocker->paths.push_back(path_);
- SyncTaskManager::UpdateBlockingFactor(
- token.Pass(), blocking_factor.Pass(),
+ SyncTaskManager::UpdateTaskBlocker(
+ token.Pass(), task_blocker.Pass(),
base::Bind(&BackgroundTask::RunAsBackgroundTask,
weak_ptr_factory_.GetWeakPtr()));
}
log_->push_back(name_ + ": updating to " + updating_to);
- scoped_ptr<BlockingFactor> blocking_factor(new BlockingFactor);
- blocking_factor->app_id = app_id_;
- blocking_factor->paths.push_back(
- base::FilePath(fileapi::VirtualPath::GetNormalizedFilePath(
+ scoped_ptr<TaskBlocker> task_blocker(new TaskBlocker);
+ task_blocker->app_id = app_id_;
+ task_blocker->paths.push_back(
+ base::FilePath(storage::VirtualPath::GetNormalizedFilePath(
base::FilePath::FromUTF8Unsafe(updating_to))));
- SyncTaskManager::UpdateBlockingFactor(
- token.Pass(), blocking_factor.Pass(),
+ SyncTaskManager::UpdateTaskBlocker(
+ token.Pass(), task_blocker.Pass(),
base::Bind(&BlockerUpdateTestHelper::UpdateBlockerSoon,
weak_ptr_factory_.GetWeakPtr(),
updating_to));
EXPECT_EQ(2, stats.max_parallel_task);
}
-TEST(SyncTaskManagerTest, UpdateBlockingFactor) {
+TEST(SyncTaskManagerTest, UpdateTaskBlocker) {
base::MessageLoop message_loop;
SyncTaskManager task_manager(base::WeakPtr<SyncTaskManager::Client>(),
10 /* maximum_background_task */,