| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <set> | 6 #include <set> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 4312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4323 EXPECT_TRUE(base::CreateDirectory(lso_dir_path)); | 4323 EXPECT_TRUE(base::CreateDirectory(lso_dir_path)); |
| 4324 EXPECT_EQ(0, base::WriteFile(lso_file_path, NULL, 0)); | 4324 EXPECT_EQ(0, base::WriteFile(lso_file_path, NULL, 0)); |
| 4325 EXPECT_TRUE(base::PathExists(lso_file_path)); | 4325 EXPECT_TRUE(base::PathExists(lso_file_path)); |
| 4326 | 4326 |
| 4327 // Create indexed db. Similarly, it is enough to only simulate this by | 4327 // Create indexed db. Similarly, it is enough to only simulate this by |
| 4328 // creating the directory on the disk. | 4328 // creating the directory on the disk. |
| 4329 IndexedDBContext* idb_context = BrowserContext::GetDefaultStoragePartition( | 4329 IndexedDBContext* idb_context = BrowserContext::GetDefaultStoragePartition( |
| 4330 profile())->GetIndexedDBContext(); | 4330 profile())->GetIndexedDBContext(); |
| 4331 idb_context->SetTaskRunnerForTesting( | 4331 idb_context->SetTaskRunnerForTesting( |
| 4332 base::MessageLoop::current()->message_loop_proxy().get()); | 4332 base::MessageLoop::current()->message_loop_proxy().get()); |
| 4333 base::FilePath idb_path = idb_context->GetFilePathForTesting(origin_id); | 4333 base::FilePath idb_path = idb_context->GetFilePath(ext_url); |
| 4334 EXPECT_TRUE(base::CreateDirectory(idb_path)); | 4334 EXPECT_TRUE(base::CreateDirectory(idb_path)); |
| 4335 EXPECT_TRUE(base::DirectoryExists(idb_path)); | 4335 EXPECT_TRUE(base::DirectoryExists(idb_path)); |
| 4336 | 4336 |
| 4337 // Uninstall the extension. | 4337 // Uninstall the extension. |
| 4338 base::RunLoop run_loop; | 4338 base::RunLoop run_loop; |
| 4339 ASSERT_TRUE( | 4339 ASSERT_TRUE( |
| 4340 service()->UninstallExtension(good_crx, | 4340 service()->UninstallExtension(good_crx, |
| 4341 extensions::UNINSTALL_REASON_FOR_TESTING, | 4341 extensions::UNINSTALL_REASON_FOR_TESTING, |
| 4342 run_loop.QuitClosure(), | 4342 run_loop.QuitClosure(), |
| 4343 NULL)); | 4343 NULL)); |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4446 EXPECT_TRUE(base::CreateDirectory(lso_dir_path)); | 4446 EXPECT_TRUE(base::CreateDirectory(lso_dir_path)); |
| 4447 EXPECT_EQ(0, base::WriteFile(lso_file_path, NULL, 0)); | 4447 EXPECT_EQ(0, base::WriteFile(lso_file_path, NULL, 0)); |
| 4448 EXPECT_TRUE(base::PathExists(lso_file_path)); | 4448 EXPECT_TRUE(base::PathExists(lso_file_path)); |
| 4449 | 4449 |
| 4450 // Create indexed db. Similarly, it is enough to only simulate this by | 4450 // Create indexed db. Similarly, it is enough to only simulate this by |
| 4451 // creating the directory on the disk. | 4451 // creating the directory on the disk. |
| 4452 IndexedDBContext* idb_context = BrowserContext::GetDefaultStoragePartition( | 4452 IndexedDBContext* idb_context = BrowserContext::GetDefaultStoragePartition( |
| 4453 profile())->GetIndexedDBContext(); | 4453 profile())->GetIndexedDBContext(); |
| 4454 idb_context->SetTaskRunnerForTesting( | 4454 idb_context->SetTaskRunnerForTesting( |
| 4455 base::MessageLoop::current()->message_loop_proxy().get()); | 4455 base::MessageLoop::current()->message_loop_proxy().get()); |
| 4456 base::FilePath idb_path = idb_context->GetFilePathForTesting(origin_id); | 4456 base::FilePath idb_path = idb_context->GetFilePath(origin1); |
| 4457 EXPECT_TRUE(base::CreateDirectory(idb_path)); | 4457 EXPECT_TRUE(base::CreateDirectory(idb_path)); |
| 4458 EXPECT_TRUE(base::DirectoryExists(idb_path)); | 4458 EXPECT_TRUE(base::DirectoryExists(idb_path)); |
| 4459 | 4459 |
| 4460 // Uninstall one of them, unlimited storage should still be granted | 4460 // Uninstall one of them, unlimited storage should still be granted |
| 4461 // to the origin. | 4461 // to the origin. |
| 4462 UninstallExtension(id1, false); | 4462 UninstallExtension(id1, false); |
| 4463 EXPECT_EQ(1u, registry()->enabled_extensions().size()); | 4463 EXPECT_EQ(1u, registry()->enabled_extensions().size()); |
| 4464 EXPECT_TRUE(profile()->GetExtensionSpecialStoragePolicy()->IsStorageUnlimited( | 4464 EXPECT_TRUE(profile()->GetExtensionSpecialStoragePolicy()->IsStorageUnlimited( |
| 4465 origin1)); | 4465 origin1)); |
| 4466 | 4466 |
| (...skipping 2660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7127 | 7127 |
| 7128 service()->Observe(chrome::NOTIFICATION_PROFILE_DESTRUCTION_STARTED, | 7128 service()->Observe(chrome::NOTIFICATION_PROFILE_DESTRUCTION_STARTED, |
| 7129 content::Source<Profile>(profile()), | 7129 content::Source<Profile>(profile()), |
| 7130 content::NotificationService::NoDetails()); | 7130 content::NotificationService::NoDetails()); |
| 7131 EXPECT_EQ(UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN, unloaded_reason_); | 7131 EXPECT_EQ(UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN, unloaded_reason_); |
| 7132 EXPECT_EQ(0u, registry()->enabled_extensions().size()); | 7132 EXPECT_EQ(0u, registry()->enabled_extensions().size()); |
| 7133 EXPECT_EQ(0u, registry()->disabled_extensions().size()); | 7133 EXPECT_EQ(0u, registry()->disabled_extensions().size()); |
| 7134 EXPECT_EQ(0u, registry()->terminated_extensions().size()); | 7134 EXPECT_EQ(0u, registry()->terminated_extensions().size()); |
| 7135 EXPECT_EQ(0u, registry()->blacklisted_extensions().size()); | 7135 EXPECT_EQ(0u, registry()->blacklisted_extensions().size()); |
| 7136 } | 7136 } |
| OLD | NEW |