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

Side by Side Diff: components/filesystem/directory_impl_unittest.cc

Issue 2604843002: Fix crash in DirectoryImpl::Flush() (Closed)
Patch Set: Created 3 years, 12 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 | « components/filesystem/directory_impl.cc ('k') | no next file » | 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 269
270 { 270 {
271 std::string data("one two three"); 271 std::string data("one two three");
272 bool handled = directory->WriteFile( 272 bool handled = directory->WriteFile(
273 "my_dir", mojo::Array<uint8_t>::From(data), &error); 273 "my_dir", mojo::Array<uint8_t>::From(data), &error);
274 ASSERT_TRUE(handled); 274 ASSERT_TRUE(handled);
275 EXPECT_EQ(mojom::FileError::NOT_A_FILE, error); 275 EXPECT_EQ(mojom::FileError::NOT_A_FILE, error);
276 } 276 }
277 } 277 }
278 278
279 TEST_F(DirectoryImplTest, Flush) {
280 mojom::DirectoryPtr directory;
281 GetTemporaryRoot(&directory);
282 mojom::FileError error;
283
284 {
285 bool handled = directory->Flush(&error);
286 ASSERT_TRUE(handled);
287 EXPECT_EQ(mojom::FileError::OK, error);
288 }
289 }
290
279 // TODO(vtl): Test delete flags. 291 // TODO(vtl): Test delete flags.
280 292
281 } // namespace 293 } // namespace
282 } // namespace filesystem 294 } // namespace filesystem
OLDNEW
« no previous file with comments | « components/filesystem/directory_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698