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

Unified Diff: chrome/browser/policy/cloud/mock_device_management_service.h

Issue 109743002: Move policy code into components/policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: moar fixes Created 7 years 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/policy/cloud/mock_device_management_service.h
diff --git a/chrome/browser/policy/cloud/mock_device_management_service.h b/chrome/browser/policy/cloud/mock_device_management_service.h
deleted file mode 100644
index c992c55f7b7ea3830276da393b26276b78788171..0000000000000000000000000000000000000000
--- a/chrome/browser/policy/cloud/mock_device_management_service.h
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright (c) 2012 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_POLICY_CLOUD_MOCK_DEVICE_MANAGEMENT_SERVICE_H_
-#define CHROME_BROWSER_POLICY_CLOUD_MOCK_DEVICE_MANAGEMENT_SERVICE_H_
-
-#include <string>
-
-#include "base/basictypes.h"
-#include "chrome/browser/policy/cloud/device_management_service.h"
-#include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
-#include "testing/gmock/include/gmock/gmock.h"
-
-namespace policy {
-
-class MockDeviceManagementJob {
- public:
- virtual ~MockDeviceManagementJob();
- virtual void RetryJob() = 0;
- virtual void SendResponse(
- DeviceManagementStatus status,
- const enterprise_management::DeviceManagementResponse& response) = 0;
-};
-
-class MockDeviceManagementServiceConfiguration
- : public DeviceManagementService::Configuration {
- public:
- MockDeviceManagementServiceConfiguration();
- explicit MockDeviceManagementServiceConfiguration(
- const std::string& server_url);
- virtual ~MockDeviceManagementServiceConfiguration();
-
- virtual std::string GetServerUrl() OVERRIDE;
- virtual std::string GetAgentParameter() OVERRIDE;
- virtual std::string GetPlatformParameter() OVERRIDE;
-
- private:
- const std::string server_url_;
-
- DISALLOW_COPY_AND_ASSIGN(MockDeviceManagementServiceConfiguration);
-};
-
-class MockDeviceManagementService : public DeviceManagementService {
- public:
- MockDeviceManagementService();
- virtual ~MockDeviceManagementService();
-
- typedef DeviceManagementRequestJob* CreateJobFunction(
- DeviceManagementRequestJob::JobType, net::URLRequestContextGetter*);
-
- MOCK_METHOD2(CreateJob, CreateJobFunction);
- MOCK_METHOD7(
- StartJob,
- void(const std::string& request_type,
- const std::string& gaia_token,
- const std::string& oauth_token,
- const std::string& dm_token,
- const std::string& user_affiliation,
- const std::string& client_id,
- const enterprise_management::DeviceManagementRequest& request));
-
- // Creates a gmock action that will make the job succeed.
- testing::Action<CreateJobFunction> SucceedJob(
- const enterprise_management::DeviceManagementResponse& response);
-
- // Creates a gmock action which will fail the job with the given error.
- testing::Action<CreateJobFunction> FailJob(DeviceManagementStatus status);
-
- // Creates a gmock action which will capture the job so the test code can
- // delay job completion.
- testing::Action<CreateJobFunction> CreateAsyncJob(
- MockDeviceManagementJob** job);
-
- private:
- DISALLOW_COPY_AND_ASSIGN(MockDeviceManagementService);
-};
-
-} // namespace policy
-
-#endif // CHROME_BROWSER_POLICY_CLOUD_MOCK_DEVICE_MANAGEMENT_SERVICE_H_
« no previous file with comments | « chrome/browser/policy/cloud/mock_cloud_policy_store.cc ('k') | chrome/browser/policy/cloud/mock_device_management_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698