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

Unified Diff: chrome/browser/policy/cloud/device_management_service_unittest.cc

Issue 25690003: Refactored the DeviceManagementService to get its parameters from a delegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comments Created 7 years, 2 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/policy/cloud/device_management_service_unittest.cc
diff --git a/chrome/browser/policy/cloud/device_management_service_unittest.cc b/chrome/browser/policy/cloud/device_management_service_unittest.cc
index 0e49437933da50e4d610b341fd52e3bb5100dc0e..df6249211fabaef679c13ef87995cc81a36e98f9 100644
--- a/chrome/browser/policy/cloud/device_management_service_unittest.cc
+++ b/chrome/browser/policy/cloud/device_management_service_unittest.cc
@@ -12,6 +12,7 @@
#include "base/strings/string_split.h"
#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
#include "chrome/browser/policy/cloud/device_management_service.h"
+#include "chrome/browser/policy/cloud/mock_device_management_service.h"
#include "net/base/escape.h"
#include "net/base/load_flags.h"
#include "net/base/net_errors.h"
@@ -30,8 +31,6 @@ namespace em = enterprise_management;
namespace policy {
const char kServiceUrl[] = "https://example.com/management_service";
-const char kUserAgent[] = "Chrome 1.2.3(456)";
-const char kPlatform[] = "Test|Unit|1.2.3";
// Encoded empty response messages for testing the error code paths.
const char kResponseEmpty[] = "\x08\x00";
@@ -63,12 +62,10 @@ class DeviceManagementServiceTestBase : public testing::Test {
}
void ResetService() {
- service_.reset(new DeviceManagementService(
- request_context_,
- kServiceUrl,
- kUserAgent,
- kUserAgent,
- kPlatform));
+ scoped_ptr<DeviceManagementService::Configuration> configuration(
+ new MockDeviceManagementServiceConfiguration(kServiceUrl));
+ service_.reset(
+ new DeviceManagementService(configuration.Pass(), request_context_));
}
void InitializeService() {

Powered by Google App Engine
This is Rietveld 408576698