| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 task_runner_.get()); | 59 task_runner_.get()); |
| 60 base::RunLoop().RunUntilIdle(); | 60 base::RunLoop().RunUntilIdle(); |
| 61 setup_temp_dir(); | 61 setup_temp_dir(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 void FlushIndexedDBTaskRunner() { task_runner_->RunUntilIdle(); } | 64 void FlushIndexedDBTaskRunner() { task_runner_->RunUntilIdle(); } |
| 65 | 65 |
| 66 void setup_temp_dir() { | 66 void setup_temp_dir() { |
| 67 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 67 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 68 base::FilePath indexeddb_dir = | 68 base::FilePath indexeddb_dir = |
| 69 temp_dir_.path().Append(IndexedDBContextImpl::kIndexedDBDirectory); | 69 temp_dir_.GetPath().Append(IndexedDBContextImpl::kIndexedDBDirectory); |
| 70 ASSERT_TRUE(base::CreateDirectory(indexeddb_dir)); | 70 ASSERT_TRUE(base::CreateDirectory(indexeddb_dir)); |
| 71 idb_context()->set_data_path_for_testing(indexeddb_dir); | 71 idb_context()->set_data_path_for_testing(indexeddb_dir); |
| 72 } | 72 } |
| 73 | 73 |
| 74 ~IndexedDBQuotaClientTest() override { | 74 ~IndexedDBQuotaClientTest() override { |
| 75 FlushIndexedDBTaskRunner(); | 75 FlushIndexedDBTaskRunner(); |
| 76 idb_context_ = NULL; | 76 idb_context_ = NULL; |
| 77 browser_context_.reset(); | 77 browser_context_.reset(); |
| 78 base::RunLoop().RunUntilIdle(); | 78 base::RunLoop().RunUntilIdle(); |
| 79 } | 79 } |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 EXPECT_EQ(1000, GetOriginUsage(&client, kOriginA, kTemp)); | 238 EXPECT_EQ(1000, GetOriginUsage(&client, kOriginA, kTemp)); |
| 239 EXPECT_EQ(50, GetOriginUsage(&client, kOriginB, kTemp)); | 239 EXPECT_EQ(50, GetOriginUsage(&client, kOriginB, kTemp)); |
| 240 | 240 |
| 241 storage::QuotaStatusCode delete_status = DeleteOrigin(&client, kOriginA); | 241 storage::QuotaStatusCode delete_status = DeleteOrigin(&client, kOriginA); |
| 242 EXPECT_EQ(storage::kQuotaStatusOk, delete_status); | 242 EXPECT_EQ(storage::kQuotaStatusOk, delete_status); |
| 243 EXPECT_EQ(0, GetOriginUsage(&client, kOriginA, kTemp)); | 243 EXPECT_EQ(0, GetOriginUsage(&client, kOriginA, kTemp)); |
| 244 EXPECT_EQ(50, GetOriginUsage(&client, kOriginB, kTemp)); | 244 EXPECT_EQ(50, GetOriginUsage(&client, kOriginB, kTemp)); |
| 245 } | 245 } |
| 246 | 246 |
| 247 } // namespace content | 247 } // namespace content |
| OLD | NEW |