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/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/files/scoped_temp_dir.h" |
7 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
8 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
9 #include "base/scoped_temp_dir.h" | 10 #include "content/browser/appcache/chrome_appcache_service.h" |
10 #include "content/browser/browser_thread_impl.h" | 11 #include "content/browser/browser_thread_impl.h" |
11 #include "content/browser/appcache/chrome_appcache_service.h" | |
12 #include "content/public/browser/resource_context.h" | 12 #include "content/public/browser/resource_context.h" |
13 #include "content/public/test/test_browser_context.h" | 13 #include "content/public/test/test_browser_context.h" |
14 #include "net/url_request/url_request_context_getter.h" | 14 #include "net/url_request/url_request_context_getter.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 #include "webkit/appcache/appcache_database.h" | 16 #include "webkit/appcache/appcache_database.h" |
17 #include "webkit/appcache/appcache_storage_impl.h" | 17 #include "webkit/appcache/appcache_storage_impl.h" |
18 #include "webkit/appcache/appcache_test_helper.h" | 18 #include "webkit/appcache/appcache_test_helper.h" |
19 #include "webkit/quota/mock_special_storage_policy.h" | 19 #include "webkit/quota/mock_special_storage_policy.h" |
20 | 20 |
21 #include <set> | 21 #include <set> |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 io_thread_(BrowserThread::IO, &message_loop_) { | 74 io_thread_(BrowserThread::IO, &message_loop_) { |
75 } | 75 } |
76 | 76 |
77 protected: | 77 protected: |
78 scoped_refptr<ChromeAppCacheService> CreateAppCacheService( | 78 scoped_refptr<ChromeAppCacheService> CreateAppCacheService( |
79 const FilePath& appcache_path, | 79 const FilePath& appcache_path, |
80 bool init_storage); | 80 bool init_storage); |
81 void InsertDataIntoAppCache(ChromeAppCacheService* appcache_service); | 81 void InsertDataIntoAppCache(ChromeAppCacheService* appcache_service); |
82 | 82 |
83 MessageLoop message_loop_; | 83 MessageLoop message_loop_; |
84 ScopedTempDir temp_dir_; | 84 base::ScopedTempDir temp_dir_; |
85 const GURL kProtectedManifestURL; | 85 const GURL kProtectedManifestURL; |
86 const GURL kNormalManifestURL; | 86 const GURL kNormalManifestURL; |
87 const GURL kSessionOnlyManifestURL; | 87 const GURL kSessionOnlyManifestURL; |
88 | 88 |
89 private: | 89 private: |
90 BrowserThreadImpl file_thread_; | 90 BrowserThreadImpl file_thread_; |
91 BrowserThreadImpl file_user_blocking_thread_; | 91 BrowserThreadImpl file_user_blocking_thread_; |
92 BrowserThreadImpl cache_thread_; | 92 BrowserThreadImpl cache_thread_; |
93 BrowserThreadImpl io_thread_; | 93 BrowserThreadImpl io_thread_; |
94 TestBrowserContext browser_context_; | 94 TestBrowserContext browser_context_; |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 EXPECT_TRUE(origins.find(kNormalManifestURL.GetOrigin()) != origins.end()); | 214 EXPECT_TRUE(origins.find(kNormalManifestURL.GetOrigin()) != origins.end()); |
215 EXPECT_TRUE(origins.find(kSessionOnlyManifestURL.GetOrigin()) != | 215 EXPECT_TRUE(origins.find(kSessionOnlyManifestURL.GetOrigin()) != |
216 origins.end()); | 216 origins.end()); |
217 | 217 |
218 // Delete and let cleanup tasks run prior to returning. | 218 // Delete and let cleanup tasks run prior to returning. |
219 appcache_service = NULL; | 219 appcache_service = NULL; |
220 message_loop_.RunUntilIdle(); | 220 message_loop_.RunUntilIdle(); |
221 } | 221 } |
222 | 222 |
223 } // namespace content | 223 } // namespace content |
OLD | NEW |