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

Side by Side Diff: mojo/file_utils/file_util_unittest.cc

Issue 1916233002: Mark ApplicationImpl::ConnectTo{Application,Service}() as deprecated. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « mojo/common/tracing_impl.cc ('k') | mojo/public/cpp/application/application_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdint.h> 5 #include <stdint.h>
6 #include <vector> 6 #include <vector>
7 7
8 #include "mojo/file_utils/file_util.h" 8 #include "mojo/file_utils/file_util.h"
9 #include "mojo/public/cpp/application/application_impl.h" 9 #include "mojo/public/cpp/application/application_impl.h"
10 #include "mojo/public/cpp/application/application_test_base.h" 10 #include "mojo/public/cpp/application/application_test_base.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 // Close the FilePtr |file| and verify that no error occurs. 128 // Close the FilePtr |file| and verify that no error occurs.
129 void CloseFileHelper(mojo::files::FilePtr* file) { 129 void CloseFileHelper(mojo::files::FilePtr* file) {
130 mojo::files::Error error = mojo::files::Error::INTERNAL; 130 mojo::files::Error error = mojo::files::Error::INTERNAL;
131 (*file)->Close(Capture(&error)); 131 (*file)->Close(Capture(&error));
132 ASSERT_TRUE(file->WaitForIncomingResponse()); 132 ASSERT_TRUE(file->WaitForIncomingResponse());
133 EXPECT_EQ(mojo::files::Error::OK, error); 133 EXPECT_EQ(mojo::files::Error::OK, error);
134 } 134 }
135 135
136 TEST_F(FileUtilTest, BasicCreateTemporaryFile) { 136 TEST_F(FileUtilTest, BasicCreateTemporaryFile) {
137 mojo::files::FilesPtr files; 137 mojo::files::FilesPtr files;
138 application_impl()->ConnectToService("mojo:files", &files); 138 application_impl()->ConnectToServiceDeprecated("mojo:files", &files);
139 139
140 mojo::files::Error error = mojo::files::Error::INTERNAL; 140 mojo::files::Error error = mojo::files::Error::INTERNAL;
141 mojo::files::DirectoryPtr directory; 141 mojo::files::DirectoryPtr directory;
142 files->OpenFileSystem(nullptr, mojo::GetProxy(&directory), Capture(&error)); 142 files->OpenFileSystem(nullptr, mojo::GetProxy(&directory), Capture(&error));
143 143
144 ASSERT_TRUE(files.WaitForIncomingResponse()); 144 ASSERT_TRUE(files.WaitForIncomingResponse());
145 EXPECT_EQ(mojo::files::Error::OK, error); 145 EXPECT_EQ(mojo::files::Error::OK, error);
146 146
147 std::string filename1, filename2, filename3; 147 std::string filename1, filename2, filename3;
148 mojo::files::FilePtr file1, file2, file3; 148 mojo::files::FilePtr file1, file2, file3;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 190
191 // Test that the files can be closed once more. 191 // Test that the files can be closed once more.
192 CloseFileHelper(&file1); 192 CloseFileHelper(&file1);
193 CloseFileHelper(&file2); 193 CloseFileHelper(&file2);
194 CloseFileHelper(&file3); 194 CloseFileHelper(&file3);
195 } 195 }
196 196
197 } // namespace 197 } // namespace
198 } // namespace test 198 } // namespace test
199 } // namespace file_utils 199 } // namespace file_utils
OLDNEW
« no previous file with comments | « mojo/common/tracing_impl.cc ('k') | mojo/public/cpp/application/application_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698