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

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

Issue 1764843003: Enable offline pages feature on trunk by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Created 4 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/android/offline_pages/offline_page_utils_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 }; 88 };
89 89
90 void OfflinePageTabHelperTest::SetUp() { 90 void OfflinePageTabHelperTest::SetUp() {
91 // Creates a test web contents. 91 // Creates a test web contents.
92 content::RenderViewHostTestHarness::SetUp(); 92 content::RenderViewHostTestHarness::SetUp();
93 OfflinePageTabHelper::CreateForWebContents(web_contents()); 93 OfflinePageTabHelper::CreateForWebContents(web_contents());
94 offline_page_tab_helper_ = 94 offline_page_tab_helper_ =
95 OfflinePageTabHelper::FromWebContents(web_contents()); 95 OfflinePageTabHelper::FromWebContents(web_contents());
96 96
97 // Enables offline pages feature. 97 // Enables offline pages feature.
98 // TODO(jianli): Remove this once the feature is completely enabled.
98 base::CommandLine::ForCurrentProcess()->AppendSwitch( 99 base::CommandLine::ForCurrentProcess()->AppendSwitch(
99 switches::kEnableOfflinePages); 100 switches::kEnableOfflinePages);
100 101
101 // Sets up the factory for testing. 102 // Sets up the factory for testing.
102 OfflinePageModelFactory::GetInstance()->SetTestingFactoryAndUse( 103 OfflinePageModelFactory::GetInstance()->SetTestingFactoryAndUse(
103 browser_context(), BuildTestOfflinePageModel); 104 browser_context(), BuildTestOfflinePageModel);
104 RunUntilIdle(); 105 RunUntilIdle();
105 106
106 // Saves an offline page. 107 // Saves an offline page.
107 OfflinePageModel* model = 108 OfflinePageModel* model =
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 GURL online_url = page->url; 187 GURL online_url = page->url;
187 188
188 StartLoad(online_url); 189 StartLoad(online_url);
189 EXPECT_EQ(online_url, controller().GetPendingEntry()->GetURL()); 190 EXPECT_EQ(online_url, controller().GetPendingEntry()->GetURL());
190 191
191 FailLoad(online_url); 192 FailLoad(online_url);
192 EXPECT_EQ(offline_url, controller().GetPendingEntry()->GetURL()); 193 EXPECT_EQ(offline_url, controller().GetPendingEntry()->GetURL());
193 } 194 }
194 195
195 } // namespace offline_pages 196 } // namespace offline_pages
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/offline_pages/offline_page_utils_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698