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

Side by Side Diff: chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc

Issue 2675803004: Fall back to shortcut A2HS when Phonesky is out of date or unavailable. (Closed)
Patch Set: Update add_to_homescreen_data_fetcher_unittest.cc. Created 3 years, 10 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/webapps/add_to_homescreen_data_fetcher.h" 5 #include "chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 } 197 }
198 198
199 void TearDown() override { 199 void TearDown() override {
200 embedded_worker_test_helper_.reset(); 200 embedded_worker_test_helper_.reset();
201 ChromeRenderViewHostTestHarness::TearDown(); 201 ChromeRenderViewHostTestHarness::TearDown();
202 } 202 }
203 203
204 scoped_refptr<AddToHomescreenDataFetcher> BuildFetcher( 204 scoped_refptr<AddToHomescreenDataFetcher> BuildFetcher(
205 bool check_webapk_compatible, 205 bool check_webapk_compatible,
206 AddToHomescreenDataFetcher::Observer* observer) { 206 AddToHomescreenDataFetcher::Observer* observer) {
207 return new AddToHomescreenDataFetcher(web_contents(), 1, 1, 1, 1, 1, 207 return new AddToHomescreenDataFetcher(
208 check_webapk_compatible, observer); 208 web_contents(), 1, 1, 1, 1, 1, check_webapk_compatible,
209 true /* can_use_webapk_install_flow */, observer);
209 } 210 }
210 211
211 // Set the manifest to be returned as a result of WebContents::GetManifest(). 212 // Set the manifest to be returned as a result of WebContents::GetManifest().
212 void SetManifest(const GURL& manifest_url, 213 void SetManifest(const GURL& manifest_url,
213 const content::Manifest& manifest, 214 const content::Manifest& manifest,
214 int fetch_delay_ms) { 215 int fetch_delay_ms) {
215 MockWebContents* mock_web_contents = 216 MockWebContents* mock_web_contents =
216 static_cast<MockWebContents*>(web_contents()); 217 static_cast<MockWebContents*>(web_contents());
217 mock_web_contents->SetManifest(manifest_url, manifest, fetch_delay_ms); 218 mock_web_contents->SetManifest(manifest_url, manifest, fetch_delay_ms);
218 } 219 }
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 } 360 }
360 // This callback enables the text field in the add-to-homescreen dialog. 361 // This callback enables the text field in the add-to-homescreen dialog.
361 EXPECT_TRUE(waiter.title_available()); 362 EXPECT_TRUE(waiter.title_available());
362 363
363 fetcher->set_weak_observer(nullptr); 364 fetcher->set_weak_observer(nullptr);
364 } 365 }
365 366
366 INSTANTIATE_TEST_CASE_P(CheckWebApkCompatibility, 367 INSTANTIATE_TEST_CASE_P(CheckWebApkCompatibility,
367 AddToHomescreenDataFetcherTestCommon, 368 AddToHomescreenDataFetcherTestCommon,
368 ::testing::Values(false, true)); 369 ::testing::Values(false, true));
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698