| 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/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/files/file.h" | 8 #include "base/files/file.h" |
| 9 #include "base/files/file_enumerator.h" | 9 #include "base/files/file_enumerator.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 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 "webkit/browser/database/database_util.h" | 37 #include "webkit/browser/database/database_util.h" |
| 38 #include "webkit/browser/quota/quota_manager.h" | 38 #include "webkit/browser/quota/quota_manager.h" |
| 39 | 39 |
| 40 using base::ASCIIToUTF16; | 40 using base::ASCIIToUTF16; |
| 41 using quota::QuotaManager; | 41 using storage::QuotaManager; |
| 42 using webkit_database::DatabaseUtil; | 42 using storage::DatabaseUtil; |
| 43 | 43 |
| 44 namespace content { | 44 namespace content { |
| 45 | 45 |
| 46 // This browser test is aimed towards exercising the IndexedDB bindings and | 46 // This browser test is aimed towards exercising the IndexedDB bindings and |
| 47 // the actual implementation that lives in the browser side. | 47 // the actual implementation that lives in the browser side. |
| 48 class IndexedDBBrowserTest : public ContentBrowserTest { | 48 class IndexedDBBrowserTest : public ContentBrowserTest { |
| 49 public: | 49 public: |
| 50 IndexedDBBrowserTest() : disk_usage_(-1) {} | 50 IndexedDBBrowserTest() : disk_usage_(-1) {} |
| 51 | 51 |
| 52 virtual void SetUp() OVERRIDE { | 52 virtual void SetUp() OVERRIDE { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 } | 118 } |
| 119 | 119 |
| 120 static void SetTempQuota(int64 bytes, scoped_refptr<QuotaManager> qm) { | 120 static void SetTempQuota(int64 bytes, scoped_refptr<QuotaManager> qm) { |
| 121 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { | 121 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { |
| 122 BrowserThread::PostTask( | 122 BrowserThread::PostTask( |
| 123 BrowserThread::IO, FROM_HERE, | 123 BrowserThread::IO, FROM_HERE, |
| 124 base::Bind(&IndexedDBBrowserTest::SetTempQuota, bytes, qm)); | 124 base::Bind(&IndexedDBBrowserTest::SetTempQuota, bytes, qm)); |
| 125 return; | 125 return; |
| 126 } | 126 } |
| 127 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 127 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 128 qm->SetTemporaryGlobalOverrideQuota(bytes, quota::QuotaCallback()); | 128 qm->SetTemporaryGlobalOverrideQuota(bytes, storage::QuotaCallback()); |
| 129 // Don't return until the quota has been set. | 129 // Don't return until the quota has been set. |
| 130 scoped_refptr<base::ThreadTestHelper> helper(new base::ThreadTestHelper( | 130 scoped_refptr<base::ThreadTestHelper> helper(new base::ThreadTestHelper( |
| 131 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB))); | 131 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB))); |
| 132 ASSERT_TRUE(helper->Run()); | 132 ASSERT_TRUE(helper->Run()); |
| 133 } | 133 } |
| 134 | 134 |
| 135 virtual int64 RequestDiskUsage() { | 135 virtual int64 RequestDiskUsage() { |
| 136 PostTaskAndReplyWithResult( | 136 PostTaskAndReplyWithResult( |
| 137 GetContext()->TaskRunner(), | 137 GetContext()->TaskRunner(), |
| 138 FROM_HERE, | 138 FROM_HERE, |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 command_line->AppendSwitch(switches::kSingleProcess); | 727 command_line->AppendSwitch(switches::kSingleProcess); |
| 728 } | 728 } |
| 729 }; | 729 }; |
| 730 | 730 |
| 731 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestSingleProcess, | 731 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestSingleProcess, |
| 732 RenderThreadShutdownTest) { | 732 RenderThreadShutdownTest) { |
| 733 SimpleTest(GetTestUrl("indexeddb", "shutdown_with_requests.html")); | 733 SimpleTest(GetTestUrl("indexeddb", "shutdown_with_requests.html")); |
| 734 } | 734 } |
| 735 | 735 |
| 736 } // namespace content | 736 } // namespace content |
| OLD | NEW |