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

Side by Side Diff: content/browser/geofencing/geofencing_manager_unittest.cc

Issue 845313004: Service Worker: Improve error messages from register(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git-cl format Created 5 years, 11 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 | « no previous file | content/browser/service_worker/service_worker_context_core.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/callback.h" 5 #include "base/callback.h"
6 #include "base/message_loop/message_loop.h" 6 #include "base/message_loop/message_loop.h"
7 #include "content/browser/geofencing/geofencing_manager.h" 7 #include "content/browser/geofencing/geofencing_manager.h"
8 #include "content/browser/geofencing/geofencing_service.h" 8 #include "content/browser/geofencing/geofencing_service.h"
9 #include "content/browser/service_worker/embedded_worker_test_helper.h" 9 #include "content/browser/service_worker/embedded_worker_test_helper.h"
10 #include "content/browser/service_worker/service_worker_context_wrapper.h" 10 #include "content/browser/service_worker/service_worker_context_wrapper.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 84
85 private: 85 private:
86 bool was_called_; 86 bool was_called_;
87 GeofencingStatus result_; 87 GeofencingStatus result_;
88 scoped_refptr<MessageLoopRunner> runner_; 88 scoped_refptr<MessageLoopRunner> runner_;
89 }; 89 };
90 90
91 void SaveResponseCallback(bool* called, 91 void SaveResponseCallback(bool* called,
92 int64* store_registration_id, 92 int64* store_registration_id,
93 ServiceWorkerStatusCode status, 93 ServiceWorkerStatusCode status,
94 const std::string& status_message,
94 int64 registration_id) { 95 int64 registration_id) {
95 EXPECT_EQ(SERVICE_WORKER_OK, status) << ServiceWorkerStatusToString(status); 96 EXPECT_EQ(SERVICE_WORKER_OK, status) << ServiceWorkerStatusToString(status);
96 *called = true; 97 *called = true;
97 *store_registration_id = registration_id; 98 *store_registration_id = registration_id;
98 } 99 }
99 100
100 ServiceWorkerContextCore::RegistrationCallback MakeRegisteredCallback( 101 ServiceWorkerContextCore::RegistrationCallback MakeRegisteredCallback(
101 bool* called, 102 bool* called,
102 int64* store_registration_id) { 103 int64* store_registration_id) {
103 return base::Bind(&SaveResponseCallback, called, store_registration_id); 104 return base::Bind(&SaveResponseCallback, called, store_registration_id);
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 GEOFENCING_STATUS_OK, kTestGeofencingRegistrationId)); 504 GEOFENCING_STATUS_OK, kTestGeofencingRegistrationId));
504 VerifyRegions(worker1_->id(), expected_regions_); 505 VerifyRegions(worker1_->id(), expected_regions_);
505 506
506 EXPECT_CALL(*service_, UnregisterRegion(kTestGeofencingRegistrationId)); 507 EXPECT_CALL(*service_, UnregisterRegion(kTestGeofencingRegistrationId));
507 508
508 manager_->SetMockProvider(GeofencingMockState::SERVICE_AVAILABLE); 509 manager_->SetMockProvider(GeofencingMockState::SERVICE_AVAILABLE);
509 VerifyRegions(worker1_->id(), RegionMap()); 510 VerifyRegions(worker1_->id(), RegionMap());
510 } 511 }
511 512
512 } // namespace content 513 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_context_core.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698