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_path.h" | 7 #include "base/file_path.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/test/thread_test_helper.h" | 9 #include "base/test/thread_test_helper.h" |
10 #include "content/browser/web_contents/web_contents_impl.h" | 10 #include "content/browser/web_contents/web_contents_impl.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
48 }; | 48 }; |
49 | 49 |
50 class FileSystemBrowserTestWithLowQuota : public FileSystemBrowserTest { | 50 class FileSystemBrowserTestWithLowQuota : public FileSystemBrowserTest { |
51 public: | 51 public: |
52 virtual void SetUpOnMainThread() { | 52 virtual void SetUpOnMainThread() { |
53 const int kInitialQuotaKilobytes = 5000; | 53 const int kInitialQuotaKilobytes = 5000; |
54 const int kTemporaryStorageQuotaMaxSize = | 54 const int kTemporaryStorageQuotaMaxSize = |
55 kInitialQuotaKilobytes * 1024 * QuotaManager::kPerHostTemporaryPortion; | 55 kInitialQuotaKilobytes * 1024 * QuotaManager::kPerHostTemporaryPortion; |
56 SetTempQuota( | 56 SetTempQuota( |
57 kTemporaryStorageQuotaMaxSize, | 57 kTemporaryStorageQuotaMaxSize, |
58 BrowserContext::GetQuotaManager( | 58 BrowserContext::GetDefaultQuotaManager( |
awong
2012/08/10 14:17:20
Can we switch this to using the the active site in
| |
59 shell()->web_contents()->GetBrowserContext())); | 59 shell()->web_contents()->GetBrowserContext())); |
60 } | 60 } |
61 | 61 |
62 static void SetTempQuota(int64 bytes, scoped_refptr<QuotaManager> qm) { | 62 static void SetTempQuota(int64 bytes, scoped_refptr<QuotaManager> qm) { |
63 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { | 63 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { |
64 BrowserThread::PostTask( | 64 BrowserThread::PostTask( |
65 BrowserThread::IO, FROM_HERE, | 65 BrowserThread::IO, FROM_HERE, |
66 base::Bind(&FileSystemBrowserTestWithLowQuota::SetTempQuota, bytes, | 66 base::Bind(&FileSystemBrowserTestWithLowQuota::SetTempQuota, bytes, |
67 qm)); | 67 qm)); |
68 return; | 68 return; |
(...skipping 14 matching lines...) Expand all Loading... | |
83 | 83 |
84 IN_PROC_BROWSER_TEST_F(FileSystemBrowserTest, CreateTest) { | 84 IN_PROC_BROWSER_TEST_F(FileSystemBrowserTest, CreateTest) { |
85 SimpleTest(GetTestUrl("fileapi", "create_test.html")); | 85 SimpleTest(GetTestUrl("fileapi", "create_test.html")); |
86 } | 86 } |
87 | 87 |
88 IN_PROC_BROWSER_TEST_F(FileSystemBrowserTestWithLowQuota, QuotaTest) { | 88 IN_PROC_BROWSER_TEST_F(FileSystemBrowserTestWithLowQuota, QuotaTest) { |
89 SimpleTest(GetTestUrl("fileapi", "quota_test.html")); | 89 SimpleTest(GetTestUrl("fileapi", "quota_test.html")); |
90 } | 90 } |
91 | 91 |
92 } // namespace content | 92 } // namespace content |
OLD | NEW |