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

Unified Diff: chrome/browser/android/webapk/webapk_installer_unittest.cc

Issue 2932593005: Simplify WebAPK proto building code (Closed)
Patch Set: Merge branch 'master' into background_updates000 Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/android/webapk/webapk_installer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/webapk/webapk_installer_unittest.cc
diff --git a/chrome/browser/android/webapk/webapk_installer_unittest.cc b/chrome/browser/android/webapk/webapk_installer_unittest.cc
index 78d834252f5e6535db3d6f980651dc21285b06ef..6b209d355316b696296679a62ce62fd13158ffdd 100644
--- a/chrome/browser/android/webapk/webapk_installer_unittest.cc
+++ b/chrome/browser/android/webapk/webapk_installer_unittest.cc
@@ -187,9 +187,7 @@ std::unique_ptr<net::test_server::HttpResponse> BuildValidWebApkResponse(
// Builds WebApk proto and blocks till done.
class BuildProtoRunner {
public:
- explicit BuildProtoRunner(content::BrowserContext* browser_context)
- : browser_context_(browser_context) {}
-
+ BuildProtoRunner() {}
~BuildProtoRunner() {}
void BuildSync(
@@ -201,15 +199,13 @@ class BuildProtoRunner {
info.best_primary_icon_url = best_primary_icon_url;
info.best_badge_icon_url = best_badge_icon_url;
- // WebApkInstaller owns itself.
SkBitmap primary_icon(gfx::test::CreateBitmap(144, 144));
SkBitmap badge_icon(gfx::test::CreateBitmap(72, 72));
- WebApkInstaller* installer = new TestWebApkInstaller(
- browser_context_, info, primary_icon, badge_icon);
- installer->BuildWebApkProtoInBackgroundForTesting(
+ WebApkInstaller::BuildProto(
+ info, primary_icon, badge_icon, "" /* package_name */, "" /* version */,
+ icon_url_to_murmur2_hash, is_manifest_stale,
base::Bind(&BuildProtoRunner::OnBuiltWebApkProto,
- base::Unretained(this)),
- icon_url_to_murmur2_hash, is_manifest_stale);
+ base::Unretained(this)));
base::RunLoop run_loop;
on_completed_callback_ = run_loop.QuitClosure();
@@ -225,8 +221,6 @@ class BuildProtoRunner {
on_completed_callback_.Run();
}
- content::BrowserContext* browser_context_;
-
// The populated webapk::WebApk.
std::unique_ptr<webapk::WebApk> webapk_request_;
@@ -292,8 +286,7 @@ class WebApkInstallerTest : public ::testing::Test {
}
std::unique_ptr<BuildProtoRunner> CreateBuildProtoRunner() {
- return std::unique_ptr<BuildProtoRunner>(
- new BuildProtoRunner(profile_.get()));
+ return std::unique_ptr<BuildProtoRunner>(new BuildProtoRunner());
}
net::test_server::EmbeddedTestServer* test_server() { return &test_server_; }
« no previous file with comments | « chrome/browser/android/webapk/webapk_installer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698