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/files/file_util.h" | 6 #include "base/files/file_util.h" |
7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "content/browser/appcache/appcache_database.h" | 10 #include "content/browser/appcache/appcache_database.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 const char kSessionOnlyManifest[] = "http://www.sessiononly.com/cache.manifest"; | 32 const char kSessionOnlyManifest[] = "http://www.sessiononly.com/cache.manifest"; |
33 | 33 |
34 class MockURLRequestContextGetter : public net::URLRequestContextGetter { | 34 class MockURLRequestContextGetter : public net::URLRequestContextGetter { |
35 public: | 35 public: |
36 MockURLRequestContextGetter( | 36 MockURLRequestContextGetter( |
37 net::URLRequestContext* context, | 37 net::URLRequestContext* context, |
38 base::MessageLoopProxy* message_loop_proxy) | 38 base::MessageLoopProxy* message_loop_proxy) |
39 : context_(context), message_loop_proxy_(message_loop_proxy) { | 39 : context_(context), message_loop_proxy_(message_loop_proxy) { |
40 } | 40 } |
41 | 41 |
42 virtual net::URLRequestContext* GetURLRequestContext() override { | 42 net::URLRequestContext* GetURLRequestContext() override { return context_; } |
43 return context_; | |
44 } | |
45 | 43 |
46 virtual scoped_refptr<base::SingleThreadTaskRunner> | 44 scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner() |
47 GetNetworkTaskRunner() const override { | 45 const override { |
48 return message_loop_proxy_; | 46 return message_loop_proxy_; |
49 } | 47 } |
50 | 48 |
51 protected: | 49 protected: |
52 virtual ~MockURLRequestContextGetter() {} | 50 ~MockURLRequestContextGetter() override {} |
53 | 51 |
54 private: | 52 private: |
55 net::URLRequestContext* context_; | 53 net::URLRequestContext* context_; |
56 scoped_refptr<base::SingleThreadTaskRunner> message_loop_proxy_; | 54 scoped_refptr<base::SingleThreadTaskRunner> message_loop_proxy_; |
57 }; | 55 }; |
58 | 56 |
59 } // namespace | 57 } // namespace |
60 | 58 |
61 class ChromeAppCacheServiceTest : public testing::Test { | 59 class ChromeAppCacheServiceTest : public testing::Test { |
62 public: | 60 public: |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 EXPECT_TRUE(origins.find(kNormalManifestURL.GetOrigin()) != origins.end()); | 212 EXPECT_TRUE(origins.find(kNormalManifestURL.GetOrigin()) != origins.end()); |
215 EXPECT_TRUE(origins.find(kSessionOnlyManifestURL.GetOrigin()) != | 213 EXPECT_TRUE(origins.find(kSessionOnlyManifestURL.GetOrigin()) != |
216 origins.end()); | 214 origins.end()); |
217 | 215 |
218 // Delete and let cleanup tasks run prior to returning. | 216 // Delete and let cleanup tasks run prior to returning. |
219 appcache_service = NULL; | 217 appcache_service = NULL; |
220 message_loop_.RunUntilIdle(); | 218 message_loop_.RunUntilIdle(); |
221 } | 219 } |
222 | 220 |
223 } // namespace content | 221 } // namespace content |
OLD | NEW |