| 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/syncable/local_file_sync_status.h" | 5 #include "webkit/fileapi/syncable/local_file_sync_status.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "googleurl/src/gurl.h" | 8 #include "googleurl/src/gurl.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| 11 namespace fileapi { | 11 namespace fileapi { |
| 12 | 12 |
| 13 namespace { | 13 namespace { |
| 14 | 14 |
| 15 const char kParent[] = "filesystem:http://foo.com/test/dir a"; | 15 const char kParent[] = "filesystem:http://foo.com/test/dir a"; |
| 16 const char kFile[] = "filesystem:http://foo.com/test/dir a/dir b"; | 16 const char kFile[] = "filesystem:http://foo.com/test/dir a/dir b"; |
| 17 const char kChild[] = "filesystem:http://foo.com/test/dir a/dir b/file"; | 17 const char kChild[] = "filesystem:http://foo.com/test/dir a/dir b/file"; |
| 18 | 18 |
| 19 const char kOther1[] = "filesystem:http://foo.com/test/dir b"; | 19 const char kOther1[] = "filesystem:http://foo.com/test/dir b"; |
| 20 const char kOther2[] = "filesystem:http://foo.com/temporary/dir a"; | 20 const char kOther2[] = "filesystem:http://foo.com/temporary/dir a"; |
| 21 | 21 |
| 22 FileSystemURL URL(const char* spec) { | 22 FileSystemURL URL(const char* spec) { |
| 23 return FileSystemURL(GURL(spec)); | 23 return FileSystemURL::CreateForTest((GURL(spec))); |
| 24 } | 24 } |
| 25 | 25 |
| 26 } // namespace | 26 } // namespace |
| 27 | 27 |
| 28 TEST(LocalFileSyncStatusTest, WritingSimple) { | 28 TEST(LocalFileSyncStatusTest, WritingSimple) { |
| 29 LocalFileSyncStatus status; | 29 LocalFileSyncStatus status; |
| 30 | 30 |
| 31 status.StartWriting(URL(kFile)); | 31 status.StartWriting(URL(kFile)); |
| 32 status.StartWriting(URL(kFile)); | 32 status.StartWriting(URL(kFile)); |
| 33 status.EndWriting(URL(kFile)); | 33 status.EndWriting(URL(kFile)); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 EXPECT_TRUE(status.IsSyncable(URL(kOther2))); | 78 EXPECT_TRUE(status.IsSyncable(URL(kOther2))); |
| 79 | 79 |
| 80 status.EndSyncing(URL(kFile)); | 80 status.EndSyncing(URL(kFile)); |
| 81 | 81 |
| 82 EXPECT_TRUE(status.IsWritable(URL(kFile))); | 82 EXPECT_TRUE(status.IsWritable(URL(kFile))); |
| 83 EXPECT_TRUE(status.IsWritable(URL(kParent))); | 83 EXPECT_TRUE(status.IsWritable(URL(kParent))); |
| 84 EXPECT_TRUE(status.IsWritable(URL(kChild))); | 84 EXPECT_TRUE(status.IsWritable(URL(kChild))); |
| 85 } | 85 } |
| 86 | 86 |
| 87 } // namespace fileapi | 87 } // namespace fileapi |
| OLD | NEW |