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

Side by Side Diff: chrome/browser/android/offline_pages/offline_page_utils_unittest.cc

Issue 1904613005: [Offline pages] Removing bookmarks dependency from offline pages component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit tests compilation Created 4 years, 8 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 "chrome/browser/android/offline_pages/offline_page_utils.h" 5 #include "chrome/browser/android/offline_pages/offline_page_utils.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 const base::FilePath& file_path) {} 128 const base::FilePath& file_path) {}
129 129
130 void OfflinePageUtilsTest::CreateOfflinePages() { 130 void OfflinePageUtilsTest::CreateOfflinePages() {
131 OfflinePageModel* model = 131 OfflinePageModel* model =
132 OfflinePageModelFactory::GetForBrowserContext(profile()); 132 OfflinePageModelFactory::GetForBrowserContext(profile());
133 133
134 // Create page 1. 134 // Create page 1.
135 std::unique_ptr<OfflinePageTestArchiver> archiver(BuildArchiver( 135 std::unique_ptr<OfflinePageTestArchiver> archiver(BuildArchiver(
136 kTestPage1Url, base::FilePath(FILE_PATH_LITERAL("page1.mhtml")))); 136 kTestPage1Url, base::FilePath(FILE_PATH_LITERAL("page1.mhtml"))));
137 offline_pages::ClientId client_id; 137 offline_pages::ClientId client_id;
138 client_id.name_space = BOOKMARK_NAMESPACE; 138 client_id.name_space = kBookmarkNamespace;
139 client_id.id = kTestPage1ClientId; 139 client_id.id = kTestPage1ClientId;
140 model->SavePage( 140 model->SavePage(
141 kTestPage1Url, client_id, std::move(archiver), 141 kTestPage1Url, client_id, std::move(archiver),
142 base::Bind(&OfflinePageUtilsTest::OnSavePageDone, AsWeakPtr())); 142 base::Bind(&OfflinePageUtilsTest::OnSavePageDone, AsWeakPtr()));
143 RunUntilIdle(); 143 RunUntilIdle();
144 int64_t offline1 = offline_id(); 144 int64_t offline1 = offline_id();
145 145
146 client_id.id = kTestPage2ClientId; 146 client_id.id = kTestPage2ClientId;
147 // Create page 2. 147 // Create page 2.
148 archiver = BuildArchiver(kTestPage2Url, 148 archiver = BuildArchiver(kTestPage2Url,
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 TEST_F(OfflinePageUtilsTest, HasOfflinePageForOnlineURL) { 224 TEST_F(OfflinePageUtilsTest, HasOfflinePageForOnlineURL) {
225 EXPECT_TRUE( 225 EXPECT_TRUE(
226 OfflinePageUtils::HasOfflinePageForOnlineURL(profile(), kTestPage1Url)); 226 OfflinePageUtils::HasOfflinePageForOnlineURL(profile(), kTestPage1Url));
227 EXPECT_TRUE( 227 EXPECT_TRUE(
228 OfflinePageUtils::HasOfflinePageForOnlineURL(profile(), kTestPage2Url)); 228 OfflinePageUtils::HasOfflinePageForOnlineURL(profile(), kTestPage2Url));
229 EXPECT_FALSE( 229 EXPECT_FALSE(
230 OfflinePageUtils::HasOfflinePageForOnlineURL(profile(), kTestPage3Url)); 230 OfflinePageUtils::HasOfflinePageForOnlineURL(profile(), kTestPage3Url));
231 } 231 }
232 232
233 } // namespace offline_pages 233 } // namespace offline_pages
OLDNEW
« no previous file with comments | « chrome/browser/android/offline_pages/offline_page_utils.cc ('k') | chrome/browser/bookmarks/bookmark_model_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698