| OLD | NEW |
| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/callback_forward.h" | 7 #include "base/callback_forward.h" |
| 8 #include "base/threading/sequenced_worker_pool.h" | 8 #include "base/threading/sequenced_worker_pool.h" |
| 9 #include "chrome/browser/extensions/app_data_migrator.h" | 9 #include "chrome/browser/extensions/app_data_migrator.h" |
| 10 #include "chrome/browser/extensions/extension_special_storage_policy.h" | 10 #include "chrome/browser/extensions/extension_special_storage_policy.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 ListBuilder().Append("unlimitedStorage"))) | 98 ListBuilder().Append("unlimitedStorage"))) |
| 99 .Build(); | 99 .Build(); |
| 100 } | 100 } |
| 101 return app; | 101 return app; |
| 102 } | 102 } |
| 103 | 103 |
| 104 void MigrationCallback() { | 104 void MigrationCallback() { |
| 105 } | 105 } |
| 106 | 106 |
| 107 void DidWrite(base::File::Error status, int64 bytes, bool complete) { | 107 void DidWrite(base::File::Error status, int64 bytes, bool complete) { |
| 108 base::MessageLoop::current()->Quit(); | 108 base::MessageLoop::current()->QuitWhenIdle(); |
| 109 } | 109 } |
| 110 | 110 |
| 111 void DidCreate(base::File::Error status) { | 111 void DidCreate(base::File::Error status) { |
| 112 } | 112 } |
| 113 | 113 |
| 114 void DidOpenFileSystem(const GURL& root, | 114 void DidOpenFileSystem(const GURL& root, |
| 115 const std::string& name, | 115 const std::string& name, |
| 116 base::File::Error result) { | 116 base::File::Error result) { |
| 117 } | 117 } |
| 118 | 118 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 file.Read(0, buffer.get(), 14); | 176 file.Read(0, buffer.get(), 14); |
| 177 buffer.get()[14] = 0; | 177 buffer.get()[14] = 0; |
| 178 | 178 |
| 179 std::string expected = "Hello, world!\n"; | 179 std::string expected = "Hello, world!\n"; |
| 180 std::string actual = buffer.get(); | 180 std::string actual = buffer.get(); |
| 181 EXPECT_EQ(expected, actual); | 181 EXPECT_EQ(expected, actual); |
| 182 | 182 |
| 183 file.Close(); | 183 file.Close(); |
| 184 if (!on_close_callback.is_null()) | 184 if (!on_close_callback.is_null()) |
| 185 on_close_callback.Run(); | 185 on_close_callback.Run(); |
| 186 base::MessageLoop::current()->Quit(); | 186 base::MessageLoop::current()->QuitWhenIdle(); |
| 187 } | 187 } |
| 188 | 188 |
| 189 void VerifyTestFilesMigrated(content::StoragePartition* new_partition, | 189 void VerifyTestFilesMigrated(content::StoragePartition* new_partition, |
| 190 const Extension* new_ext) { | 190 const Extension* new_ext) { |
| 191 GURL extension_url = | 191 GURL extension_url = |
| 192 extensions::Extension::GetBaseURLFromExtensionId(new_ext->id()); | 192 extensions::Extension::GetBaseURLFromExtensionId(new_ext->id()); |
| 193 storage::FileSystemContext* new_fs_context = | 193 storage::FileSystemContext* new_fs_context = |
| 194 new_partition->GetFileSystemContext(); | 194 new_partition->GetFileSystemContext(); |
| 195 | 195 |
| 196 OpenFileSystems(new_fs_context, extension_url); | 196 OpenFileSystems(new_fs_context, extension_url); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 content::StoragePartition* new_partition = | 263 content::StoragePartition* new_partition = |
| 264 content::BrowserContext::GetStoragePartitionForSite(profile_.get(), | 264 content::BrowserContext::GetStoragePartitionForSite(profile_.get(), |
| 265 extension_url); | 265 extension_url); |
| 266 | 266 |
| 267 ASSERT_NE(new_partition->GetPath(), default_partition_->GetPath()); | 267 ASSERT_NE(new_partition->GetPath(), default_partition_->GetPath()); |
| 268 | 268 |
| 269 VerifyTestFilesMigrated(new_partition, new_ext.get()); | 269 VerifyTestFilesMigrated(new_partition, new_ext.get()); |
| 270 } | 270 } |
| 271 | 271 |
| 272 } // namespace extensions | 272 } // namespace extensions |
| OLD | NEW |