| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/offline_pages/background/request_queue_store.h" | 5 #include "components/offline_pages/background/request_queue_store.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 kNone, | 33 kNone, |
| 34 kFalse, | 34 kFalse, |
| 35 kTrue, | 35 kTrue, |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 bool operator==(const SavePageRequest& lhs, const SavePageRequest& rhs) { | 38 bool operator==(const SavePageRequest& lhs, const SavePageRequest& rhs) { |
| 39 return lhs.request_id() == rhs.request_id() && lhs.url() == rhs.url() && | 39 return lhs.request_id() == rhs.request_id() && lhs.url() == rhs.url() && |
| 40 lhs.client_id() == rhs.client_id() && | 40 lhs.client_id() == rhs.client_id() && |
| 41 lhs.creation_time() == rhs.creation_time() && | 41 lhs.creation_time() == rhs.creation_time() && |
| 42 lhs.activation_time() == rhs.activation_time() && | 42 lhs.activation_time() == rhs.activation_time() && |
| 43 lhs.attempt_count() == rhs.attempt_count() && | 43 lhs.started_attempt_count() == rhs.started_attempt_count() && |
| 44 lhs.last_attempt_time() == rhs.last_attempt_time(); | 44 lhs.completed_attempt_count() == rhs.completed_attempt_count() && |
| 45 lhs.last_attempt_time() == rhs.last_attempt_time() && |
| 46 lhs.request_state() == rhs.request_state(); |
| 45 } | 47 } |
| 46 | 48 |
| 47 } // namespace | 49 } // namespace |
| 48 | 50 |
| 49 // Class that serves as a base for testing different implementations of the | 51 // Class that serves as a base for testing different implementations of the |
| 50 // |RequestQueueStore|. Specific implementations extend the templatized version | 52 // |RequestQueueStore|. Specific implementations extend the templatized version |
| 51 // of this class and provide appropriate store factory. | 53 // of this class and provide appropriate store factory. |
| 52 class RequestQueueStoreTestBase : public testing::Test { | 54 class RequestQueueStoreTestBase : public testing::Test { |
| 53 public: | 55 public: |
| 54 RequestQueueStoreTestBase(); | 56 RequestQueueStoreTestBase(); |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 store->GetRequests(base::Bind(&RequestQueueStoreTestBase::GetRequestsDone, | 437 store->GetRequests(base::Bind(&RequestQueueStoreTestBase::GetRequestsDone, |
| 436 base::Unretained(this))); | 438 base::Unretained(this))); |
| 437 ASSERT_EQ(LastResult::kNone, this->last_result()); | 439 ASSERT_EQ(LastResult::kNone, this->last_result()); |
| 438 this->PumpLoop(); | 440 this->PumpLoop(); |
| 439 ASSERT_EQ(LastResult::kTrue, this->last_result()); | 441 ASSERT_EQ(LastResult::kTrue, this->last_result()); |
| 440 ASSERT_EQ(1ul, this->last_requests().size()); | 442 ASSERT_EQ(1ul, this->last_requests().size()); |
| 441 ASSERT_TRUE(original_request == this->last_requests()[0]); | 443 ASSERT_TRUE(original_request == this->last_requests()[0]); |
| 442 } | 444 } |
| 443 | 445 |
| 444 } // offline_pages | 446 } // offline_pages |
| OLD | NEW |