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

Side by Side Diff: chrome/browser/extensions/api/push_messaging/push_messaging_invalidation_handler_unittest.cc

Issue 11052007: Rename ModelType/ObjectIdStateMap to InvalidationMap. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/extensions/api/push_messaging/push_messaging_invalidati on_handler.h" 5 #include "chrome/browser/extensions/api/push_messaging/push_messaging_invalidati on_handler.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "chrome/browser/extensions/api/push_messaging/push_messaging_invalidati on_handler_delegate.h" 9 #include "chrome/browser/extensions/api/push_messaging/push_messaging_invalidati on_handler_delegate.h"
10 #include "chrome/browser/sync/invalidation_frontend.h" 10 #include "chrome/browser/sync/invalidation_frontend.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 ids.insert(invalidation::ObjectId( 157 ids.insert(invalidation::ObjectId(
158 kSourceId, 158 kSourceId,
159 "U/dddddddddddddddddddddddddddddddd/0")); 159 "U/dddddddddddddddddddddddddddddddd/0"));
160 ids.insert(invalidation::ObjectId( 160 ids.insert(invalidation::ObjectId(
161 kSourceId, 161 kSourceId,
162 "U/dddddddddddddddddddddddddddddddd/3")); 162 "U/dddddddddddddddddddddddddddddddd/3"));
163 EXPECT_CALL(delegate_, 163 EXPECT_CALL(delegate_,
164 OnMessage("dddddddddddddddddddddddddddddddd", 0, "payload")); 164 OnMessage("dddddddddddddddddddddddddddddddd", 0, "payload"));
165 EXPECT_CALL(delegate_, 165 EXPECT_CALL(delegate_,
166 OnMessage("dddddddddddddddddddddddddddddddd", 3, "payload")); 166 OnMessage("dddddddddddddddddddddddddddddddd", 3, "payload"));
167 handler_->OnIncomingInvalidation(ObjectIdSetToStateMap(ids, "payload"), 167 handler_->OnIncomingInvalidation(ObjectIdSetToInvalidationMap(ids, "payload"),
168 syncer::REMOTE_INVALIDATION); 168 syncer::REMOTE_INVALIDATION);
169 } 169 }
170 170
171 // Tests that malformed object IDs don't trigger spurious callbacks. 171 // Tests that malformed object IDs don't trigger spurious callbacks.
172 TEST_F(PushMessagingInvalidationHandlerTest, DispatchInvalidObjectIds) { 172 TEST_F(PushMessagingInvalidationHandlerTest, DispatchInvalidObjectIds) {
173 syncer::ObjectIdSet ids; 173 syncer::ObjectIdSet ids;
174 // Completely incorrect format. 174 // Completely incorrect format.
175 ids.insert(invalidation::ObjectId( 175 ids.insert(invalidation::ObjectId(
176 ipc::invalidation::ObjectSource::TEST, 176 ipc::invalidation::ObjectSource::TEST,
177 "Invalid")); 177 "Invalid"));
(...skipping 10 matching lines...) Expand all
188 kSourceId, 188 kSourceId,
189 "U/ddddddddddddddddddddddddddddddddd/3")); 189 "U/ddddddddddddddddddddddddddddddddd/3"));
190 // Non-numeric subchannel. 190 // Non-numeric subchannel.
191 ids.insert(invalidation::ObjectId( 191 ids.insert(invalidation::ObjectId(
192 kSourceId, 192 kSourceId,
193 "U/dddddddddddddddddddddddddddddddd/z")); 193 "U/dddddddddddddddddddddddddddddddd/z"));
194 // Subchannel out of range. 194 // Subchannel out of range.
195 ids.insert(invalidation::ObjectId( 195 ids.insert(invalidation::ObjectId(
196 kSourceId, 196 kSourceId,
197 "U/dddddddddddddddddddddddddddddddd/4")); 197 "U/dddddddddddddddddddddddddddddddd/4"));
198 handler_->OnIncomingInvalidation(ObjectIdSetToStateMap(ids, "payload"), 198 handler_->OnIncomingInvalidation(ObjectIdSetToInvalidationMap(ids, "payload"),
199 syncer::REMOTE_INVALIDATION); 199 syncer::REMOTE_INVALIDATION);
200 } 200 }
201 201
202 } // namespace extensions 202 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698