| 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 "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 #include "webkit/appcache/appcache.h" | 8 #include "webkit/appcache/appcache.h" |
| 9 #include "webkit/appcache/appcache_group.h" | 9 #include "webkit/appcache/appcache_group.h" |
| 10 #include "webkit/appcache/appcache_host.h" | 10 #include "webkit/appcache/appcache_host.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 virtual void OnStatusChanged(const std::vector<int>& host_ids, | 42 virtual void OnStatusChanged(const std::vector<int>& host_ids, |
| 43 appcache::Status status) { | 43 appcache::Status status) { |
| 44 last_status_changed_ = status; | 44 last_status_changed_ = status; |
| 45 } | 45 } |
| 46 | 46 |
| 47 virtual void OnEventRaised(const std::vector<int>& host_ids, | 47 virtual void OnEventRaised(const std::vector<int>& host_ids, |
| 48 appcache::EventID event_id) { | 48 appcache::EventID event_id) { |
| 49 last_event_id_ = event_id; | 49 last_event_id_ = event_id; |
| 50 } | 50 } |
| 51 | 51 |
| 52 virtual void OnContentBlocked(int host_id) { |
| 53 } |
| 54 |
| 52 int last_host_id_; | 55 int last_host_id_; |
| 53 int64 last_cache_id_; | 56 int64 last_cache_id_; |
| 54 appcache::Status last_status_; | 57 appcache::Status last_status_; |
| 55 appcache::Status last_status_changed_; | 58 appcache::Status last_status_changed_; |
| 56 appcache::EventID last_event_id_; | 59 appcache::EventID last_event_id_; |
| 57 }; | 60 }; |
| 58 | 61 |
| 59 void GetStatusCallback(Status status, void* param) { | 62 void GetStatusCallback(Status status, void* param) { |
| 60 last_status_result_ = status; | 63 last_status_result_ = status; |
| 61 last_callback_param_ = param; | 64 last_callback_param_ = param; |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 group2->RemoveCache(cache5); | 296 group2->RemoveCache(cache5); |
| 294 EXPECT_FALSE(group2->HasCache()); | 297 EXPECT_FALSE(group2->HasCache()); |
| 295 host.group_being_updated_ = group2; | 298 host.group_being_updated_ = group2; |
| 296 host.OnUpdateComplete(group2); | 299 host.OnUpdateComplete(group2); |
| 297 EXPECT_FALSE(host.group_being_updated_); | 300 EXPECT_FALSE(host.group_being_updated_); |
| 298 EXPECT_FALSE(host.swappable_cache_.get()); // group2 had no newest cache | 301 EXPECT_FALSE(host.swappable_cache_.get()); // group2 had no newest cache |
| 299 } | 302 } |
| 300 | 303 |
| 301 } // namespace appcache | 304 } // namespace appcache |
| 302 | 305 |
| OLD | NEW |