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

Unified Diff: chrome/browser/sync/test/integration/fake_server_invalidation_service.h

Issue 267723012: Use FakeServer-based invalidations for Sync tests (try #2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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
Index: chrome/browser/sync/test/integration/fake_server_invalidation_service.h
diff --git a/chrome/browser/invalidation/fake_invalidation_service.h b/chrome/browser/sync/test/integration/fake_server_invalidation_service.h
similarity index 52%
copy from chrome/browser/invalidation/fake_invalidation_service.h
copy to chrome/browser/sync/test/integration/fake_server_invalidation_service.h
index eb7e20d9729f8e107be64e83b1eddf4edb3a093c..6b57503c09355f8bb2fcdba9908b6db5a509e429 100644
--- a/chrome/browser/invalidation/fake_invalidation_service.h
+++ b/chrome/browser/sync/test/integration/fake_server_invalidation_service.h
@@ -1,39 +1,37 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// 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.
-#ifndef CHROME_BROWSER_INVALIDATION_FAKE_INVALIDATION_SERVICE_H_
-#define CHROME_BROWSER_INVALIDATION_FAKE_INVALIDATION_SERVICE_H_
+#ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_FAKE_SERVER_INVALIDATION_SERVICE_H_
+#define CHROME_BROWSER_SYNC_TEST_INTEGRATION_FAKE_SERVER_INVALIDATION_SERVICE_H_
-#include <list>
+#include <string>
#include <utility>
#include "base/basictypes.h"
-#include "base/callback_forward.h"
#include "chrome/browser/invalidation/invalidation_service.h"
#include "chrome/browser/signin/fake_profile_oauth2_token_service.h"
#include "google_apis/gaia/fake_identity_provider.h"
+#include "sync/internal_api/public/base/model_type.h"
#include "sync/notifier/invalidator_registrar.h"
-#include "sync/notifier/mock_ack_handler.h"
+#include "sync/test/fake_server/fake_server.h"
namespace content {
class BrowserContext;
}
-namespace syncer {
-class Invalidation;
-}
-
namespace invalidation {
-
class InvalidationLogger;
+}
-// An InvalidationService that emits invalidations only when
-// its EmitInvalidationForTest method is called.
-class FakeInvalidationService : public InvalidationService {
+namespace fake_server {
+
+// An InvalidationService that is used in conjunction with FakeServer.
+class FakeServerInvalidationService : public invalidation::InvalidationService,
+ public FakeServer::Observer {
public:
- FakeInvalidationService();
- virtual ~FakeInvalidationService();
+ FakeServerInvalidationService();
+ virtual ~FakeServerInvalidationService();
static KeyedService* Build(content::BrowserContext* context);
@@ -47,33 +45,23 @@ class FakeInvalidationService : public InvalidationService {
virtual syncer::InvalidatorState GetInvalidatorState() const OVERRIDE;
virtual std::string GetInvalidatorClientId() const OVERRIDE;
- virtual InvalidationLogger* GetInvalidationLogger() OVERRIDE;
+ virtual invalidation::InvalidationLogger* GetInvalidationLogger() OVERRIDE;
virtual void RequestDetailedStatus(
base::Callback<void(const base::DictionaryValue&)> caller) const OVERRIDE;
virtual IdentityProvider* GetIdentityProvider() OVERRIDE;
- void SetInvalidatorState(syncer::InvalidatorState state);
-
- const syncer::InvalidatorRegistrar& invalidator_registrar() const {
- return invalidator_registrar_;
- }
-
- void EmitInvalidationForTest(const syncer::Invalidation& invalidation);
-
- // Emitted invalidations will be hooked up to this AckHandler. Clients can
- // query it to assert the invalidaitons are being acked properly.
- syncer::MockAckHandler* GetMockAckHandler();
+ // FakeServer::Observer:
+ virtual void OnCommit(syncer::ModelTypeSet committed_model_types) OVERRIDE;
private:
std::string client_id_;
syncer::InvalidatorRegistrar invalidator_registrar_;
- syncer::MockAckHandler mock_ack_handler_;
FakeProfileOAuth2TokenService token_service_;
FakeIdentityProvider identity_provider_;
- DISALLOW_COPY_AND_ASSIGN(FakeInvalidationService);
+ DISALLOW_COPY_AND_ASSIGN(FakeServerInvalidationService);
};
-} // namespace invalidation
+} // namespace fake_server
-#endif // CHROME_BROWSER_INVALIDATION_FAKE_INVALIDATION_SERVICE_H_
+#endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_FAKE_SERVER_INVALIDATION_SERVICE_H_
« no previous file with comments | « no previous file | chrome/browser/sync/test/integration/fake_server_invalidation_service.cc » ('j') | chrome/chrome_tests.gypi » ('J')

Powered by Google App Engine
This is Rietveld 408576698