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

Side by Side Diff: sync/notifier/chrome_invalidation_client_unittest.cc

Issue 10698014: [Sync] Rename csync namespace to syncer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 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 | Annotate | Revision Log
« no previous file with comments | « sync/notifier/chrome_invalidation_client.cc ('k') | sync/notifier/chrome_system_resources.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 (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 <string> 5 #include <string>
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "google/cacheinvalidation/include/invalidation-client.h" 8 #include "google/cacheinvalidation/include/invalidation-client.h"
9 #include "google/cacheinvalidation/include/types.h" 9 #include "google/cacheinvalidation/include/types.h"
10 #include "google/cacheinvalidation/v2/types.pb.h" 10 #include "google/cacheinvalidation/v2/types.pb.h"
11 #include "jingle/notifier/listener/fake_push_client.h" 11 #include "jingle/notifier/listener/fake_push_client.h"
12 #include "sync/internal_api/public/syncable/model_type.h" 12 #include "sync/internal_api/public/syncable/model_type.h"
13 #include "sync/internal_api/public/syncable/model_type_payload_map.h" 13 #include "sync/internal_api/public/syncable/model_type_payload_map.h"
14 #include "sync/internal_api/public/util/weak_handle.h" 14 #include "sync/internal_api/public/util/weak_handle.h"
15 #include "sync/notifier/chrome_invalidation_client.h" 15 #include "sync/notifier/chrome_invalidation_client.h"
16 #include "sync/notifier/mock_invalidation_state_tracker.h" 16 #include "sync/notifier/mock_invalidation_state_tracker.h"
17 #include "testing/gmock/include/gmock/gmock.h" 17 #include "testing/gmock/include/gmock/gmock.h"
18 #include "testing/gtest/include/gtest/gtest.h" 18 #include "testing/gtest/include/gtest/gtest.h"
19 19
20 namespace csync { 20 namespace syncer {
21 21
22 using ::testing::_; 22 using ::testing::_;
23 using ::testing::InSequence; 23 using ::testing::InSequence;
24 using ::testing::Return; 24 using ::testing::Return;
25 using ::testing::StrictMock; 25 using ::testing::StrictMock;
26 26
27 namespace { 27 namespace {
28 28
29 const char kClientId[] = "client_id"; 29 const char kClientId[] = "client_id";
30 const char kClientInfo[] = "client_info"; 30 const char kClientInfo[] = "client_info";
(...skipping 28 matching lines...) Expand all
59 : fake_push_client_(new notifier::FakePushClient()), 59 : fake_push_client_(new notifier::FakePushClient()),
60 client_(scoped_ptr<notifier::PushClient>(fake_push_client_)), 60 client_(scoped_ptr<notifier::PushClient>(fake_push_client_)),
61 kBookmarksId_(kChromeSyncSourceId, "BOOKMARK"), 61 kBookmarksId_(kChromeSyncSourceId, "BOOKMARK"),
62 kPreferencesId_(kChromeSyncSourceId, "PREFERENCE"), 62 kPreferencesId_(kChromeSyncSourceId, "PREFERENCE"),
63 kExtensionsId_(kChromeSyncSourceId, "EXTENSION"), 63 kExtensionsId_(kChromeSyncSourceId, "EXTENSION"),
64 kAppsId_(kChromeSyncSourceId, "APP") {} 64 kAppsId_(kChromeSyncSourceId, "APP") {}
65 65
66 virtual void SetUp() { 66 virtual void SetUp() {
67 client_.Start(kClientId, kClientInfo, kState, 67 client_.Start(kClientId, kClientInfo, kState,
68 InvalidationVersionMap(), 68 InvalidationVersionMap(),
69 csync::MakeWeakHandle( 69 syncer::MakeWeakHandle(
70 mock_invalidation_state_tracker_.AsWeakPtr()), 70 mock_invalidation_state_tracker_.AsWeakPtr()),
71 &mock_listener_); 71 &mock_listener_);
72 } 72 }
73 73
74 virtual void TearDown() { 74 virtual void TearDown() {
75 // client_.Stop() stops the invalidation scheduler, which deletes any 75 // client_.Stop() stops the invalidation scheduler, which deletes any
76 // pending tasks without running them. Some tasks "run and delete" another 76 // pending tasks without running them. Some tasks "run and delete" another
77 // task, so they must be run in order to avoid leaking the inner task. 77 // task, so they must be run in order to avoid leaking the inner task.
78 // client_.Stop() does not schedule any tasks, so it's both necessary and 78 // client_.Stop() does not schedule any tasks, so it's both necessary and
79 // sufficient to drain the task queue before calling it. 79 // sufficient to drain the task queue before calling it.
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 "auth error", 338 "auth error",
339 invalidation::ErrorContext())); 339 invalidation::ErrorContext()));
340 fake_push_client_->DisableNotifications( 340 fake_push_client_->DisableNotifications(
341 notifier::TRANSIENT_NOTIFICATION_ERROR); 341 notifier::TRANSIENT_NOTIFICATION_ERROR);
342 fake_push_client_->DisableNotifications( 342 fake_push_client_->DisableNotifications(
343 notifier::NOTIFICATION_CREDENTIALS_REJECTED); 343 notifier::NOTIFICATION_CREDENTIALS_REJECTED);
344 fake_push_client_->EnableNotifications(); 344 fake_push_client_->EnableNotifications();
345 client_.Ready(NULL); 345 client_.Ready(NULL);
346 } 346 }
347 347
348 } // namespace csync 348 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/notifier/chrome_invalidation_client.cc ('k') | sync/notifier/chrome_system_resources.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698