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

Side by Side Diff: chrome/browser/android/webapk/webapk_installer_unittest.cc

Issue 2746723002: [WebAPK] Refactor "unsigned sources" installation path (Closed)
Patch Set: Merge branch 'master' into start Created 3 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 | « chrome/browser/android/webapk/webapk_installer.cc ('k') | no next file » | 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 "chrome/browser/android/webapk/webapk_installer.h" 5 #include "chrome/browser/android/webapk/webapk_installer.h"
6 6
7 #include <jni.h> 7 #include <jni.h>
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 class TestWebApkInstaller : public WebApkInstaller { 59 class TestWebApkInstaller : public WebApkInstaller {
60 public: 60 public:
61 TestWebApkInstaller(content::BrowserContext* browser_context, 61 TestWebApkInstaller(content::BrowserContext* browser_context,
62 const ShortcutInfo& shortcut_info, 62 const ShortcutInfo& shortcut_info,
63 const SkBitmap& shortcut_icon, 63 const SkBitmap& shortcut_icon,
64 bool can_use_google_play_install_service) 64 bool can_use_google_play_install_service)
65 : WebApkInstaller(browser_context, shortcut_info, shortcut_icon), 65 : WebApkInstaller(browser_context, shortcut_info, shortcut_icon),
66 can_use_google_play_install_service_( 66 can_use_google_play_install_service_(
67 can_use_google_play_install_service) {} 67 can_use_google_play_install_service) {}
68 68
69 bool StartInstallingDownloadedWebApk( 69 void InstallDownloadedWebApk(
70 JNIEnv* env, 70 JNIEnv* env,
71 const base::android::ScopedJavaLocalRef<jstring>& file_path, 71 const base::android::ScopedJavaLocalRef<jstring>& file_path,
72 const base::android::ScopedJavaLocalRef<jstring>& package_name) override { 72 const base::android::ScopedJavaLocalRef<jstring>& package_name) override {
73 PostTaskToRunSuccessCallback(); 73 PostTaskToRunSuccessCallback();
74 return true;
75 } 74 }
76 75
77 bool StartUpdateUsingDownloadedWebApk( 76 void UpdateUsingDownloadedWebApk(
78 JNIEnv* env, 77 JNIEnv* env,
79 const base::android::ScopedJavaLocalRef<jstring>& file_path) override { 78 const base::android::ScopedJavaLocalRef<jstring>& file_path) override {
80 return true; 79 PostTaskToRunSuccessCallback();
81 } 80 }
82 81
83 bool CanUseGooglePlayInstallService() override { 82 bool CanUseGooglePlayInstallService() override {
84 return can_use_google_play_install_service_; 83 return can_use_google_play_install_service_;
85 } 84 }
86 85
87 void InstallOrUpdateWebApkFromGooglePlay(const std::string& package_name, 86 void InstallOrUpdateWebApkFromGooglePlay(const std::string& package_name,
88 int version, 87 int version,
89 const std::string& token) override { 88 const std::string& token) override {
90 PostTaskToRunSuccessCallback(); 89 PostTaskToRunSuccessCallback();
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 icons[i] = manifest.icons(i); 508 icons[i] = manifest.icons(i);
510 509
511 EXPECT_EQ(best_primary_icon_url.spec(), icons[0].src()); 510 EXPECT_EQ(best_primary_icon_url.spec(), icons[0].src());
512 EXPECT_EQ(best_primary_icon_murmur2_hash, icons[0].hash()); 511 EXPECT_EQ(best_primary_icon_murmur2_hash, icons[0].hash());
513 EXPECT_TRUE(icons[0].has_image_data()); 512 EXPECT_TRUE(icons[0].has_image_data());
514 513
515 EXPECT_EQ(icon_url_1.spec(), icons[1].src()); 514 EXPECT_EQ(icon_url_1.spec(), icons[1].src());
516 EXPECT_EQ(icon_murmur2_hash_1, icons[1].hash()); 515 EXPECT_EQ(icon_murmur2_hash_1, icons[1].hash());
517 EXPECT_FALSE(icons[1].has_image_data()); 516 EXPECT_FALSE(icons[1].has_image_data());
518 } 517 }
OLDNEW
« 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