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

Unified Diff: chrome/browser/password_manager/password_manager_test_base.h

Issue 1271053002: [PasswordManager] Fix Flaky BrowserTest related to dynamically created (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 4 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/password_manager/password_manager_test_base.h
diff --git a/chrome/browser/password_manager/password_manager_test_base.h b/chrome/browser/password_manager/password_manager_test_base.h
index 2a134ac98b5a7f375aea5cfea707687d9116486f..1135de863df14c0e4247a651a15bb08438341913 100644
--- a/chrome/browser/password_manager/password_manager_test_base.h
+++ b/chrome/browser/password_manager/password_manager_test_base.h
@@ -8,6 +8,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "chrome/test/base/in_process_browser_test.h"
+#include "components/password_manager/core/browser/password_store_consumer.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/test/test_utils.h"
@@ -15,6 +16,10 @@ namespace autofill {
struct PasswordForm;
}
+namespace password_manager {
+class PasswordStore;
+}
+
class NavigationObserver : public content::WebContentsObserver {
public:
explicit NavigationObserver(content::WebContents* web_contents);
@@ -52,6 +57,26 @@ class NavigationObserver : public content::WebContentsObserver {
DISALLOW_COPY_AND_ASSIGN(NavigationObserver);
};
+class DummyStoreConsumer : public password_manager::PasswordStoreConsumer {
+ public:
+ DummyStoreConsumer();
+ ~DummyStoreConsumer() override;
+
+ // password_manager::PasswordStoreConsumer
+ void OnGetPasswordStoreResults(
+ ScopedVector<autofill::PasswordForm> results) override;
+
+ // Make a dummy GetLogins() request ot |password_store| and wait for its
+ // response
+ void RequestLoginsAndWait(
+ scoped_refptr<password_manager::PasswordStore> password_store);
+
+ private:
+ scoped_refptr<content::MessageLoopRunner> message_loop_runner_;
+
+ DISALLOW_COPY_AND_ASSIGN(DummyStoreConsumer);
+};
+
// Observes the save password prompt (bubble or infobar) for a specified
// WebContents, keeps track of whether or not it is currently shown, and allows
// accepting saving passwords through it.

Powered by Google App Engine
This is Rietveld 408576698