Skip to content

Commit

Permalink
Add password manager entry as part of the network auditor
Browse files Browse the repository at this point in the history
  • Loading branch information
fmarier committed Apr 27, 2023
1 parent 1154cde commit 0c01bd6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions browser/net/brave_network_audit_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "brave/browser/ui/brave_browser.h"
#include "brave/components/brave_rewards/browser/rewards_service_impl.h"
#include "brave/components/playlist/common/buildflags/buildflags.h"
#include "chrome/browser/password_manager/password_store_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/test/base/in_process_browser_test.h"
Expand Down Expand Up @@ -300,6 +301,19 @@ IN_PROC_BROWSER_TEST_F(BraveNetworkAuditTest, BasicTests) {
ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), GURL("brave://welcome")));
WaitForTimeout(kMaxTimeoutPerLoadedURL);

// Add a password to the password manager.
password_manager::PasswordStoreInterface* password_store =
PasswordStoreFactory::GetForProfile(browser()->profile(),
ServiceAccessType::IMPLICIT_ACCESS)
.get();
password_manager::PasswordForm signin_form;
signin_form.signon_realm = "https://www.facebook.com/";
signin_form.url = GURL("https://www.facebook.com/");
signin_form.action = GURL("https://www.facebook.com/");
signin_form.username_value = u"john";
signin_form.password_value = u"password1";
password_store->AddLogin(signin_form);

// Load the NTP to check requests made from the JS widgets.
ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), GURL("brave://newtab")));
WaitForTimeout(kMaxTimeoutPerLoadedURL);
Expand Down

0 comments on commit 0c01bd6

Please sign in to comment.