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

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

Issue 2641973003: Implement server-suggested update check backoff (Closed)
Patch Set: Nits. 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
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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 155
156 void Run() { 156 void Run() {
157 base::RunLoop run_loop; 157 base::RunLoop run_loop;
158 on_completed_callback_ = run_loop.QuitClosure(); 158 on_completed_callback_ = run_loop.QuitClosure();
159 run_loop.Run(); 159 run_loop.Run();
160 } 160 }
161 161
162 bool success() { return success_; } 162 bool success() { return success_; }
163 163
164 private: 164 private:
165 void OnCompleted(bool success, const std::string& webapk_package) { 165 void OnCompleted(bool success,
166 bool relax_updates,
167 const std::string& webapk_package) {
166 success_ = success; 168 success_ = success;
167 on_completed_callback_.Run(); 169 on_completed_callback_.Run();
168 } 170 }
169 171
170 content::BrowserContext* browser_context_; 172 content::BrowserContext* browser_context_;
171 173
172 // The Web Manifest's icon URL. 174 // The Web Manifest's icon URL.
173 const GURL best_primary_icon_url_; 175 const GURL best_primary_icon_url_;
174 176
175 // Called after the installation process has succeeded or failed. 177 // Called after the installation process has succeeded or failed.
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 icons[i] = manifest.icons(i); 509 icons[i] = manifest.icons(i);
508 510
509 EXPECT_EQ(best_primary_icon_url.spec(), icons[0].src()); 511 EXPECT_EQ(best_primary_icon_url.spec(), icons[0].src());
510 EXPECT_EQ(best_primary_icon_murmur2_hash, icons[0].hash()); 512 EXPECT_EQ(best_primary_icon_murmur2_hash, icons[0].hash());
511 EXPECT_TRUE(icons[0].has_image_data()); 513 EXPECT_TRUE(icons[0].has_image_data());
512 514
513 EXPECT_EQ(icon_url_1.spec(), icons[1].src()); 515 EXPECT_EQ(icon_url_1.spec(), icons[1].src());
514 EXPECT_EQ(icon_murmur2_hash_1, icons[1].hash()); 516 EXPECT_EQ(icon_murmur2_hash_1, icons[1].hash());
515 EXPECT_FALSE(icons[1].has_image_data()); 517 EXPECT_FALSE(icons[1].has_image_data());
516 } 518 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698