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

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

Issue 1968563003: [Offline pages] Extracting callbacks from the Offline Page Model (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding a missing fix to gypi file Created 4 years, 7 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 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/offline_page_storage_manager.h" 5 #include "components/offline_pages/offline_page_storage_manager.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
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"
11 #include "base/time/time.h" 11 #include "base/time/time.h"
12 #include "components/offline_pages/client_policy_controller.h" 12 #include "components/offline_pages/client_policy_controller.h"
13 #include "components/offline_pages/offline_page_item.h" 13 #include "components/offline_pages/offline_page_item.h"
14 #include "components/offline_pages/offline_page_model.h" 14 #include "components/offline_pages/offline_page_model.h"
15 #include "components/offline_pages/offline_page_types.h"
15 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
16 17
17 using DeletePageResult = offline_pages::OfflinePageModel::DeletePageResult;
18
19 namespace offline_pages { 18 namespace offline_pages {
20 19
21 namespace { 20 namespace {
22 const char kTestClientNamespace[] = "CLIENT_NAMESPACE"; 21 const char kTestClientNamespace[] = "CLIENT_NAMESPACE";
23 const GURL kTestUrl("http://example.com"); 22 const GURL kTestUrl("http://example.com");
24 const GURL kTestUrl2("http://other.page.com"); 23 const GURL kTestUrl2("http://other.page.com");
25 const base::FilePath::CharType kFilePath[] = FILE_PATH_LITERAL("TEST_FILEPATH"); 24 const base::FilePath::CharType kFilePath[] = FILE_PATH_LITERAL("TEST_FILEPATH");
26 const ClientId kTestClientId1(kTestClientNamespace, "1234"); 25 const ClientId kTestClientId1(kTestClientNamespace, "1234");
27 const ClientId kTestClientId2(kTestClientNamespace, "5678"); 26 const ClientId kTestClientId2(kTestClientNamespace, "5678");
28 const int64_t kTestFileSize = 876543LL; 27 const int64_t kTestFileSize = 876543LL;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 } 109 }
111 110
112 TEST_F(OfflinePageStorageManagerTest, TestClearPages) { 111 TEST_F(OfflinePageStorageManagerTest, TestClearPages) {
113 manager()->ClearPagesIfNeeded(base::Bind( 112 manager()->ClearPagesIfNeeded(base::Bind(
114 &OfflinePageStorageManagerTest::OnPagesCleared, base::Unretained(this))); 113 &OfflinePageStorageManagerTest::OnPagesCleared, base::Unretained(this)));
115 EXPECT_EQ(1, last_cleared_page_count()); 114 EXPECT_EQ(1, last_cleared_page_count());
116 EXPECT_EQ(DeletePageResult::SUCCESS, last_delete_page_result()); 115 EXPECT_EQ(DeletePageResult::SUCCESS, last_delete_page_result());
117 } 116 }
118 117
119 } // namespace offline_pages 118 } // namespace offline_pages
OLDNEW
« no previous file with comments | « components/offline_pages/offline_page_storage_manager.cc ('k') | components/offline_pages/offline_page_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698