summaryrefslogtreecommitdiff
path: root/chromium/components/filesystem/files_test_base.cc
blob: facb600b2e1bc1b190e9f29a5c4c841eb476e27a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright 2015 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 "components/filesystem/files_test_base.h"

#include <utility>

#include "components/filesystem/public/interfaces/directory.mojom.h"
#include "components/filesystem/public/interfaces/types.mojom.h"
#include "services/service_manager/public/cpp/connector.h"

namespace filesystem {

FilesTestBase::FilesTestBase()
    : ServiceTest("filesystem_service_unittests") {
}

FilesTestBase::~FilesTestBase() {
}

void FilesTestBase::SetUp() {
  ServiceTest::SetUp();
  connector()->BindInterface("filesystem", &files_);
}

void FilesTestBase::GetTemporaryRoot(mojom::DirectoryPtr* directory) {
  mojom::FileError error = mojom::FileError::FAILED;
  bool handled = files()->OpenTempDirectory(MakeRequest(directory), &error);
  ASSERT_TRUE(handled);
  ASSERT_EQ(mojom::FileError::OK, error);
}

}  // namespace filesystem