| 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/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/memory/ref_counted.h" | 6 #include "base/memory/ref_counted.h" |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/scoped_temp_dir.h" | 8 #include "base/scoped_temp_dir.h" |
| 9 #include "content/browser/appcache/chrome_appcache_service.h" | 9 #include "content/browser/appcache/chrome_appcache_service.h" |
| 10 #include "content/browser/browser_thread.h" | 10 #include "content/test/test_browser_thread.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 12 #include "webkit/appcache/appcache_database.h" | 12 #include "webkit/appcache/appcache_database.h" |
| 13 #include "webkit/appcache/appcache_storage_impl.h" | 13 #include "webkit/appcache/appcache_storage_impl.h" |
| 14 #include "webkit/appcache/appcache_test_helper.h" | 14 #include "webkit/appcache/appcache_test_helper.h" |
| 15 #include "webkit/quota/mock_special_storage_policy.h" | 15 #include "webkit/quota/mock_special_storage_policy.h" |
| 16 | 16 |
| 17 #include <set> | 17 #include <set> |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 const FilePath::CharType kTestingAppCacheDirname[] = | 20 const FilePath::CharType kTestingAppCacheDirname[] = |
| (...skipping 28 matching lines...) Expand all Loading... |
| 49 bool init_storage); | 49 bool init_storage); |
| 50 void InsertDataIntoAppCache(ChromeAppCacheService* appcache_service); | 50 void InsertDataIntoAppCache(ChromeAppCacheService* appcache_service); |
| 51 | 51 |
| 52 MessageLoop message_loop_; | 52 MessageLoop message_loop_; |
| 53 ScopedTempDir temp_dir_; | 53 ScopedTempDir temp_dir_; |
| 54 const GURL kProtectedManifestURL; | 54 const GURL kProtectedManifestURL; |
| 55 const GURL kNormalManifestURL; | 55 const GURL kNormalManifestURL; |
| 56 const GURL kSessionOnlyManifestURL; | 56 const GURL kSessionOnlyManifestURL; |
| 57 | 57 |
| 58 private: | 58 private: |
| 59 BrowserThread db_thread_; | 59 content::TestBrowserThread db_thread_; |
| 60 BrowserThread file_thread_; | 60 content::TestBrowserThread file_thread_; |
| 61 BrowserThread cache_thread_; | 61 content::TestBrowserThread cache_thread_; |
| 62 BrowserThread io_thread_; | 62 content::TestBrowserThread io_thread_; |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 scoped_refptr<ChromeAppCacheService> | 65 scoped_refptr<ChromeAppCacheService> |
| 66 ChromeAppCacheServiceTest::CreateAppCacheService( | 66 ChromeAppCacheServiceTest::CreateAppCacheService( |
| 67 const FilePath& appcache_path, | 67 const FilePath& appcache_path, |
| 68 bool init_storage) { | 68 bool init_storage) { |
| 69 scoped_refptr<ChromeAppCacheService> appcache_service = | 69 scoped_refptr<ChromeAppCacheService> appcache_service = |
| 70 new ChromeAppCacheService(NULL); | 70 new ChromeAppCacheService(NULL); |
| 71 const content::ResourceContext* resource_context = NULL; | 71 const content::ResourceContext* resource_context = NULL; |
| 72 scoped_refptr<quota::MockSpecialStoragePolicy> mock_policy = | 72 scoped_refptr<quota::MockSpecialStoragePolicy> mock_policy = |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 EXPECT_TRUE(origins.find(kNormalManifestURL.GetOrigin()) == origins.end()); | 179 EXPECT_TRUE(origins.find(kNormalManifestURL.GetOrigin()) == origins.end()); |
| 180 EXPECT_TRUE(origins.find(kSessionOnlyManifestURL.GetOrigin()) == | 180 EXPECT_TRUE(origins.find(kSessionOnlyManifestURL.GetOrigin()) == |
| 181 origins.end()); | 181 origins.end()); |
| 182 | 182 |
| 183 // Delete and let cleanup tasks run prior to returning. | 183 // Delete and let cleanup tasks run prior to returning. |
| 184 appcache_service = NULL; | 184 appcache_service = NULL; |
| 185 message_loop_.RunAllPending(); | 185 message_loop_.RunAllPending(); |
| 186 } | 186 } |
| 187 | 187 |
| 188 } // namespace appcache | 188 } // namespace appcache |
| OLD | NEW |