Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(710)

Side by Side Diff: components/offline_pages/offline_page_model_impl_unittest.cc

Issue 2345133002: Offline Pages: Removes the metadata consistency check from the model API. (Closed)
Patch Set: Rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_model_impl.h" 5 #include "components/offline_pages/offline_page_model_impl.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 763
764 TEST_F(OfflinePageModelImplTest, DetectThatOfflineCopyIsMissing) { 764 TEST_F(OfflinePageModelImplTest, DetectThatOfflineCopyIsMissing) {
765 // Save a page. 765 // Save a page.
766 SavePage(kTestUrl, kTestClientId1); 766 SavePage(kTestUrl, kTestClientId1);
767 int64_t offline_id = last_save_offline_id(); 767 int64_t offline_id = last_save_offline_id();
768 768
769 ResetResults(); 769 ResetResults();
770 770
771 const OfflinePageItem* page = GetPageByOfflineId(offline_id); 771 const OfflinePageItem* page = GetPageByOfflineId(offline_id);
772 772
773 // Delete the offline copy of the page and check the metadata. 773 // Delete the offline copy of the page.
774 base::DeleteFile(page->file_path, false); 774 base::DeleteFile(page->file_path, false);
775 model()->CheckMetadataConsistency(); 775
776 // Resetting the model will cause a consistency check.
777 ResetModel();
778
776 PumpLoop(); 779 PumpLoop();
777 780
778 // Check if the page has been expired. 781 // Check if the page has been expired.
779 EXPECT_EQ(0UL, GetAllPages().size()); 782 EXPECT_EQ(0UL, GetAllPages().size());
780 } 783 }
781 784
782 TEST_F(OfflinePageModelImplTest, DetectThatOfflineCopyIsMissingAfterLoad) { 785 TEST_F(OfflinePageModelImplTest, DetectThatOfflineCopyIsMissingAfterLoad) {
783 // Save a page. 786 // Save a page.
784 SavePage(kTestUrl, kTestClientId1); 787 SavePage(kTestUrl, kTestClientId1);
785 PumpLoop(); 788 PumpLoop();
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
1227 // Check if feature is correctly enabled by command-line flag. 1230 // Check if feature is correctly enabled by command-line flag.
1228 scoped_feature_list.reset(new base::test::ScopedFeatureList); 1231 scoped_feature_list.reset(new base::test::ScopedFeatureList);
1229 scoped_feature_list->InitFromCommandLine( 1232 scoped_feature_list->InitFromCommandLine(
1230 std::string(kOfflineBookmarksFeature.name) + "," + 1233 std::string(kOfflineBookmarksFeature.name) + "," +
1231 kOfflinePagesSharingFeature.name, 1234 kOfflinePagesSharingFeature.name,
1232 ""); 1235 "");
1233 EXPECT_TRUE(offline_pages::IsOfflinePagesSharingEnabled()); 1236 EXPECT_TRUE(offline_pages::IsOfflinePagesSharingEnabled());
1234 } 1237 }
1235 1238
1236 } // namespace offline_pages 1239 } // namespace offline_pages
OLDNEW
« no previous file with comments | « components/offline_pages/offline_page_model_impl.cc ('k') | components/offline_pages/stub_offline_page_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698