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

Side by Side Diff: content/browser/background_sync/background_sync_manager_unittest.cc

Issue 1230213004: [Background Sync] Sent sync registration details to worker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bgsync-event-mek
Patch Set: Remove const ref from mojo StructPtr (with rebase) Created 5 years, 5 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "content/browser/background_sync/background_sync_manager.h" 5 #include "content/browser/background_sync/background_sync_manager.h"
6 6
7 #include "base/files/scoped_temp_dir.h" 7 #include "base/files/scoped_temp_dir.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/power_monitor/power_monitor.h" 10 #include "base/power_monitor/power_monitor.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 continuation_ = 176 continuation_ =
177 base::Bind(&TestBackgroundSyncManager::GetDataFromBackendContinue, 177 base::Bind(&TestBackgroundSyncManager::GetDataFromBackendContinue,
178 base::Unretained(this), key, callback); 178 base::Unretained(this), key, callback);
179 if (delay_backend_) 179 if (delay_backend_)
180 return; 180 return;
181 181
182 Continue(); 182 Continue();
183 } 183 }
184 184
185 void FireOneShotSync( 185 void FireOneShotSync(
186 const BackgroundSyncRegistration& registration,
186 const scoped_refptr<ServiceWorkerVersion>& active_version, 187 const scoped_refptr<ServiceWorkerVersion>& active_version,
187 const ServiceWorkerVersion::StatusCallback& callback) override { 188 const ServiceWorkerVersion::StatusCallback& callback) override {
188 if (one_shot_callback_.is_null()) { 189 if (one_shot_callback_.is_null()) {
189 BackgroundSyncManager::FireOneShotSync(active_version, callback); 190 BackgroundSyncManager::FireOneShotSync(registration, active_version,
191 callback);
190 } else { 192 } else {
191 one_shot_callback_.Run(active_version, callback); 193 one_shot_callback_.Run(active_version, callback);
192 } 194 }
193 } 195 }
194 196
195 private: 197 private:
196 bool corrupt_backend_ = false; 198 bool corrupt_backend_ = false;
197 bool delay_backend_ = false; 199 bool delay_backend_ = false;
198 base::Closure continuation_; 200 base::Closure continuation_;
199 OneShotCallback one_shot_callback_; 201 OneShotCallback one_shot_callback_;
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
1230 RegisterAndVerifySyncEventDelayed(sync_options_1_); 1232 RegisterAndVerifySyncEventDelayed(sync_options_1_);
1231 1233
1232 // Create a new manager which should fire the sync again on init. 1234 // Create a new manager which should fire the sync again on init.
1233 SetupBackgroundSyncManager(); 1235 SetupBackgroundSyncManager();
1234 InitSyncEventTest(); 1236 InitSyncEventTest();
1235 EXPECT_FALSE(GetRegistration(sync_options_1_)); 1237 EXPECT_FALSE(GetRegistration(sync_options_1_));
1236 EXPECT_EQ(2, sync_events_called_); 1238 EXPECT_EQ(2, sync_events_called_);
1237 } 1239 }
1238 1240
1239 } // namespace content 1241 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698