| 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/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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 } | 200 } |
| 201 | 201 |
| 202 void TearDown() override { | 202 void TearDown() override { |
| 203 embedded_worker_test_helper_.reset(); | 203 embedded_worker_test_helper_.reset(); |
| 204 ChromeRenderViewHostTestHarness::TearDown(); | 204 ChromeRenderViewHostTestHarness::TearDown(); |
| 205 } | 205 } |
| 206 | 206 |
| 207 scoped_refptr<AddToHomescreenDataFetcher> BuildFetcher( | 207 scoped_refptr<AddToHomescreenDataFetcher> BuildFetcher( |
| 208 bool check_webapk_compatible, | 208 bool check_webapk_compatible, |
| 209 AddToHomescreenDataFetcher::Observer* observer) { | 209 AddToHomescreenDataFetcher::Observer* observer) { |
| 210 return new AddToHomescreenDataFetcher(web_contents(), 1, 1, 1, 1, 1, | 210 return new AddToHomescreenDataFetcher(web_contents(), 144, 144, 1, |
| 211 check_webapk_compatible, observer); | 211 check_webapk_compatible, observer); |
| 212 } | 212 } |
| 213 | 213 |
| 214 // Set the manifest to be returned as a result of WebContents::GetManifest(). | 214 // Set the manifest to be returned as a result of WebContents::GetManifest(). |
| 215 void SetManifest(const GURL& manifest_url, | 215 void SetManifest(const GURL& manifest_url, |
| 216 const content::Manifest& manifest, | 216 const content::Manifest& manifest, |
| 217 int fetch_delay_ms) { | 217 int fetch_delay_ms) { |
| 218 MockWebContents* mock_web_contents = | 218 MockWebContents* mock_web_contents = |
| 219 static_cast<MockWebContents*>(web_contents()); | 219 static_cast<MockWebContents*>(web_contents()); |
| 220 mock_web_contents->SetManifest(manifest_url, manifest, fetch_delay_ms); | 220 mock_web_contents->SetManifest(manifest_url, manifest, fetch_delay_ms); |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 } | 362 } |
| 363 // This callback enables the text field in the add-to-homescreen dialog. | 363 // This callback enables the text field in the add-to-homescreen dialog. |
| 364 EXPECT_TRUE(waiter.title_available()); | 364 EXPECT_TRUE(waiter.title_available()); |
| 365 | 365 |
| 366 fetcher->set_weak_observer(nullptr); | 366 fetcher->set_weak_observer(nullptr); |
| 367 } | 367 } |
| 368 | 368 |
| 369 INSTANTIATE_TEST_CASE_P(CheckWebApkCompatibility, | 369 INSTANTIATE_TEST_CASE_P(CheckWebApkCompatibility, |
| 370 AddToHomescreenDataFetcherTestCommon, | 370 AddToHomescreenDataFetcherTestCommon, |
| 371 ::testing::Values(false, true)); | 371 ::testing::Values(false, true)); |
| OLD | NEW |