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

Unified Diff: chrome/browser/policy/device_policy_cache_unittest.cc

Issue 7345010: Tests for cloud policy UMA metrics. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refactored as a browser_test, share mocks Created 9 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
Index: chrome/browser/policy/device_policy_cache_unittest.cc
diff --git a/chrome/browser/policy/device_policy_cache_unittest.cc b/chrome/browser/policy/device_policy_cache_unittest.cc
index 8346a61b3163e8e98b7188a9e3125a95d796e158..d40de3d1c9c75b852eb37e98124f0f5196b28798 100644
--- a/chrome/browser/policy/device_policy_cache_unittest.cc
+++ b/chrome/browser/policy/device_policy_cache_unittest.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/policy/device_policy_cache.h"
#include "chrome/browser/chromeos/cros/cryptohome_library.h"
+#include "chrome/browser/chromeos/login/mock_signed_settings_helper.h"
#include "chrome/browser/policy/cloud_policy_data_store.h"
#include "chrome/browser/policy/enterprise_install_attributes.h"
#include "policy/configuration_policy_type.h"
@@ -23,40 +24,6 @@ using ::chromeos::SignedSettingsHelper;
using ::testing::_;
using ::testing::InSequence;
-class MockSignedSettingsHelper : public SignedSettingsHelper {
- public:
- MockSignedSettingsHelper() {}
- virtual ~MockSignedSettingsHelper() {}
-
- MOCK_METHOD2(StartStorePolicyOp, void(const em::PolicyFetchResponse&,
- SignedSettingsHelper::Callback*));
- MOCK_METHOD1(StartRetrievePolicyOp, void(SignedSettingsHelper::Callback*));
- MOCK_METHOD1(CancelCallback, void(SignedSettingsHelper::Callback*));
-
- // This test doesn't need these methods, but since they're pure virtual in
- // SignedSettingsHelper, they must be implemented:
- MOCK_METHOD2(StartCheckWhitelistOp, void(const std::string&,
- SignedSettingsHelper::Callback*));
- MOCK_METHOD3(StartWhitelistOp, void(const std::string&, bool,
- SignedSettingsHelper::Callback*));
- MOCK_METHOD3(StartStorePropertyOp, void(const std::string&,
- const std::string&,
- SignedSettingsHelper::Callback*));
- MOCK_METHOD2(StartRetrieveProperty, void(const std::string&,
- SignedSettingsHelper::Callback*));
-
- private:
- DISALLOW_COPY_AND_ASSIGN(MockSignedSettingsHelper);
-};
-
-ACTION_P(MockSignedSettingsHelperStorePolicy, status_code) {
- arg1->OnStorePolicyCompleted(status_code);
-}
-
-ACTION_P2(MockSignedSettingsHelperRetrievePolicy, status_code, policy) {
- arg0->OnRetrievePolicyCompleted(status_code, policy);
-}
-
void CreateRefreshRatePolicy(em::PolicyFetchResponse* policy,
const std::string& user,
int refresh_rate) {

Powered by Google App Engine
This is Rietveld 408576698