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

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

Issue 629393002: Chromium side of geofencing event dispatching. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@geofencing_serviceworker
Patch Set: nit Created 6 years, 1 month 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 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 "content/browser/geofencing/geofencing_provider.h" 5 #include "content/browser/geofencing/geofencing_provider.h"
6 #include "content/browser/geofencing/geofencing_registration_delegate.h" 6 #include "content/browser/geofencing/geofencing_registration_delegate.h"
7 #include "content/browser/geofencing/geofencing_service.h" 7 #include "content/browser/geofencing/geofencing_service.h"
8 #include "content/public/test/test_browser_thread_bundle.h" 8 #include "content/public/test/test_browser_thread_bundle.h"
9 #include "content/public/test/test_utils.h" 9 #include "content/public/test/test_utils.h"
10 #include "testing/gmock/include/gmock/gmock.h" 10 #include "testing/gmock/include/gmock/gmock.h"
(...skipping 13 matching lines...) Expand all
24 24
25 } // namespace 25 } // namespace
26 26
27 namespace content { 27 namespace content {
28 28
29 class MockGeofencingRegistrationDelegate 29 class MockGeofencingRegistrationDelegate
30 : public GeofencingRegistrationDelegate { 30 : public GeofencingRegistrationDelegate {
31 public: 31 public:
32 MOCK_METHOD2(RegistrationFinished, 32 MOCK_METHOD2(RegistrationFinished,
33 void(int64 geofencing_registration_id, GeofencingStatus status)); 33 void(int64 geofencing_registration_id, GeofencingStatus status));
34 MOCK_METHOD1(RegionEntered, void(int64 geofencing_registration_id));
35 MOCK_METHOD1(RegionExited, void(int64 geofencing_registration_id));
34 }; 36 };
35 37
36 class MockGeofencingProvider : public GeofencingProvider { 38 class MockGeofencingProvider : public GeofencingProvider {
37 public: 39 public:
38 MOCK_METHOD3(RegisterRegion, 40 MOCK_METHOD3(RegisterRegion,
39 void(int64 geofencing_registration_id, 41 void(int64 geofencing_registration_id,
40 const blink::WebCircularGeofencingRegion& region, 42 const blink::WebCircularGeofencingRegion& region,
41 const StatusCallback& callback)); 43 const StatusCallback& callback));
42 MOCK_METHOD1(UnregisterRegion, void(int64 geofencing_registration_id)); 44 MOCK_METHOD1(UnregisterRegion, void(int64 geofencing_registration_id));
43 }; 45 };
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 // provider to be called. The delegate should not be called in this case. 184 // provider to be called. The delegate should not be called in this case.
183 EXPECT_CALL(delegate_, RegistrationFinished(testing::_, testing::_)).Times(0); 185 EXPECT_CALL(delegate_, RegistrationFinished(testing::_, testing::_)).Times(0);
184 EXPECT_CALL(*provider_, UnregisterRegion(geofencing_registration_id)) 186 EXPECT_CALL(*provider_, UnregisterRegion(geofencing_registration_id))
185 .WillOnce(QuitRunner(runner)); 187 .WillOnce(QuitRunner(runner));
186 callback.Run(GEOFENCING_STATUS_OK); 188 callback.Run(GEOFENCING_STATUS_OK);
187 runner->Run(); 189 runner->Run();
188 EXPECT_EQ(0, RegistrationCount()); 190 EXPECT_EQ(0, RegistrationCount());
189 } 191 }
190 192
191 } // namespace content 193 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/geofencing/geofencing_registration_delegate.h ('k') | content/browser/service_worker/service_worker_version.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698