OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 <stdint.h> | 5 #include <stdint.h> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 | 244 |
245 TEST_F(IndexedDBFactoryTest, QuotaErrorOnDiskFull) { | 245 TEST_F(IndexedDBFactoryTest, QuotaErrorOnDiskFull) { |
246 const Origin origin(GURL("http://localhost:81")); | 246 const Origin origin(GURL("http://localhost:81")); |
247 base::ScopedTempDir temp_directory; | 247 base::ScopedTempDir temp_directory; |
248 ASSERT_TRUE(temp_directory.CreateUniqueTempDir()); | 248 ASSERT_TRUE(temp_directory.CreateUniqueTempDir()); |
249 | 249 |
250 scoped_refptr<DiskFullFactory> factory = new DiskFullFactory(context()); | 250 scoped_refptr<DiskFullFactory> factory = new DiskFullFactory(context()); |
251 scoped_refptr<LookingForQuotaErrorMockCallbacks> callbacks = | 251 scoped_refptr<LookingForQuotaErrorMockCallbacks> callbacks = |
252 new LookingForQuotaErrorMockCallbacks; | 252 new LookingForQuotaErrorMockCallbacks; |
253 scoped_refptr<IndexedDBDatabaseCallbacks> dummy_database_callbacks = | 253 scoped_refptr<IndexedDBDatabaseCallbacks> dummy_database_callbacks = |
254 new IndexedDBDatabaseCallbacks(nullptr, 0, 0); | 254 new IndexedDBDatabaseCallbacks(nullptr, 0, nullptr); |
255 const base::string16 name(ASCIIToUTF16("name")); | 255 const base::string16 name(ASCIIToUTF16("name")); |
256 std::unique_ptr<IndexedDBPendingConnection> connection( | 256 std::unique_ptr<IndexedDBPendingConnection> connection( |
257 base::MakeUnique<IndexedDBPendingConnection>( | 257 base::MakeUnique<IndexedDBPendingConnection>( |
258 callbacks, dummy_database_callbacks, 0 /* child_process_id */, | 258 callbacks, dummy_database_callbacks, 0 /* child_process_id */, |
259 2 /* transaction_id */, 1 /* version */)); | 259 2 /* transaction_id */, 1 /* version */)); |
260 factory->Open(name, std::move(connection), nullptr /* request_context */, | 260 factory->Open(name, std::move(connection), nullptr /* request_context */, |
261 origin, temp_directory.GetPath()); | 261 origin, temp_directory.GetPath()); |
262 EXPECT_TRUE(callbacks->error_called()); | 262 EXPECT_TRUE(callbacks->error_called()); |
263 } | 263 } |
264 | 264 |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 temp_directory.GetPath()); | 502 temp_directory.GetPath()); |
503 EXPECT_TRUE(callbacks->saw_error()); | 503 EXPECT_TRUE(callbacks->saw_error()); |
504 EXPECT_FALSE(factory()->IsDatabaseOpen(origin, db_name)); | 504 EXPECT_FALSE(factory()->IsDatabaseOpen(origin, db_name)); |
505 } | 505 } |
506 | 506 |
507 // Terminate all pending-close timers. | 507 // Terminate all pending-close timers. |
508 factory()->ForceClose(origin); | 508 factory()->ForceClose(origin); |
509 } | 509 } |
510 | 510 |
511 } // namespace content | 511 } // namespace content |
OLD | NEW |