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/callback.h" | 5 #include "base/callback.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "net/url_request/url_request.h" | 7 #include "net/url_request/url_request.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "webkit/appcache/appcache.h" | 9 #include "webkit/appcache/appcache.h" |
10 #include "webkit/appcache/appcache_backend_impl.h" | 10 #include "webkit/appcache/appcache_backend_impl.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 EXPECT_EQ(1, mock_frontend_.last_host_id_); | 149 EXPECT_EQ(1, mock_frontend_.last_host_id_); |
150 EXPECT_EQ(kNoCacheId, mock_frontend_.last_cache_id_); | 150 EXPECT_EQ(kNoCacheId, mock_frontend_.last_cache_id_); |
151 EXPECT_EQ(UNCACHED, mock_frontend_.last_status_); | 151 EXPECT_EQ(UNCACHED, mock_frontend_.last_status_); |
152 | 152 |
153 // Otherwise, see that it respond as if there is no cache selected. | 153 // Otherwise, see that it respond as if there is no cache selected. |
154 EXPECT_EQ(1, host.host_id()); | 154 EXPECT_EQ(1, host.host_id()); |
155 EXPECT_EQ(&service_, host.service()); | 155 EXPECT_EQ(&service_, host.service()); |
156 EXPECT_EQ(&mock_frontend_, host.frontend()); | 156 EXPECT_EQ(&mock_frontend_, host.frontend()); |
157 EXPECT_EQ(NULL, host.associated_cache()); | 157 EXPECT_EQ(NULL, host.associated_cache()); |
158 EXPECT_FALSE(host.is_selection_pending()); | 158 EXPECT_FALSE(host.is_selection_pending()); |
| 159 EXPECT_TRUE(host.preferred_manifest_url().is_empty()); |
159 } | 160 } |
160 | 161 |
161 TEST_F(AppCacheHostTest, ForeignEntry) { | 162 TEST_F(AppCacheHostTest, ForeignEntry) { |
162 // Reset our mock frontend | 163 // Reset our mock frontend |
163 mock_frontend_.last_cache_id_ = -333; | 164 mock_frontend_.last_cache_id_ = -333; |
164 mock_frontend_.last_host_id_ = -333; | 165 mock_frontend_.last_host_id_ = -333; |
165 mock_frontend_.last_status_ = OBSOLETE; | 166 mock_frontend_.last_status_ = OBSOLETE; |
166 | 167 |
167 // Precondition, a cache with an entry that is not marked as foreign. | 168 // Precondition, a cache with an entry that is not marked as foreign. |
168 const int kCacheId = 22; | 169 const int kCacheId = 22; |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 | 382 |
382 // Simulate the parent being torn down. | 383 // Simulate the parent being torn down. |
383 backend_impl.UnregisterHost(kParentHostId); | 384 backend_impl.UnregisterHost(kParentHostId); |
384 parent_host = NULL; | 385 parent_host = NULL; |
385 EXPECT_EQ(NULL, backend_impl.GetHost(kParentHostId)); | 386 EXPECT_EQ(NULL, backend_impl.GetHost(kParentHostId)); |
386 EXPECT_EQ(NULL, worker_host->GetParentAppCacheHost()); | 387 EXPECT_EQ(NULL, worker_host->GetParentAppCacheHost()); |
387 } | 388 } |
388 | 389 |
389 } // namespace appcache | 390 } // namespace appcache |
390 | 391 |
OLD | NEW |