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 "base/bind.h" |
5 #include "base/command_line.h" | 6 #include "base/command_line.h" |
6 #include "base/file_path.h" | 7 #include "base/file_path.h" |
7 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
8 #include "base/test/thread_test_helper.h" | 9 #include "base/test/thread_test_helper.h" |
9 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/test/base/in_process_browser_test.h" | 11 #include "chrome/test/base/in_process_browser_test.h" |
11 #include "chrome/test/base/testing_profile.h" | 12 #include "chrome/test/base/testing_profile.h" |
12 #include "chrome/test/base/ui_test_utils.h" | 13 #include "chrome/test/base/ui_test_utils.h" |
13 #include "content/browser/tab_contents/tab_contents.h" | 14 #include "content/browser/tab_contents/tab_contents.h" |
14 #include "content/public/common/content_switches.h" | 15 #include "content/public/common/content_switches.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 } | 65 } |
65 | 66 |
66 static void SetTempQuota(int64 bytes, scoped_refptr<QuotaManager> qm) { | 67 static void SetTempQuota(int64 bytes, scoped_refptr<QuotaManager> qm) { |
67 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { | 68 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { |
68 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 69 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
69 NewRunnableFunction(&FileSystemBrowserTestWithLowQuota::SetTempQuota, | 70 NewRunnableFunction(&FileSystemBrowserTestWithLowQuota::SetTempQuota, |
70 bytes, qm)); | 71 bytes, qm)); |
71 return; | 72 return; |
72 } | 73 } |
73 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 74 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
74 qm->SetTemporaryGlobalOverrideQuota(bytes, NULL); | 75 qm->SetTemporaryGlobalOverrideQuota(bytes, quota::QuotaCallback()); |
75 // Don't return until the quota has been set. | 76 // Don't return until the quota has been set. |
76 scoped_refptr<base::ThreadTestHelper> helper( | 77 scoped_refptr<base::ThreadTestHelper> helper( |
77 new base::ThreadTestHelper( | 78 new base::ThreadTestHelper( |
78 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB))); | 79 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB))); |
79 ASSERT_TRUE(helper->Run()); | 80 ASSERT_TRUE(helper->Run()); |
80 } | 81 } |
81 }; | 82 }; |
82 | 83 |
83 IN_PROC_BROWSER_TEST_F(FileSystemBrowserTest, RequestTest) { | 84 IN_PROC_BROWSER_TEST_F(FileSystemBrowserTest, RequestTest) { |
84 SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("request_test.html")))); | 85 SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("request_test.html")))); |
85 } | 86 } |
86 | 87 |
87 IN_PROC_BROWSER_TEST_F(FileSystemBrowserTest, CreateTest) { | 88 IN_PROC_BROWSER_TEST_F(FileSystemBrowserTest, CreateTest) { |
88 SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("create_test.html")))); | 89 SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("create_test.html")))); |
89 } | 90 } |
90 | 91 |
91 IN_PROC_BROWSER_TEST_F(FileSystemBrowserTestWithLowQuota, QuotaTest) { | 92 IN_PROC_BROWSER_TEST_F(FileSystemBrowserTestWithLowQuota, QuotaTest) { |
92 SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("quota_test.html")))); | 93 SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("quota_test.html")))); |
93 } | 94 } |
OLD | NEW |