OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/offline_pages/offline_page_metadata_store_impl.h" | 5 #include "chrome/browser/offline_pages/offline_page_metadata_store_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 void OfflinePageMetadataStoreImplTest::PumpLoop() { | 67 void OfflinePageMetadataStoreImplTest::PumpLoop() { |
68 run_loop_.reset(new base::RunLoop()); | 68 run_loop_.reset(new base::RunLoop()); |
69 run_loop_->Run(); | 69 run_loop_->Run(); |
70 } | 70 } |
71 | 71 |
72 scoped_ptr<OfflinePageMetadataStoreImpl> | 72 scoped_ptr<OfflinePageMetadataStoreImpl> |
73 OfflinePageMetadataStoreImplTest::BuildStore() { | 73 OfflinePageMetadataStoreImplTest::BuildStore() { |
74 scoped_ptr<ProtoDatabaseImpl<offline_pages::OfflinePageEntry>> db( | 74 scoped_ptr<ProtoDatabaseImpl<offline_pages::OfflinePageEntry>> db( |
75 new ProtoDatabaseImpl<offline_pages::OfflinePageEntry>( | 75 new ProtoDatabaseImpl<offline_pages::OfflinePageEntry>( |
76 message_loop_.message_loop_proxy())); | 76 message_loop_.task_runner())); |
77 return scoped_ptr<OfflinePageMetadataStoreImpl>( | 77 return scoped_ptr<OfflinePageMetadataStoreImpl>( |
78 new OfflinePageMetadataStoreImpl(db.Pass(), temp_directory_.path())); | 78 new OfflinePageMetadataStoreImpl(db.Pass(), temp_directory_.path())); |
79 } | 79 } |
80 | 80 |
81 void OfflinePageMetadataStoreImplTest::LoadCallback( | 81 void OfflinePageMetadataStoreImplTest::LoadCallback( |
82 bool status, | 82 bool status, |
83 const std::vector<OfflinePageItem>& offline_pages) { | 83 const std::vector<OfflinePageItem>& offline_pages) { |
84 last_called_callback_ = LOAD; | 84 last_called_callback_ = LOAD; |
85 last_status_ = status ? STATUS_TRUE : STATUS_FALSE; | 85 last_status_ = status ? STATUS_TRUE : STATUS_FALSE; |
86 offline_pages_.swap(const_cast<std::vector<OfflinePageItem>&>(offline_pages)); | 86 offline_pages_.swap(const_cast<std::vector<OfflinePageItem>&>(offline_pages)); |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 EXPECT_EQ(offline_page_2.file_path, offline_pages_[0].file_path); | 299 EXPECT_EQ(offline_page_2.file_path, offline_pages_[0].file_path); |
300 EXPECT_EQ(offline_page_2.file_size, offline_pages_[0].file_size); | 300 EXPECT_EQ(offline_page_2.file_size, offline_pages_[0].file_size); |
301 EXPECT_EQ(offline_page_2.creation_time, offline_pages_[0].creation_time); | 301 EXPECT_EQ(offline_page_2.creation_time, offline_pages_[0].creation_time); |
302 EXPECT_EQ(offline_page_2.last_access_time, | 302 EXPECT_EQ(offline_page_2.last_access_time, |
303 offline_pages_[0].last_access_time); | 303 offline_pages_[0].last_access_time); |
304 } | 304 } |
305 | 305 |
306 } // namespace | 306 } // namespace |
307 | 307 |
308 } // namespace offline_pages | 308 } // namespace offline_pages |
OLD | NEW |