| 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 "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
| 6 | 6 |
| 7 #include "base/stl_util-inl.h" | 7 #include "base/stl_util-inl.h" |
| 8 #include "base/thread.h" | 8 #include "base/thread.h" |
| 9 #include "base/waitable_event.h" | 9 #include "base/waitable_event.h" |
| 10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 for (std::vector<AppCacheHost*>::iterator it = update_hosts_.begin(); | 179 for (std::vector<AppCacheHost*>::iterator it = update_hosts_.begin(); |
| 180 it != update_hosts_.end(); ++it) { | 180 it != update_hosts_.end(); ++it) { |
| 181 AppCacheHost* host = *it; | 181 AppCacheHost* host = *it; |
| 182 update_->StartUpdate(host, | 182 update_->StartUpdate(host, |
| 183 (host ? host->pending_master_entry_url() : GURL())); | 183 (host ? host->pending_master_entry_url() : GURL())); |
| 184 } | 184 } |
| 185 update_hosts_.clear(); // only trigger once | 185 update_hosts_.clear(); // only trigger once |
| 186 } | 186 } |
| 187 } | 187 } |
| 188 | 188 |
| 189 virtual void OnErrorEventRaised(const std::vector<int>& host_ids, |
| 190 const std::string& message) { |
| 191 OnEventRaised(host_ids, ERROR_EVENT); |
| 192 } |
| 193 |
| 189 virtual void OnProgressEventRaised(const std::vector<int>& host_ids, | 194 virtual void OnProgressEventRaised(const std::vector<int>& host_ids, |
| 190 const GURL& url, | 195 const GURL& url, |
| 191 int num_total, int num_complete) { | 196 int num_total, int num_complete) { |
| 192 if (!ignore_progress_events_) | 197 if (!ignore_progress_events_) |
| 193 OnEventRaised(host_ids, PROGRESS_EVENT); | 198 OnEventRaised(host_ids, PROGRESS_EVENT); |
| 194 | 199 |
| 195 if (verify_progress_events_) { | 200 if (verify_progress_events_) { |
| 196 EXPECT_GE(num_total, num_complete); | 201 EXPECT_GE(num_total, num_complete); |
| 197 EXPECT_GE(num_complete, 0); | 202 EXPECT_GE(num_complete, 0); |
| 198 | 203 |
| (...skipping 3167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3366 RunTestOnIOThread(&AppCacheUpdateJobTest::MultipleHeadersRefetchTest); | 3371 RunTestOnIOThread(&AppCacheUpdateJobTest::MultipleHeadersRefetchTest); |
| 3367 } | 3372 } |
| 3368 | 3373 |
| 3369 } // namespace appcache | 3374 } // namespace appcache |
| 3370 | 3375 |
| 3371 // AppCacheUpdateJobTest is expected to always live longer than the | 3376 // AppCacheUpdateJobTest is expected to always live longer than the |
| 3372 // runnable methods. This lets us call NewRunnableMethod on its instances. | 3377 // runnable methods. This lets us call NewRunnableMethod on its instances. |
| 3373 DISABLE_RUNNABLE_METHOD_REFCOUNT(appcache::AppCacheUpdateJobTest); | 3378 DISABLE_RUNNABLE_METHOD_REFCOUNT(appcache::AppCacheUpdateJobTest); |
| 3374 DISABLE_RUNNABLE_METHOD_REFCOUNT( | 3379 DISABLE_RUNNABLE_METHOD_REFCOUNT( |
| 3375 appcache::AppCacheUpdateJobTest::MockAppCachePolicy); | 3380 appcache::AppCacheUpdateJobTest::MockAppCachePolicy); |
| OLD | NEW |