| 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/bind.h" |
| 6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/scoped_temp_dir.h" | 9 #include "base/scoped_temp_dir.h" |
| 10 #include "content/browser/browser_thread_impl.h" | 10 #include "content/browser/browser_thread_impl.h" |
| 11 #include "content/browser/appcache/chrome_appcache_service.h" | 11 #include "content/browser/appcache/chrome_appcache_service.h" |
| 12 #include "content/test/test_browser_context.h" | 12 #include "content/public/test/test_browser_context.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 #include "webkit/appcache/appcache_database.h" | 14 #include "webkit/appcache/appcache_database.h" |
| 15 #include "webkit/appcache/appcache_storage_impl.h" | 15 #include "webkit/appcache/appcache_storage_impl.h" |
| 16 #include "webkit/appcache/appcache_test_helper.h" | 16 #include "webkit/appcache/appcache_test_helper.h" |
| 17 #include "webkit/quota/mock_special_storage_policy.h" | 17 #include "webkit/quota/mock_special_storage_policy.h" |
| 18 | 18 |
| 19 #include <set> | 19 #include <set> |
| 20 | 20 |
| 21 using content::BrowserThread; | 21 using content::BrowserThread; |
| 22 using content::BrowserThreadImpl; | 22 using content::BrowserThreadImpl; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 ScopedTempDir temp_dir_; | 59 ScopedTempDir temp_dir_; |
| 60 const GURL kProtectedManifestURL; | 60 const GURL kProtectedManifestURL; |
| 61 const GURL kNormalManifestURL; | 61 const GURL kNormalManifestURL; |
| 62 const GURL kSessionOnlyManifestURL; | 62 const GURL kSessionOnlyManifestURL; |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 BrowserThreadImpl file_thread_; | 65 BrowserThreadImpl file_thread_; |
| 66 BrowserThreadImpl file_user_blocking_thread_; | 66 BrowserThreadImpl file_user_blocking_thread_; |
| 67 BrowserThreadImpl cache_thread_; | 67 BrowserThreadImpl cache_thread_; |
| 68 BrowserThreadImpl io_thread_; | 68 BrowserThreadImpl io_thread_; |
| 69 TestBrowserContext browser_context_; | 69 content::TestBrowserContext browser_context_; |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 scoped_refptr<ChromeAppCacheService> | 72 scoped_refptr<ChromeAppCacheService> |
| 73 ChromeAppCacheServiceTest::CreateAppCacheService( | 73 ChromeAppCacheServiceTest::CreateAppCacheService( |
| 74 const FilePath& appcache_path, | 74 const FilePath& appcache_path, |
| 75 bool init_storage) { | 75 bool init_storage) { |
| 76 scoped_refptr<ChromeAppCacheService> appcache_service = | 76 scoped_refptr<ChromeAppCacheService> appcache_service = |
| 77 new ChromeAppCacheService(NULL); | 77 new ChromeAppCacheService(NULL); |
| 78 scoped_refptr<quota::MockSpecialStoragePolicy> mock_policy = | 78 scoped_refptr<quota::MockSpecialStoragePolicy> mock_policy = |
| 79 new quota::MockSpecialStoragePolicy; | 79 new quota::MockSpecialStoragePolicy; |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 EXPECT_TRUE(origins.find(kNormalManifestURL.GetOrigin()) != origins.end()); | 223 EXPECT_TRUE(origins.find(kNormalManifestURL.GetOrigin()) != origins.end()); |
| 224 EXPECT_TRUE(origins.find(kSessionOnlyManifestURL.GetOrigin()) != | 224 EXPECT_TRUE(origins.find(kSessionOnlyManifestURL.GetOrigin()) != |
| 225 origins.end()); | 225 origins.end()); |
| 226 | 226 |
| 227 // Delete and let cleanup tasks run prior to returning. | 227 // Delete and let cleanup tasks run prior to returning. |
| 228 appcache_service = NULL; | 228 appcache_service = NULL; |
| 229 message_loop_.RunAllPending(); | 229 message_loop_.RunAllPending(); |
| 230 } | 230 } |
| 231 | 231 |
| 232 } // namespace appcache | 232 } // namespace appcache |
| OLD | NEW |