| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "content/browser/appcache/appcache.h" | 9 #include "content/browser/appcache/appcache.h" |
| 10 #include "content/browser/appcache/appcache_backend_impl.h" | 10 #include "content/browser/appcache/appcache_backend_impl.h" |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 EXPECT_EQ(&service_, host.service()); | 523 EXPECT_EQ(&service_, host.service()); |
| 524 EXPECT_EQ(&mock_frontend_, host.frontend()); | 524 EXPECT_EQ(&mock_frontend_, host.frontend()); |
| 525 EXPECT_EQ(NULL, host.associated_cache()); | 525 EXPECT_EQ(NULL, host.associated_cache()); |
| 526 EXPECT_FALSE(host.is_selection_pending()); | 526 EXPECT_FALSE(host.is_selection_pending()); |
| 527 EXPECT_TRUE(host.preferred_manifest_url().is_empty()); | 527 EXPECT_TRUE(host.preferred_manifest_url().is_empty()); |
| 528 } | 528 } |
| 529 EXPECT_EQ(0, mock_quota_proxy->GetInUseCount(kDocAndOriginUrl)); | 529 EXPECT_EQ(0, mock_quota_proxy->GetInUseCount(kDocAndOriginUrl)); |
| 530 service_.set_quota_manager_proxy(NULL); | 530 service_.set_quota_manager_proxy(NULL); |
| 531 } | 531 } |
| 532 | 532 |
| 533 TEST_F(AppCacheHostTest, SelectCacheTwice) { |
| 534 AppCacheHost host(1, &mock_frontend_, &service_); |
| 535 const GURL kDocAndOriginUrl(GURL("http://whatever/").GetOrigin()); |
| 536 |
| 537 EXPECT_TRUE(host.SelectCache(kDocAndOriginUrl, kAppCacheNoCacheId, GURL())); |
| 538 |
| 539 // Select methods should bail if cache has already been selected. |
| 540 EXPECT_FALSE(host.SelectCache(kDocAndOriginUrl, kAppCacheNoCacheId, GURL())); |
| 541 EXPECT_FALSE(host.SelectCacheForWorker(0, 0)); |
| 542 EXPECT_FALSE(host.SelectCacheForSharedWorker(kAppCacheNoCacheId)); |
| 543 EXPECT_FALSE(host.MarkAsForeignEntry(kDocAndOriginUrl, kAppCacheNoCacheId)); |
| 544 } |
| 545 |
| 533 } // namespace content | 546 } // namespace content |
| OLD | NEW |