| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/files/file.h" | 7 #include "base/files/file.h" |
| 8 #include "base/files/file_enumerator.h" | 8 #include "base/files/file_enumerator.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "content/public/common/url_constants.h" | 27 #include "content/public/common/url_constants.h" |
| 28 #include "content/public/test/browser_test_utils.h" | 28 #include "content/public/test/browser_test_utils.h" |
| 29 #include "content/public/test/content_browser_test.h" | 29 #include "content/public/test/content_browser_test.h" |
| 30 #include "content/public/test/content_browser_test_utils.h" | 30 #include "content/public/test/content_browser_test_utils.h" |
| 31 #include "content/shell/browser/shell.h" | 31 #include "content/shell/browser/shell.h" |
| 32 #include "net/base/escape.h" | 32 #include "net/base/escape.h" |
| 33 #include "net/base/net_errors.h" | 33 #include "net/base/net_errors.h" |
| 34 #include "net/test/embedded_test_server/embedded_test_server.h" | 34 #include "net/test/embedded_test_server/embedded_test_server.h" |
| 35 #include "net/test/embedded_test_server/http_request.h" | 35 #include "net/test/embedded_test_server/http_request.h" |
| 36 #include "net/test/embedded_test_server/http_response.h" | 36 #include "net/test/embedded_test_server/http_response.h" |
| 37 #include "storage/browser/blob/blob_storage_context.h" |
| 37 #include "storage/browser/database/database_util.h" | 38 #include "storage/browser/database/database_util.h" |
| 38 #include "storage/browser/quota/quota_manager.h" | 39 #include "storage/browser/quota/quota_manager.h" |
| 39 | 40 |
| 40 using base::ASCIIToUTF16; | 41 using base::ASCIIToUTF16; |
| 41 using storage::QuotaManager; | 42 using storage::QuotaManager; |
| 42 using storage::DatabaseUtil; | 43 using storage::DatabaseUtil; |
| 43 | 44 |
| 44 namespace content { | 45 namespace content { |
| 45 | 46 |
| 46 // This browser test is aimed towards exercising the IndexedDB bindings and | 47 // This browser test is aimed towards exercising the IndexedDB bindings and |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 | 398 |
| 398 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, CanDeleteWhenOverQuotaTest) { | 399 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, CanDeleteWhenOverQuotaTest) { |
| 399 SimpleTest(GetTestUrl("indexeddb", "fill_up_5k.html")); | 400 SimpleTest(GetTestUrl("indexeddb", "fill_up_5k.html")); |
| 400 int64 size = RequestDiskUsage(); | 401 int64 size = RequestDiskUsage(); |
| 401 const int kQuotaKilobytes = 2; | 402 const int kQuotaKilobytes = 2; |
| 402 EXPECT_GT(size, kQuotaKilobytes * 1024); | 403 EXPECT_GT(size, kQuotaKilobytes * 1024); |
| 403 SetQuota(kQuotaKilobytes); | 404 SetQuota(kQuotaKilobytes); |
| 404 SimpleTest(GetTestUrl("indexeddb", "delete_over_quota.html")); | 405 SimpleTest(GetTestUrl("indexeddb", "delete_over_quota.html")); |
| 405 } | 406 } |
| 406 | 407 |
| 408 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestWithGCExposed, BlobDidAck) { |
| 409 SimpleTest(GetTestUrl("indexeddb", "blob_did_ack.html")); |
| 410 content::ChromeBlobStorageContext* blob_context = |
| 411 ChromeBlobStorageContext::GetFor( |
| 412 shell()->web_contents()->GetBrowserContext()); |
| 413 EXPECT_EQ(0UL, blob_context->context()->num_blobs()); |
| 414 } |
| 415 |
| 407 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, BlobsCountAgainstQuota) { | 416 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, BlobsCountAgainstQuota) { |
| 408 SimpleTest(GetTestUrl("indexeddb", "blobs_use_quota.html")); | 417 SimpleTest(GetTestUrl("indexeddb", "blobs_use_quota.html")); |
| 409 } | 418 } |
| 410 | 419 |
| 411 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DeleteForOriginDeletesBlobs) { | 420 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DeleteForOriginDeletesBlobs) { |
| 412 SimpleTest(GetTestUrl("indexeddb", "write_20mb_blob.html")); | 421 SimpleTest(GetTestUrl("indexeddb", "write_20mb_blob.html")); |
| 413 int64 size = RequestDiskUsage(); | 422 int64 size = RequestDiskUsage(); |
| 414 // This assertion assumes that we do not compress blobs. | 423 // This assertion assumes that we do not compress blobs. |
| 415 EXPECT_GT(size, 20 << 20 /* 20 MB */); | 424 EXPECT_GT(size, 20 << 20 /* 20 MB */); |
| 416 GetContext()->TaskRunner()->PostTask( | 425 GetContext()->TaskRunner()->PostTask( |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 command_line->AppendSwitch(switches::kSingleProcess); | 758 command_line->AppendSwitch(switches::kSingleProcess); |
| 750 } | 759 } |
| 751 }; | 760 }; |
| 752 | 761 |
| 753 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestSingleProcess, | 762 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestSingleProcess, |
| 754 RenderThreadShutdownTest) { | 763 RenderThreadShutdownTest) { |
| 755 SimpleTest(GetTestUrl("indexeddb", "shutdown_with_requests.html")); | 764 SimpleTest(GetTestUrl("indexeddb", "shutdown_with_requests.html")); |
| 756 } | 765 } |
| 757 | 766 |
| 758 } // namespace content | 767 } // namespace content |
| OLD | NEW |