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

Unified Diff: chrome/browser/services/gcm/fake_gcm_profile_service.h

Issue 2657823005: Move //c/b/services/gcm/ to //c/b/gcm/ (Closed)
Patch Set: Created 3 years, 11 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 | « chrome/browser/services/gcm/OWNERS ('k') | chrome/browser/services/gcm/fake_gcm_profile_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/services/gcm/fake_gcm_profile_service.h
diff --git a/chrome/browser/services/gcm/fake_gcm_profile_service.h b/chrome/browser/services/gcm/fake_gcm_profile_service.h
deleted file mode 100644
index aabba5e5aaf0b6edbfaea1d26afdb41eeda48eb9..0000000000000000000000000000000000000000
--- a/chrome/browser/services/gcm/fake_gcm_profile_service.h
+++ /dev/null
@@ -1,89 +0,0 @@
-// Copyright 2013 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_SERVICES_GCM_FAKE_GCM_PROFILE_SERVICE_H_
-#define CHROME_BROWSER_SERVICES_GCM_FAKE_GCM_PROFILE_SERVICE_H_
-
-#include <list>
-#include <memory>
-#include <vector>
-
-#include "base/macros.h"
-#include "components/gcm_driver/gcm_driver.h"
-#include "components/gcm_driver/gcm_profile_service.h"
-
-class Profile;
-
-namespace content {
-class BrowserContext;
-} // namespace content
-
-namespace gcm {
-
-// Acts as a bridge between GCM API and GCMClient layer for testing purposes.
-class FakeGCMProfileService : public GCMProfileService {
- public:
- typedef base::Callback<void(const std::string&)> UnregisterCallback;
-
- // Helper function to be used with
- // KeyedService::SetTestingFactory().
- static std::unique_ptr<KeyedService> Build(content::BrowserContext* context);
-
- explicit FakeGCMProfileService(Profile* profile);
- ~FakeGCMProfileService() override;
-
- void RegisterFinished(const std::string& app_id,
- const std::vector<std::string>& sender_ids);
- void UnregisterFinished(const std::string& app_id);
- void SendFinished(const std::string& app_id,
- const std::string& receiver_id,
- const OutgoingMessage& message);
-
- void AddExpectedUnregisterResponse(GCMClient::Result result);
-
- void SetUnregisterCallback(const UnregisterCallback& callback);
-
- void DispatchMessage(const std::string& app_id,
- const IncomingMessage& message);
-
- const OutgoingMessage& last_sent_message() const {
- return last_sent_message_;
- }
-
- const std::string& last_receiver_id() const {
- return last_receiver_id_;
- }
-
- const std::string& last_registered_app_id() const {
- return last_registered_app_id_;
- }
-
- const std::vector<std::string>& last_registered_sender_ids() const {
- return last_registered_sender_ids_;
- }
-
- void set_collect(bool collect) {
- collect_ = collect;
- }
-
- private:
- // Indicates whether the service will collect paramters of the calls for
- // furter verification in tests.
- bool collect_;
- // Used to give each registration a unique registration id. Does not decrease
- // when unregister is called.
- int registration_count_;
- std::string last_registered_app_id_;
- std::vector<std::string> last_registered_sender_ids_;
- std::list<GCMClient::Result> unregister_responses_;
- OutgoingMessage last_sent_message_;
- std::string last_receiver_id_;
- UnregisterCallback unregister_callback_;
-
- DISALLOW_COPY_AND_ASSIGN(FakeGCMProfileService);
-};
-
-} // namespace gcm
-
-#endif // CHROME_BROWSER_SERVICES_GCM_FAKE_GCM_PROFILE_SERVICE_H_
« no previous file with comments | « chrome/browser/services/gcm/OWNERS ('k') | chrome/browser/services/gcm/fake_gcm_profile_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698