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

Side by Side Diff: chrome/browser/android/offline_pages/offline_page_tab_helper_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: 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 "chrome/browser/android/offline_pages/offline_page_tab_helper.h" 5 #include "chrome/browser/android/offline_pages/offline_page_tab_helper.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/feature_list.h" 10 #include "base/feature_list.h"
11 #include "base/files/file_path.h" 11 #include "base/files/file_path.h"
12 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
13 #include "base/run_loop.h" 13 #include "base/run_loop.h"
14 #include "chrome/browser/android/offline_pages/offline_page_model_factory.h" 14 #include "chrome/browser/android/offline_pages/offline_page_model_factory.h"
15 #include "chrome/browser/android/offline_pages/test_offline_page_model_builder.h " 15 #include "chrome/browser/android/offline_pages/test_offline_page_model_builder.h "
16 #include "chrome/test/base/chrome_render_view_host_test_harness.h" 16 #include "chrome/test/base/chrome_render_view_host_test_harness.h"
17 #include "components/offline_pages/offline_page_feature.h" 17 #include "components/offline_pages/offline_page_feature.h"
18 #include "components/offline_pages/offline_page_item.h" 18 #include "components/offline_pages/offline_page_item.h"
19 #include "components/offline_pages/offline_page_model.h" 19 #include "components/offline_pages/offline_page_model.h"
20 #include "components/offline_pages/offline_page_test_archiver.h" 20 #include "components/offline_pages/offline_page_test_archiver.h"
21 #include "content/public/browser/navigation_entry.h" 21 #include "content/public/browser/navigation_entry.h"
22 #include "content/public/browser/web_contents.h" 22 #include "content/public/browser/web_contents.h"
23 #include "net/base/net_errors.h" 23 #include "net/base/net_errors.h"
24 #include "net/base/network_change_notifier.h" 24 #include "net/base/network_change_notifier.h"
25 #include "testing/gtest/include/gtest/gtest.h" 25 #include "testing/gtest/include/gtest/gtest.h"
26 26
27 using SavePageResult = offline_pages::OfflinePageModel::SavePageResult;
28 using SingleOfflinePageItemResult =
29 offline_pages::OfflinePageModel::SingleOfflinePageItemResult;
30
31 namespace offline_pages { 27 namespace offline_pages {
32 28
33 namespace { 29 namespace {
34 30
35 const GURL kTestPageUrl("http://test.org/page1"); 31 const GURL kTestPageUrl("http://test.org/page1");
36 const ClientId kTestClientId = ClientId(kBookmarkNamespace, "1234"); 32 const ClientId kTestClientId = ClientId(kBookmarkNamespace, "1234");
37 const int64_t kTestFileSize = 876543LL; 33 const int64_t kTestFileSize = 876543LL;
38 34
39 class TestNetworkChangeNotifier : public net::NetworkChangeNotifier { 35 class TestNetworkChangeNotifier : public net::NetworkChangeNotifier {
40 public: 36 public:
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 StartLoad(online_url()); 212 StartLoad(online_url());
217 RunUntilIdle(); 213 RunUntilIdle();
218 EXPECT_EQ(online_url(), controller().GetPendingEntry()->GetURL()); 214 EXPECT_EQ(online_url(), controller().GetPendingEntry()->GetURL());
219 215
220 // Redirection will be done immediately on navigation end with error. 216 // Redirection will be done immediately on navigation end with error.
221 FailLoad(online_url()); 217 FailLoad(online_url());
222 EXPECT_EQ(offline_url(), controller().GetPendingEntry()->GetURL()); 218 EXPECT_EQ(offline_url(), controller().GetPendingEntry()->GetURL());
223 } 219 }
224 220
225 } // namespace offline_pages 221 } // namespace offline_pages
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698