#include <stddef.h>
#include <algorithm>
#include <memory>
#include <optional>
#include <sstream>
#include <string>
#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/numerics/safe_conversions.h"
#include "base/observer_list.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "chrome/browser/extensions/api/passwords_private/passwords_private_delegate.h"
#include "chrome/browser/extensions/api/passwords_private/passwords_private_delegate_factory.h"
#include "chrome/browser/extensions/api/passwords_private/passwords_private_event_router.h"
#include "chrome/browser/extensions/api/passwords_private/passwords_private_event_router_factory.h"
#include "chrome/browser/extensions/api/passwords_private/test_passwords_private_delegate.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/common/extensions/api/passwords_private.h"
#include "chrome/test/base/testing_profile.h"
#include "components/keyed_service/core/keyed_service.h"
#include "components/policy/core/browser/browser_policy_connector.h"
#include "components/policy/core/common/mock_configuration_policy_provider.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/core/common/policy_types.h"
#include "components/policy/policy_constants.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/test_utils.h"
#include "extensions/common/switches.h"
#include "ui/base/l10n/time_format.h"
PolicyMap;
NiceMock;
namespace extensions {
namespace {
class PasswordsPrivateApiTest : public ExtensionApiTest { … };
}
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest,
IsAccountStoreDefaultWhenFalse) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, IsAccountStoreDefaultWhenTrue) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest,
GetUrlCollectionWhenUrlValidSucceeds) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest,
GetUrlCollectionWhenUrlInvalidFails) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest,
AddPasswordWhenOperationSucceeds) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, AddPasswordWhenOperationFails) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest,
AddPasswordOperationDisabledByPolicy) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest,
ImportPasswordsOperationDisabledByPolicy) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest,
ChangeCredentialChangePassword) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, ChangeCredentialChangePasskey) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, ChangeCredentialNotFound) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest,
RemoveAndUndoRemoveSavedPassword) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest,
RemoveAndUndoRemovePasswordException) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, RemovePasskey) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, RequestPlaintextPassword) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, RequestPlaintextPasswordFails) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, RequestCredentialsDetails) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest,
RequestCredentialsDetailsFails) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, GetSavedPasswordList) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, GetPasswordExceptionList) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, FetchFamilyMembers) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, SharePassword) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, ImportPasswords) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, ContinueImport) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, ResetImporter) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, ExportPasswords) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, RequestExportProgressStatus) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, IsNotOptedInForAccountStorage) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, IsOptedInForAccountStorage) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, GetInsecureCredentials) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, OptInForAccountStorage) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, OptOutForAccountStorage) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, MuteInsecureCredentialFails) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest,
UnmuteInsecureCredentialSucceeds) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, UnmuteInsecureCredentialFails) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, StartPasswordCheck) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, StartPasswordCheckFailed) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, GetPasswordCheckStatus) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, MovePasswordsToAccount) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, ExtendAuthValidity) { … }
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest,
SwitchBiometricAuthBeforeFillingState) {
EXPECT_FALSE(get_authenticator_interaction_status());
EXPECT_TRUE(RunPasswordsSubtest("switchBiometricAuthBeforeFillingState"))
<< message_;
EXPECT_TRUE(get_authenticator_interaction_status());
}
#endif
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, AddShortcut) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, GetCredentialGroups) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest,
GetCredentialsWithReusedPassword) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, ShowExportedFileInShell) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, ChangePasswordManagerPin) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, IsPasswordManagerPinAvailable) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, DisconnectCloudAuthenticator) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest,
IsConnectedToCloudAuthenticator) { … }
IN_PROC_BROWSER_TEST_F(PasswordsPrivateApiTest, DeleteAllPasswordManagerData) { … }
}