| 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 <stdint.h> |
| 6 |
| 5 #include <string> | 7 #include <string> |
| 6 | 8 |
| 7 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 8 #include "content/browser/appcache/appcache.h" | 10 #include "content/browser/appcache/appcache.h" |
| 9 #include "content/browser/appcache/appcache_group.h" | 11 #include "content/browser/appcache/appcache_group.h" |
| 10 #include "content/browser/appcache/appcache_host.h" | 12 #include "content/browser/appcache/appcache_host.h" |
| 11 #include "content/browser/appcache/appcache_update_job.h" | 13 #include "content/browser/appcache/appcache_update_job.h" |
| 12 #include "content/browser/appcache/mock_appcache_service.h" | 14 #include "content/browser/appcache/mock_appcache_service.h" |
| 13 #include "content/common/appcache_interfaces.h" | 15 #include "content/common/appcache_interfaces.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 44 int num_total, | 46 int num_total, |
| 45 int num_complete) override {} | 47 int num_complete) override {} |
| 46 | 48 |
| 47 void OnLogMessage(int host_id, | 49 void OnLogMessage(int host_id, |
| 48 content::AppCacheLogLevel log_level, | 50 content::AppCacheLogLevel log_level, |
| 49 const std::string& message) override {} | 51 const std::string& message) override {} |
| 50 | 52 |
| 51 void OnContentBlocked(int host_id, const GURL& manifest_url) override {} | 53 void OnContentBlocked(int host_id, const GURL& manifest_url) override {} |
| 52 | 54 |
| 53 int last_host_id_; | 55 int last_host_id_; |
| 54 int64 last_cache_id_; | 56 int64_t last_cache_id_; |
| 55 content::AppCacheStatus last_status_; | 57 content::AppCacheStatus last_status_; |
| 56 }; | 58 }; |
| 57 | 59 |
| 58 } // namespace anon | 60 } // namespace anon |
| 59 | 61 |
| 60 namespace content { | 62 namespace content { |
| 61 | 63 |
| 62 class TestUpdateObserver : public AppCacheGroup::UpdateObserver { | 64 class TestUpdateObserver : public AppCacheGroup::UpdateObserver { |
| 63 public: | 65 public: |
| 64 TestUpdateObserver() : update_completed_(false), group_has_cache_(false) { | 66 TestUpdateObserver() : update_completed_(false), group_has_cache_(false) { |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 EXPECT_TRUE(group->FindObserver(&host, group->observers_)); | 291 EXPECT_TRUE(group->FindObserver(&host, group->observers_)); |
| 290 | 292 |
| 291 // Delete update to cause it to complete. Verify host is notified. | 293 // Delete update to cause it to complete. Verify host is notified. |
| 292 delete group->update_job_; | 294 delete group->update_job_; |
| 293 EXPECT_EQ(AppCacheGroup::IDLE, group->update_status_); | 295 EXPECT_EQ(AppCacheGroup::IDLE, group->update_status_); |
| 294 EXPECT_TRUE(group->restart_update_task_.IsCancelled()); | 296 EXPECT_TRUE(group->restart_update_task_.IsCancelled()); |
| 295 EXPECT_TRUE(host.update_completed_); | 297 EXPECT_TRUE(host.update_completed_); |
| 296 } | 298 } |
| 297 | 299 |
| 298 } // namespace content | 300 } // namespace content |
| OLD | NEW |