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

Unified Diff: components/password_manager/core/browser/password_manager_test_utils.h

Issue 2714543006: Clean Obsolete HTTP Data from the Password Store (Closed)
Patch Set: Raw Cleaner Created 3 years, 9 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: components/password_manager/core/browser/password_manager_test_utils.h
diff --git a/components/password_manager/core/browser/password_manager_test_utils.h b/components/password_manager/core/browser/password_manager_test_utils.h
index 8d1577315d062f3249934595df2f22a8bbe85b4c..137942a4a29f9bb81031c7012b078121d00c1929 100644
--- a/components/password_manager/core/browser/password_manager_test_utils.h
+++ b/components/password_manager/core/browser/password_manager_test_utils.h
@@ -6,12 +6,15 @@
#define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_TEST_UTILS_H_
#include <iosfwd>
+#include <string>
#include <vector>
#include "base/feature_list.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "components/autofill/core/common/password_form.h"
#include "components/password_manager/core/browser/password_store.h"
+#include "net/http/transport_security_state.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace password_manager {
@@ -59,6 +62,11 @@ struct PasswordFormData {
std::unique_ptr<autofill::PasswordForm> CreatePasswordFormFromDataForTesting(
const PasswordFormData& form_data);
+// Convenience method that wraps the passed in forms in unique ptrs and returns
+// the result.
+std::vector<std::unique_ptr<autofill::PasswordForm>> WrapForms(
+ std::vector<autofill::PasswordForm> forms);
+
// Checks whether the PasswordForms pointed to in |actual_values| are in some
// permutation pairwise equal to those in |expectations|. Returns true in case
// of a perfect match; otherwise returns false and writes details of mismatches
@@ -92,6 +100,23 @@ class MockPasswordReuseDetectorConsumer : public PasswordReuseDetectorConsumer {
void(const base::string16&, const std::string&, int, int));
};
+// Auxiliary class to automatically set and reset the HSTS state for a given
+// host.
+class HSTSStateManager {
+ public:
+ HSTSStateManager(net::TransportSecurityState* state,
+ bool is_hsts,
+ const std::string& host);
+ ~HSTSStateManager();
+
+ private:
+ net::TransportSecurityState* state_;
+ const bool is_hsts_;
+ const std::string host_;
+
+ DISALLOW_COPY_AND_ASSIGN(HSTSStateManager);
+};
+
} // namespace password_manager
#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_TEST_UTILS_H_

Powered by Google App Engine
This is Rietveld 408576698