1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "components/filesystem/files_test_base.h"
7 #include "components/filesystem/public/interfaces/directory.mojom.h"
8 #include "components/filesystem/public/interfaces/types.mojom.h"
9 #include "mojo/application/public/cpp/application_impl.h"
10 #include "mojo/util/capture_util.h"
12 namespace filesystem
{
14 FilesTestBase::FilesTestBase() {
17 FilesTestBase::~FilesTestBase() {
20 void FilesTestBase::SetUp() {
21 ApplicationTestBase::SetUp();
23 mojo::URLRequestPtr
request(mojo::URLRequest::New());
24 request
->url
= mojo::String::From("mojo:filesystem");
25 application_impl()->ConnectToService(request
.Pass(), &files_
);
28 void FilesTestBase::GetTemporaryRoot(DirectoryPtr
* directory
) {
29 FileError error
= FILE_ERROR_FAILED
;
30 files()->OpenFileSystem("temp", GetProxy(directory
), mojo::Capture(&error
));
31 ASSERT_TRUE(files().WaitForIncomingResponse());
32 ASSERT_EQ(FILE_ERROR_OK
, error
);
35 } // namespace filesystem