Chromium Code Reviews| 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 "components/offline_pages/offline_page_metadata_store.h" | 5 #include "components/offline_pages/offline_page_metadata_store.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 23 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
| 24 | 24 |
| 25 namespace offline_pages { | 25 namespace offline_pages { |
| 26 | 26 |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| 29 #define OFFLINE_PAGES_TABLE_V1 "offlinepages_v1" | 29 #define OFFLINE_PAGES_TABLE_V1 "offlinepages_v1" |
| 30 | 30 |
| 31 const char kTestClientNamespace[] = "CLIENT_NAMESPACE"; | 31 const char kTestClientNamespace[] = "CLIENT_NAMESPACE"; |
| 32 const char kTestURL[] = "https://example.com"; | 32 const char kTestURL[] = "https://example.com"; |
| 33 const char kOriginalTestURL[] = "https://example.com/foo"; | |
| 33 const ClientId kTestClientId1(kTestClientNamespace, "1234"); | 34 const ClientId kTestClientId1(kTestClientNamespace, "1234"); |
| 34 const ClientId kTestClientId2(kTestClientNamespace, "5678"); | 35 const ClientId kTestClientId2(kTestClientNamespace, "5678"); |
| 35 const base::FilePath::CharType kFilePath[] = | 36 const base::FilePath::CharType kFilePath[] = |
| 36 FILE_PATH_LITERAL("/offline_pages/example_com.mhtml"); | 37 FILE_PATH_LITERAL("/offline_pages/example_com.mhtml"); |
| 37 int64_t kFileSize = 234567LL; | 38 int64_t kFileSize = 234567LL; |
| 38 int64_t kOfflineId = 12345LL; | 39 int64_t kOfflineId = 12345LL; |
| 39 | 40 |
| 40 // Build a store with outdated schema to simulate the upgrading process. | 41 // Build a store with outdated schema to simulate the upgrading process. |
| 41 // TODO(romax): move it to sql_unittests. | 42 // TODO(romax): move it to sql_unittests. |
| 42 void BuildTestStoreWithSchemaFromM52(const base::FilePath& file) { | 43 void BuildTestStoreWithSchemaFromM52(const base::FilePath& file) { |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 173 ASSERT_TRUE(statement.Run()); | 174 ASSERT_TRUE(statement.Run()); |
| 174 ASSERT_TRUE(connection.DoesTableExist(OFFLINE_PAGES_TABLE_V1)); | 175 ASSERT_TRUE(connection.DoesTableExist(OFFLINE_PAGES_TABLE_V1)); |
| 175 ASSERT_TRUE(connection.DoesColumnExist(OFFLINE_PAGES_TABLE_V1, "version")); | 176 ASSERT_TRUE(connection.DoesColumnExist(OFFLINE_PAGES_TABLE_V1, "version")); |
| 176 ASSERT_TRUE(connection.DoesColumnExist(OFFLINE_PAGES_TABLE_V1, "status")); | 177 ASSERT_TRUE(connection.DoesColumnExist(OFFLINE_PAGES_TABLE_V1, "status")); |
| 177 ASSERT_TRUE( | 178 ASSERT_TRUE( |
| 178 connection.DoesColumnExist(OFFLINE_PAGES_TABLE_V1, "user_initiated")); | 179 connection.DoesColumnExist(OFFLINE_PAGES_TABLE_V1, "user_initiated")); |
| 179 ASSERT_TRUE( | 180 ASSERT_TRUE( |
| 180 connection.DoesColumnExist(OFFLINE_PAGES_TABLE_V1, "offline_url")); | 181 connection.DoesColumnExist(OFFLINE_PAGES_TABLE_V1, "offline_url")); |
| 181 } | 182 } |
| 182 | 183 |
| 184 void BuildTestStoreWithSchemaFromM55(const base::FilePath& file) { | |
| 185 sql::Connection connection; | |
| 186 ASSERT_TRUE( | |
| 187 connection.Open(file.Append(FILE_PATH_LITERAL("OfflinePages.db")))); | |
| 188 ASSERT_TRUE(connection.is_open()); | |
| 189 ASSERT_TRUE(connection.BeginTransaction()); | |
| 190 ASSERT_TRUE(connection.Execute("CREATE TABLE " OFFLINE_PAGES_TABLE_V1 | |
| 191 "(offline_id INTEGER PRIMARY KEY NOT NULL, " | |
| 192 "creation_time INTEGER NOT NULL, " | |
| 193 "file_size INTEGER NOT NULL, " | |
| 194 "last_access_time INTEGER NOT NULL, " | |
| 195 "access_count INTEGER NOT NULL, " | |
| 196 "expiration_time INTEGER NOT NULL DEFAULT 0, " | |
| 197 "client_namespace VARCHAR NOT NULL, " | |
| 198 "client_id VARCHAR NOT NULL, " | |
| 199 "online_url VARCHAR NOT NULL, " | |
| 200 "file_path VARCHAR NOT NULL, " | |
| 201 "title VARCHAR NOT NULL DEFAULT ''" | |
| 202 ")")); | |
| 203 ASSERT_TRUE(connection.CommitTransaction()); | |
| 204 sql::Statement statement(connection.GetUniqueStatement( | |
| 205 "INSERT INTO " OFFLINE_PAGES_TABLE_V1 | |
| 206 "(offline_id, creation_time, file_size, " | |
| 207 "last_access_time, access_count, client_namespace, " | |
| 208 "client_id, online_url, file_path, expiration_time, title) " | |
| 209 "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")); | |
| 210 statement.BindInt64(0, kOfflineId); | |
| 211 statement.BindInt(1, 0); | |
| 212 statement.BindInt64(2, kFileSize); | |
| 213 statement.BindInt(3, 0); | |
| 214 statement.BindInt(4, 1); | |
| 215 statement.BindCString(5, kTestClientNamespace); | |
| 216 statement.BindString(6, kTestClientId2.id); | |
| 217 statement.BindCString(7, kTestURL); | |
| 218 statement.BindString(8, base::FilePath(kFilePath).MaybeAsASCII()); | |
| 219 statement.BindInt64(9, base::Time::Now().ToInternalValue()); | |
| 220 statement.BindString16(10, base::UTF8ToUTF16("Test title")); | |
| 221 ASSERT_TRUE(statement.Run()); | |
| 222 ASSERT_TRUE(connection.DoesTableExist(OFFLINE_PAGES_TABLE_V1)); | |
| 223 ASSERT_TRUE(connection.DoesColumnExist(OFFLINE_PAGES_TABLE_V1, "title")); | |
|
fgorski
2016/11/10 23:56:13
this needs updating to check for the new column.
jianli
2016/11/16 01:25:39
I think this is used to build the old store which
fgorski
2016/11/16 05:20:25
Exactly, that is why you assert false, as in line
jianli
2016/11/16 21:58:11
I applied the change to the wrong branch. I will i
| |
| 224 } | |
| 225 | |
| 183 class OfflinePageMetadataStoreFactory { | 226 class OfflinePageMetadataStoreFactory { |
| 184 public: | 227 public: |
| 185 OfflinePageMetadataStore* BuildStore(const base::FilePath& file_path) { | 228 OfflinePageMetadataStore* BuildStore(const base::FilePath& file_path) { |
| 186 OfflinePageMetadataStoreSQL* store = new OfflinePageMetadataStoreSQL( | 229 OfflinePageMetadataStoreSQL* store = new OfflinePageMetadataStoreSQL( |
| 187 base::ThreadTaskRunnerHandle::Get(), file_path); | 230 base::ThreadTaskRunnerHandle::Get(), file_path); |
| 188 return store; | 231 return store; |
| 189 } | 232 } |
| 190 | 233 |
| 191 OfflinePageMetadataStore* BuildStoreM52(const base::FilePath& file_path) { | 234 OfflinePageMetadataStore* BuildStoreM52(const base::FilePath& file_path) { |
| 192 BuildTestStoreWithSchemaFromM52(file_path); | 235 BuildTestStoreWithSchemaFromM52(file_path); |
| 193 OfflinePageMetadataStoreSQL* store = new OfflinePageMetadataStoreSQL( | 236 OfflinePageMetadataStoreSQL* store = new OfflinePageMetadataStoreSQL( |
| 194 base::ThreadTaskRunnerHandle::Get(), file_path); | 237 base::ThreadTaskRunnerHandle::Get(), file_path); |
| 195 return store; | 238 return store; |
| 196 } | 239 } |
| 197 | 240 |
| 198 OfflinePageMetadataStore* BuildStoreM53(const base::FilePath& file_path) { | 241 OfflinePageMetadataStore* BuildStoreM53(const base::FilePath& file_path) { |
| 199 BuildTestStoreWithSchemaFromM53(file_path); | 242 BuildTestStoreWithSchemaFromM53(file_path); |
| 200 OfflinePageMetadataStoreSQL* store = new OfflinePageMetadataStoreSQL( | 243 OfflinePageMetadataStoreSQL* store = new OfflinePageMetadataStoreSQL( |
| 201 base::ThreadTaskRunnerHandle::Get(), file_path); | 244 base::ThreadTaskRunnerHandle::Get(), file_path); |
| 202 return store; | 245 return store; |
| 203 } | 246 } |
| 204 | 247 |
| 205 OfflinePageMetadataStore* BuildStoreM54(const base::FilePath& file_path) { | 248 OfflinePageMetadataStore* BuildStoreM54(const base::FilePath& file_path) { |
| 206 BuildTestStoreWithSchemaFromM54(file_path); | 249 BuildTestStoreWithSchemaFromM54(file_path); |
| 207 OfflinePageMetadataStoreSQL* store = new OfflinePageMetadataStoreSQL( | 250 OfflinePageMetadataStoreSQL* store = new OfflinePageMetadataStoreSQL( |
| 208 base::ThreadTaskRunnerHandle::Get(), file_path); | 251 base::ThreadTaskRunnerHandle::Get(), file_path); |
| 209 return store; | 252 return store; |
| 210 } | 253 } |
| 254 | |
| 255 OfflinePageMetadataStore* BuildStoreM55(const base::FilePath& file_path) { | |
| 256 BuildTestStoreWithSchemaFromM55(file_path); | |
| 257 OfflinePageMetadataStoreSQL* store = new OfflinePageMetadataStoreSQL( | |
| 258 base::ThreadTaskRunnerHandle::Get(), file_path); | |
| 259 return store; | |
| 260 } | |
| 211 }; | 261 }; |
| 212 | 262 |
| 213 enum CalledCallback { NONE, LOAD, ADD, UPDATE, REMOVE, RESET }; | 263 enum CalledCallback { NONE, LOAD, ADD, UPDATE, REMOVE, RESET }; |
| 214 enum Status { STATUS_NONE, STATUS_TRUE, STATUS_FALSE }; | 264 enum Status { STATUS_NONE, STATUS_TRUE, STATUS_FALSE }; |
| 215 | 265 |
| 216 class OfflinePageMetadataStoreTest : public testing::Test { | 266 class OfflinePageMetadataStoreTest : public testing::Test { |
| 217 public: | 267 public: |
| 218 OfflinePageMetadataStoreTest(); | 268 OfflinePageMetadataStoreTest(); |
| 219 ~OfflinePageMetadataStoreTest() override; | 269 ~OfflinePageMetadataStoreTest() override; |
| 220 | 270 |
| 221 void TearDown() override { | 271 void TearDown() override { |
| 222 // Wait for all the pieces of the store to delete itself properly. | 272 // Wait for all the pieces of the store to delete itself properly. |
| 223 PumpLoop(); | 273 PumpLoop(); |
| 224 } | 274 } |
| 225 | 275 |
| 226 std::unique_ptr<OfflinePageMetadataStore> BuildStore(); | 276 std::unique_ptr<OfflinePageMetadataStore> BuildStore(); |
| 227 std::unique_ptr<OfflinePageMetadataStore> BuildStoreWithSchemaFromM52(); | 277 std::unique_ptr<OfflinePageMetadataStore> BuildStoreWithSchemaFromM52(); |
| 228 std::unique_ptr<OfflinePageMetadataStore> BuildStoreWithSchemaFromM53(); | 278 std::unique_ptr<OfflinePageMetadataStore> BuildStoreWithSchemaFromM53(); |
| 229 std::unique_ptr<OfflinePageMetadataStore> BuildStoreWithSchemaFromM54(); | 279 std::unique_ptr<OfflinePageMetadataStore> BuildStoreWithSchemaFromM54(); |
| 280 std::unique_ptr<OfflinePageMetadataStore> BuildStoreWithSchemaFromM55(); | |
| 230 | 281 |
| 231 void PumpLoop(); | 282 void PumpLoop(); |
| 232 | 283 |
| 233 void GetOfflinePagesCallback( | 284 void GetOfflinePagesCallback( |
| 234 OfflinePageMetadataStore::LoadStatus load_status, | 285 OfflinePageMetadataStore::LoadStatus load_status, |
| 235 const std::vector<OfflinePageItem>& offline_pages); | 286 const std::vector<OfflinePageItem>& offline_pages); |
| 236 void AddCallback(ItemActionStatus status); | 287 void AddCallback(ItemActionStatus status); |
| 237 void UpdateCallback(CalledCallback called_callback, | 288 void UpdateCallback(CalledCallback called_callback, |
| 238 std::unique_ptr<OfflinePagesUpdateResult> result); | 289 std::unique_ptr<OfflinePagesUpdateResult> result); |
| 239 void ResetCallback(bool status); | 290 void ResetCallback(bool status); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 320 } | 371 } |
| 321 | 372 |
| 322 void OfflinePageMetadataStoreTest::CheckThatOfflinePageCanBeSaved( | 373 void OfflinePageMetadataStoreTest::CheckThatOfflinePageCanBeSaved( |
| 323 std::unique_ptr<OfflinePageMetadataStore> store) { | 374 std::unique_ptr<OfflinePageMetadataStore> store) { |
| 324 size_t store_size = offline_pages_.size(); | 375 size_t store_size = offline_pages_.size(); |
| 325 OfflinePageItem offline_page(GURL(kTestURL), 1234LL, kTestClientId1, | 376 OfflinePageItem offline_page(GURL(kTestURL), 1234LL, kTestClientId1, |
| 326 base::FilePath(kFilePath), kFileSize); | 377 base::FilePath(kFilePath), kFileSize); |
| 327 offline_page.title = base::UTF8ToUTF16("a title"); | 378 offline_page.title = base::UTF8ToUTF16("a title"); |
| 328 base::Time expiration_time = base::Time::Now(); | 379 base::Time expiration_time = base::Time::Now(); |
| 329 offline_page.expiration_time = expiration_time; | 380 offline_page.expiration_time = expiration_time; |
| 381 offline_page.original_url = GURL(kOriginalTestURL); | |
| 330 | 382 |
| 331 store->AddOfflinePage(offline_page, | 383 store->AddOfflinePage(offline_page, |
| 332 base::Bind(&OfflinePageMetadataStoreTest::AddCallback, | 384 base::Bind(&OfflinePageMetadataStoreTest::AddCallback, |
| 333 base::Unretained(this))); | 385 base::Unretained(this))); |
| 334 PumpLoop(); | 386 PumpLoop(); |
| 335 EXPECT_EQ(ADD, last_called_callback_); | 387 EXPECT_EQ(ADD, last_called_callback_); |
| 336 EXPECT_EQ(STATUS_TRUE, last_status_); | 388 EXPECT_EQ(STATUS_TRUE, last_status_); |
| 337 ClearResults(); | 389 ClearResults(); |
| 338 | 390 |
| 339 // Close the store first to ensure file lock is removed. | 391 // Close the store first to ensure file lock is removed. |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 392 std::unique_ptr<OfflinePageMetadataStore> store( | 444 std::unique_ptr<OfflinePageMetadataStore> store( |
| 393 factory_.BuildStoreM53(temp_directory_.GetPath())); | 445 factory_.BuildStoreM53(temp_directory_.GetPath())); |
| 394 PumpLoop(); | 446 PumpLoop(); |
| 395 store->GetOfflinePages( | 447 store->GetOfflinePages( |
| 396 base::Bind(&OfflinePageMetadataStoreTest::GetOfflinePagesCallback, | 448 base::Bind(&OfflinePageMetadataStoreTest::GetOfflinePagesCallback, |
| 397 base::Unretained(this))); | 449 base::Unretained(this))); |
| 398 PumpLoop(); | 450 PumpLoop(); |
| 399 return store; | 451 return store; |
| 400 } | 452 } |
| 401 | 453 |
| 454 std::unique_ptr<OfflinePageMetadataStore> | |
| 455 OfflinePageMetadataStoreTest::BuildStoreWithSchemaFromM55() { | |
| 456 std::unique_ptr<OfflinePageMetadataStore> store( | |
| 457 factory_.BuildStoreM55(temp_directory_.GetPath())); | |
| 458 PumpLoop(); | |
| 459 store->GetOfflinePages( | |
| 460 base::Bind(&OfflinePageMetadataStoreTest::GetOfflinePagesCallback, | |
| 461 base::Unretained(this))); | |
| 462 PumpLoop(); | |
| 463 return store; | |
| 464 } | |
| 465 | |
| 402 // Loads empty store and makes sure that there are no offline pages stored in | 466 // Loads empty store and makes sure that there are no offline pages stored in |
| 403 // it. | 467 // it. |
| 404 TEST_F(OfflinePageMetadataStoreTest, LoadEmptyStore) { | 468 TEST_F(OfflinePageMetadataStoreTest, LoadEmptyStore) { |
| 405 std::unique_ptr<OfflinePageMetadataStore> store(BuildStore()); | 469 std::unique_ptr<OfflinePageMetadataStore> store(BuildStore()); |
| 406 EXPECT_EQ(LOAD, last_called_callback_); | 470 EXPECT_EQ(LOAD, last_called_callback_); |
| 407 EXPECT_EQ(STATUS_TRUE, last_status_); | 471 EXPECT_EQ(STATUS_TRUE, last_status_); |
| 408 EXPECT_EQ(0U, offline_pages_.size()); | 472 EXPECT_EQ(0U, offline_pages_.size()); |
| 409 } | 473 } |
| 410 | 474 |
| 411 TEST_F(OfflinePageMetadataStoreTest, GetOfflinePagesFromInvalidStore) { | 475 TEST_F(OfflinePageMetadataStoreTest, GetOfflinePagesFromInvalidStore) { |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 512 // TODO(romax): Move this to sql_unittest. | 576 // TODO(romax): Move this to sql_unittest. |
| 513 TEST_F(OfflinePageMetadataStoreTest, LoadVersion54Store) { | 577 TEST_F(OfflinePageMetadataStoreTest, LoadVersion54Store) { |
| 514 std::unique_ptr<OfflinePageMetadataStore> store( | 578 std::unique_ptr<OfflinePageMetadataStore> store( |
| 515 BuildStoreWithSchemaFromM54()); | 579 BuildStoreWithSchemaFromM54()); |
| 516 | 580 |
| 517 OfflinePageItem item = CheckThatStoreHasOneItem(); | 581 OfflinePageItem item = CheckThatStoreHasOneItem(); |
| 518 | 582 |
| 519 CheckThatOfflinePageCanBeSaved(std::move(store)); | 583 CheckThatOfflinePageCanBeSaved(std::move(store)); |
| 520 } | 584 } |
| 521 | 585 |
| 586 // Loads a string with schema from M54. | |
|
fgorski
2016/11/10 23:56:13
M55
jianli
2016/11/16 01:25:39
Done.
| |
| 587 // Because for now we only reduce the number of fields it just makes sure there | |
| 588 // are no crashes in the process. | |
| 589 // TODO(romax): Move this to sql_unittest. | |
| 590 TEST_F(OfflinePageMetadataStoreTest, LoadVersion55Store) { | |
| 591 std::unique_ptr<OfflinePageMetadataStore> store( | |
| 592 BuildStoreWithSchemaFromM55()); | |
| 593 | |
| 594 OfflinePageItem item = CheckThatStoreHasOneItem(); | |
| 595 | |
| 596 CheckThatOfflinePageCanBeSaved(std::move(store)); | |
| 597 } | |
| 598 | |
| 522 // Adds metadata of an offline page into a store and then opens the store | 599 // Adds metadata of an offline page into a store and then opens the store |
| 523 // again to make sure that stored metadata survives store restarts. | 600 // again to make sure that stored metadata survives store restarts. |
| 524 TEST_F(OfflinePageMetadataStoreTest, AddOfflinePage) { | 601 TEST_F(OfflinePageMetadataStoreTest, AddOfflinePage) { |
| 525 CheckThatOfflinePageCanBeSaved(BuildStore()); | 602 CheckThatOfflinePageCanBeSaved(BuildStore()); |
| 526 } | 603 } |
| 527 | 604 |
| 528 TEST_F(OfflinePageMetadataStoreTest, AddSameOfflinePageTwice) { | 605 TEST_F(OfflinePageMetadataStoreTest, AddSameOfflinePageTwice) { |
| 529 std::unique_ptr<OfflinePageMetadataStore> store(BuildStore()); | 606 std::unique_ptr<OfflinePageMetadataStore> store(BuildStore()); |
| 530 | 607 |
| 531 OfflinePageItem offline_page(GURL(kTestURL), 1234LL, kTestClientId1, | 608 OfflinePageItem offline_page(GURL(kTestURL), 1234LL, kTestClientId1, |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 716 | 793 |
| 717 EXPECT_EQ(LOAD, last_called_callback_); | 794 EXPECT_EQ(LOAD, last_called_callback_); |
| 718 EXPECT_EQ(STATUS_TRUE, last_status_); | 795 EXPECT_EQ(STATUS_TRUE, last_status_); |
| 719 ASSERT_EQ(1U, offline_pages_.size()); | 796 ASSERT_EQ(1U, offline_pages_.size()); |
| 720 EXPECT_EQ(offline_page, offline_pages_[0]); | 797 EXPECT_EQ(offline_page, offline_pages_[0]); |
| 721 | 798 |
| 722 // Then update some data. | 799 // Then update some data. |
| 723 offline_page.file_size = kFileSize + 1; | 800 offline_page.file_size = kFileSize + 1; |
| 724 offline_page.access_count++; | 801 offline_page.access_count++; |
| 725 offline_page.expiration_time = base::Time::Now(); | 802 offline_page.expiration_time = base::Time::Now(); |
| 803 offline_page.original_url = GURL("https://example.com/bar"); | |
|
fgorski
2016/11/10 23:56:13
please make a similar update to one of the add* te
jianli
2016/11/16 01:25:39
Done.
| |
| 726 std::vector<OfflinePageItem> items_to_update; | 804 std::vector<OfflinePageItem> items_to_update; |
| 727 items_to_update.push_back(offline_page); | 805 items_to_update.push_back(offline_page); |
| 728 store->UpdateOfflinePages( | 806 store->UpdateOfflinePages( |
| 729 items_to_update, base::Bind(&OfflinePageMetadataStoreTest::UpdateCallback, | 807 items_to_update, base::Bind(&OfflinePageMetadataStoreTest::UpdateCallback, |
| 730 base::Unretained(this), UPDATE)); | 808 base::Unretained(this), UPDATE)); |
| 731 PumpLoop(); | 809 PumpLoop(); |
| 732 EXPECT_EQ(UPDATE, last_called_callback_); | 810 EXPECT_EQ(UPDATE, last_called_callback_); |
| 733 EXPECT_EQ(STATUS_TRUE, last_status_); | 811 EXPECT_EQ(STATUS_TRUE, last_status_); |
| 734 ASSERT_TRUE(last_update_result() != nullptr); | 812 ASSERT_TRUE(last_update_result() != nullptr); |
| 735 EXPECT_EQ(1UL, last_update_result()->item_statuses.size()); | 813 EXPECT_EQ(1UL, last_update_result()->item_statuses.size()); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 799 base::Unretained(this))); | 877 base::Unretained(this))); |
| 800 PumpLoop(); | 878 PumpLoop(); |
| 801 | 879 |
| 802 EXPECT_EQ(LOAD, last_called_callback_); | 880 EXPECT_EQ(LOAD, last_called_callback_); |
| 803 EXPECT_EQ(STATUS_TRUE, last_status_); | 881 EXPECT_EQ(STATUS_TRUE, last_status_); |
| 804 ASSERT_EQ(0U, offline_pages_.size()); | 882 ASSERT_EQ(0U, offline_pages_.size()); |
| 805 } | 883 } |
| 806 | 884 |
| 807 } // namespace | 885 } // namespace |
| 808 } // namespace offline_pages | 886 } // namespace offline_pages |
| OLD | NEW |