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

Unified Diff: sync/test/mock_invalidation_tracker.cc

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/test/mock_invalidation_tracker.h ('k') | sync/test/null_directory_change_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/test/mock_invalidation_tracker.cc
diff --git a/sync/test/mock_invalidation_tracker.cc b/sync/test/mock_invalidation_tracker.cc
deleted file mode 100644
index 3ba02d9936dd4b97af3f732f903a6d7cde2201d2..0000000000000000000000000000000000000000
--- a/sync/test/mock_invalidation_tracker.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "sync/test/mock_invalidation_tracker.h"
-
-#include <stdint.h>
-
-#include "base/logging.h"
-#include "sync/test/trackable_mock_invalidation.h"
-
-namespace syncer {
-
-std::unique_ptr<TrackableMockInvalidation>
-MockInvalidationTracker::IssueUnknownVersionInvalidation() {
- return std::unique_ptr<TrackableMockInvalidation>(
- new TrackableMockInvalidation(true, -1, std::string(), this, next_id_++));
-}
-
-std::unique_ptr<TrackableMockInvalidation>
-MockInvalidationTracker::IssueInvalidation(int64_t version,
- const std::string& payload) {
- return std::unique_ptr<TrackableMockInvalidation>(
- new TrackableMockInvalidation(false, version, payload, this, next_id_++));
-}
-
-MockInvalidationTracker::MockInvalidationTracker() : next_id_(0) {
-}
-
-MockInvalidationTracker::~MockInvalidationTracker() {
-}
-
-void MockInvalidationTracker::Acknowledge(int invalidation_id) {
- acknowledged_.insert(invalidation_id);
-}
-
-void MockInvalidationTracker::Drop(int invalidation_id) {
- dropped_.insert(invalidation_id);
-}
-
-bool MockInvalidationTracker::IsUnacked(int invalidation_id) const {
- DCHECK_LE(invalidation_id, next_id_);
- return !IsAcknowledged(invalidation_id) && !IsDropped(invalidation_id);
-}
-
-bool MockInvalidationTracker::IsAcknowledged(int invalidation_id) const {
- DCHECK_LE(invalidation_id, next_id_);
- return acknowledged_.find(invalidation_id) != acknowledged_.end();
-}
-
-bool MockInvalidationTracker::IsDropped(int invalidation_id) const {
- DCHECK_LE(invalidation_id, next_id_);
- return dropped_.find(invalidation_id) != dropped_.end();
-}
-
-bool MockInvalidationTracker::AllInvalidationsAccountedFor() const {
- for (int i = 0; i < next_id_; ++i) {
- if (IsUnacked(i)) {
- return false;
- }
- }
- return true;
-}
-
-} // namespace syncer
« no previous file with comments | « sync/test/mock_invalidation_tracker.h ('k') | sync/test/null_directory_change_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698