OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "webkit/fileapi/local_file_system_operation.h" | 5 #include "webkit/fileapi/local_file_system_operation.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 namespace { | 34 namespace { |
35 | 35 |
36 const int kFileOperationStatusNotSet = 1; | 36 const int kFileOperationStatusNotSet = 1; |
37 | 37 |
38 void AssertFileErrorEq(base::PlatformFileError expected, | 38 void AssertFileErrorEq(base::PlatformFileError expected, |
39 base::PlatformFileError actual) { | 39 base::PlatformFileError actual) { |
40 ASSERT_EQ(expected, actual); | 40 ASSERT_EQ(expected, actual); |
41 } | 41 } |
42 | 42 |
43 FilePath ASCIIToFilePath(const std::string& str) { | |
44 return FilePath().AppendASCII(str); | |
45 } | |
46 | |
47 } // namespace (anonymous) | 43 } // namespace (anonymous) |
48 | 44 |
49 // Test class for LocalFileSystemOperation. | 45 // Test class for LocalFileSystemOperation. |
50 class LocalFileSystemOperationTest | 46 class LocalFileSystemOperationTest |
51 : public testing::Test, | 47 : public testing::Test, |
52 public base::SupportsWeakPtr<LocalFileSystemOperationTest> { | 48 public base::SupportsWeakPtr<LocalFileSystemOperationTest> { |
53 public: | 49 public: |
54 LocalFileSystemOperationTest() | 50 LocalFileSystemOperationTest() |
55 : status_(kFileOperationStatusNotSet), | 51 : status_(kFileOperationStatusNotSet), |
56 next_unique_path_suffix_(0) { | 52 next_unique_path_suffix_(0) { |
(...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1204 EXPECT_FALSE(info().is_directory); | 1200 EXPECT_FALSE(info().is_directory); |
1205 EXPECT_EQ(PlatformPath(file_path), path()); | 1201 EXPECT_EQ(PlatformPath(file_path), path()); |
1206 EXPECT_TRUE(change_observer()->HasNoChange()); | 1202 EXPECT_TRUE(change_observer()->HasNoChange()); |
1207 | 1203 |
1208 // The FileSystemOpration implementation does not create a | 1204 // The FileSystemOpration implementation does not create a |
1209 // shareable file reference. | 1205 // shareable file reference. |
1210 EXPECT_EQ(NULL, shareable_file_ref()); | 1206 EXPECT_EQ(NULL, shareable_file_ref()); |
1211 } | 1207 } |
1212 | 1208 |
1213 } // namespace fileapi | 1209 } // namespace fileapi |
OLD | NEW |