OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/scoped_ptr.h" | 6 #include "base/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 16 matching lines...) Expand all Loading... |
27 | 27 |
28 class MockFrontend : public AppCacheFrontend { | 28 class MockFrontend : public AppCacheFrontend { |
29 public: | 29 public: |
30 MockFrontend() | 30 MockFrontend() |
31 : last_host_id_(-222), last_cache_id_(-222), | 31 : last_host_id_(-222), last_cache_id_(-222), |
32 last_status_(appcache::OBSOLETE), | 32 last_status_(appcache::OBSOLETE), |
33 last_status_changed_(appcache::OBSOLETE), | 33 last_status_changed_(appcache::OBSOLETE), |
34 last_event_id_(appcache::OBSOLETE_EVENT) { | 34 last_event_id_(appcache::OBSOLETE_EVENT) { |
35 } | 35 } |
36 | 36 |
37 virtual void OnCacheSelected(int host_id, int64 cache_id , | 37 virtual void OnCacheSelected( |
38 appcache::Status status) { | 38 int host_id, const appcache::AppCacheInfo& info) { |
39 last_host_id_ = host_id; | 39 last_host_id_ = host_id; |
40 last_cache_id_ = cache_id; | 40 last_cache_id_ = info.cache_id; |
41 last_status_ = status; | 41 last_status_ = info.status; |
42 } | 42 } |
43 | 43 |
44 virtual void OnStatusChanged(const std::vector<int>& host_ids, | 44 virtual void OnStatusChanged(const std::vector<int>& host_ids, |
45 appcache::Status status) { | 45 appcache::Status status) { |
46 last_status_changed_ = status; | 46 last_status_changed_ = status; |
47 } | 47 } |
48 | 48 |
49 virtual void OnEventRaised(const std::vector<int>& host_ids, | 49 virtual void OnEventRaised(const std::vector<int>& host_ids, |
50 appcache::EventID event_id) { | 50 appcache::EventID event_id) { |
51 last_event_id_ = event_id; | 51 last_event_id_ = event_id; |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 | 347 |
348 // Simulate the parent being torn down. | 348 // Simulate the parent being torn down. |
349 backend_impl.UnregisterHost(kParentHostId); | 349 backend_impl.UnregisterHost(kParentHostId); |
350 parent_host = NULL; | 350 parent_host = NULL; |
351 EXPECT_EQ(NULL, backend_impl.GetHost(kParentHostId)); | 351 EXPECT_EQ(NULL, backend_impl.GetHost(kParentHostId)); |
352 EXPECT_EQ(NULL, worker_host->GetParentAppCacheHost()); | 352 EXPECT_EQ(NULL, worker_host->GetParentAppCacheHost()); |
353 } | 353 } |
354 | 354 |
355 } // namespace appcache | 355 } // namespace appcache |
356 | 356 |
OLD | NEW |