OLD | NEW |
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" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 91 |
92 int64_t offline_id_; | 92 int64_t offline_id_; |
93 | 93 |
94 DISALLOW_COPY_AND_ASSIGN(OfflinePageTabHelperTest); | 94 DISALLOW_COPY_AND_ASSIGN(OfflinePageTabHelperTest); |
95 }; | 95 }; |
96 | 96 |
97 void OfflinePageTabHelperTest::SetUp() { | 97 void OfflinePageTabHelperTest::SetUp() { |
98 // Enables offline pages feature. | 98 // Enables offline pages feature. |
99 // TODO(jianli): Remove this once the feature is completely enabled. | 99 // TODO(jianli): Remove this once the feature is completely enabled. |
100 base::FeatureList::ClearInstanceForTesting(); | 100 base::FeatureList::ClearInstanceForTesting(); |
101 scoped_ptr<base::FeatureList> feature_list(new base::FeatureList); | 101 std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); |
102 feature_list->InitializeFromCommandLine( | 102 feature_list->InitializeFromCommandLine( |
103 offline_pages::kOfflineBookmarksFeature.name, ""); | 103 offline_pages::kOfflineBookmarksFeature.name, ""); |
104 base::FeatureList::SetInstance(std::move(feature_list)); | 104 base::FeatureList::SetInstance(std::move(feature_list)); |
105 | 105 |
106 // Creates a test web contents. | 106 // Creates a test web contents. |
107 content::RenderViewHostTestHarness::SetUp(); | 107 content::RenderViewHostTestHarness::SetUp(); |
108 OfflinePageTabHelper::CreateForWebContents(web_contents()); | 108 OfflinePageTabHelper::CreateForWebContents(web_contents()); |
109 offline_page_tab_helper_ = | 109 offline_page_tab_helper_ = |
110 OfflinePageTabHelper::FromWebContents(web_contents()); | 110 OfflinePageTabHelper::FromWebContents(web_contents()); |
111 | 111 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 GURL online_url = page->url; | 203 GURL online_url = page->url; |
204 | 204 |
205 StartLoad(online_url); | 205 StartLoad(online_url); |
206 EXPECT_EQ(online_url, controller().GetPendingEntry()->GetURL()); | 206 EXPECT_EQ(online_url, controller().GetPendingEntry()->GetURL()); |
207 | 207 |
208 FailLoad(online_url); | 208 FailLoad(online_url); |
209 EXPECT_EQ(offline_url, controller().GetPendingEntry()->GetURL()); | 209 EXPECT_EQ(offline_url, controller().GetPendingEntry()->GetURL()); |
210 } | 210 } |
211 | 211 |
212 } // namespace offline_pages | 212 } // namespace offline_pages |
OLD | NEW |