kbtest

package
v0.0.0-...-48c56db Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2021 License: BSD-3-Clause Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDeviceName = "my device"

Variables

This section is empty.

Functions

func AssertProvisioned

func AssertProvisioned(tc libkb.TestContext) error

func CanonicalTlfNameForTest

func CanonicalTlfNameForTest(tlfName string) keybase1.CanonicalTlfName

func CheckTeamMiscNotifications

func CheckTeamMiscNotifications(tc libkb.TestContext, notifications *TeamNotifyListener)

func DeleteAccount

func DeleteAccount(tc libkb.TestContext, u *FakeUser)

func EditProfile

func EditProfile(mctx libkb.MetaContext, arg keybase1.ProfileEditArg) error

func FakeSalt

func FakeSalt() []byte

func GenerateRandomEmailAddress

func GenerateRandomEmailAddress() keybase1.EmailAddress

func GenerateTestPhoneNumber

func GenerateTestPhoneNumber() string

GenerateTestPhoneNumber generates a random phone number in US with 555 area code. It passes serverside "strict phone number" checker test, and it's considered `possible`, but not `valid` by libphonenumber.

func GetContactSettings

func GetContactSettings(tc libkb.TestContext, u *FakeUser) (ret keybase1.ContactSettings)

func GetPhoneVerificationCode

func GetPhoneVerificationCode(mctx libkb.MetaContext, phoneNumber keybase1.PhoneNumber) (code string, err error)

func Logout

func Logout(tc libkb.TestContext)

copied from engine/common_test.go

func LogoutAndLoginAs

func LogoutAndLoginAs(tc libkb.TestContext, fu *FakeUser)

func NewMetaContextForTest

func NewMetaContextForTest(c ChatTestContext) libkb.MetaContext

func ProvisionNewDeviceKex

func ProvisionNewDeviceKex(tcX *libkb.TestContext, tcY *libkb.TestContext, userX *FakeUser, newDeviceType keybase1.DeviceTypeV2)

Provision a new device (in context tcY) from the active (and logged in) device in test context tcX. This was adapted from engine/kex2_test.go Note that it uses Errorf in goroutines, so if it fails the test will not fail until later. `tcX` is a TestContext where device X (the provisioner) is already provisioned and logged in. this function will provision a new device Y inside `tcY` `newDeviceType` is keybase1.DeviceTypeV2_MOBILE or keybase1.DeviceTypeV2_DESKTOP.

func ResetAccount

func ResetAccount(tc libkb.TestContext, u *FakeUser)

copied from engine/common_test.go

func RotatePaper

func RotatePaper(tc libkb.TestContext, u *FakeUser)

summarized from engine/revoke_test.go

func RunTrack

func RunTrack(tc libkb.TestContext, fu *FakeUser, username string) (them *libkb.User, err error)

func RunTrackWithOptions

func RunTrackWithOptions(tc libkb.TestContext, fu *FakeUser, username string, options keybase1.TrackOptions, secretUI libkb.SecretUI, forceRemoteCheck bool) (them *libkb.User, err error)

func RunningInCI

func RunningInCI() bool

func SetContactSettings

func SetContactSettings(tc libkb.TestContext, u *FakeUser, arg keybase1.ContactSettings)

func SkipIconRemoteTest

func SkipIconRemoteTest() bool

CORE-10146

func SkipTestOnNonMasterCI

func SkipTestOnNonMasterCI(t *testing.T, reason string)

func VerifyEmailAuto

func VerifyEmailAuto(mctx libkb.MetaContext, email keybase1.EmailAddress) error

Types

type ByUsername

type ByUsername []*FakeUser

func (ByUsername) Len

func (m ByUsername) Len() int

func (ByUsername) Less

func (m ByUsername) Less(i, j int) bool

func (ByUsername) Swap

func (m ByUsername) Swap(i, j int)

type ChatMockWorld

type ChatMockWorld struct {
	Fc clockwork.FakeClock

	T       testing.TB
	Tcs     map[string]*ChatTestContext
	TcsByID map[string]*ChatTestContext
	Users   map[string]*FakeUser

	// each slice should always be sorted by message ID in desc, i.e. newest messages first
	Msgs map[chat1.ConvIDStr][]*chat1.MessageBoxed
	// contains filtered or unexported fields
}

func NewChatMockWorld

func NewChatMockWorld(t *testing.T, name string, numUsers int) (world *ChatMockWorld)

func (*ChatMockWorld) Cleanup

func (w *ChatMockWorld) Cleanup()

func (*ChatMockWorld) GetConversationByID

func (w *ChatMockWorld) GetConversationByID(convID chat1.ConversationID) *chat1.Conversation

func (*ChatMockWorld) GetUsers

func (w *ChatMockWorld) GetUsers() (res []*FakeUser)

type ChatRemoteMock

type ChatRemoteMock struct {
	CacheBodiesVersion int
	CacheInboxVersion  int

	GetThreadRemoteFunc func(m *ChatRemoteMock, ctx context.Context, arg chat1.GetThreadRemoteArg) (chat1.GetThreadRemoteRes, error)
	SyncInboxFunc       func(m *ChatRemoteMock, ctx context.Context, vers chat1.InboxVers) (chat1.SyncInboxRes, error)
	// contains filtered or unexported fields
}

func NewChatRemoteMock

func NewChatRemoteMock(world *ChatMockWorld) (m *ChatRemoteMock)

func (*ChatRemoteMock) AdvertiseBotCommands

func (*ChatRemoteMock) BroadcastGregorMessageToConv

func (m *ChatRemoteMock) BroadcastGregorMessageToConv(ctx context.Context,
	arg chat1.BroadcastGregorMessageToConvArg) error

func (*ChatRemoteMock) ClearBotCommands

func (m *ChatRemoteMock) ClearBotCommands(ctx context.Context, filter *chat1.RemoteClearBotCommandsFilter) (res chat1.ClearBotCommandsRes, err error)

func (*ChatRemoteMock) DeleteConversation

func (*ChatRemoteMock) FailSharePost

func (m *ChatRemoteMock) FailSharePost(ctx context.Context, _ chat1.FailSharePostArg) error

func (*ChatRemoteMock) GetBotInfo

func (m *ChatRemoteMock) GetBotInfo(ctx context.Context, arg chat1.GetBotInfoArg) (res chat1.GetBotInfoRes, err error)

func (*ChatRemoteMock) GetConversationMetadataRemote

func (m *ChatRemoteMock) GetConversationMetadataRemote(ctx context.Context, convID chat1.ConversationID) (res chat1.GetConversationMetadataRemoteRes, err error)

func (*ChatRemoteMock) GetDefaultTeamChannels

func (m *ChatRemoteMock) GetDefaultTeamChannels(ctx context.Context, teamID keybase1.TeamID) (res chat1.GetDefaultTeamChannelsRes, err error)

func (*ChatRemoteMock) GetExternalAPIKeys

func (m *ChatRemoteMock) GetExternalAPIKeys(ctx context.Context, typs []chat1.ExternalAPIKeyTyp) (res []chat1.ExternalAPIKey, err error)

func (*ChatRemoteMock) GetGlobalAppNotificationSettings

func (m *ChatRemoteMock) GetGlobalAppNotificationSettings(ctx context.Context) (chat1.GlobalAppNotificationSettings, error)

func (*ChatRemoteMock) GetInboxByTLFIDRemote

func (m *ChatRemoteMock) GetInboxByTLFIDRemote(ctx context.Context, tlfID chat1.TLFID) (res chat1.GetInboxByTLFIDRemoteRes, err error)

func (*ChatRemoteMock) GetInboxRemote

func (m *ChatRemoteMock) GetInboxRemote(ctx context.Context, arg chat1.GetInboxRemoteArg) (res chat1.GetInboxRemoteRes, err error)

func (*ChatRemoteMock) GetInboxVersion

func (m *ChatRemoteMock) GetInboxVersion(ctx context.Context, uid gregor1.UID) (chat1.InboxVers, error)

func (*ChatRemoteMock) GetLastActiveAt

func (m *ChatRemoteMock) GetLastActiveAt(ctx context.Context, arg chat1.GetLastActiveAtArg) (res chat1.GetLastActiveAtRes, err error)

func (*ChatRemoteMock) GetMessageBefore

func (*ChatRemoteMock) GetMessagesRemote

func (m *ChatRemoteMock) GetMessagesRemote(ctx context.Context, arg chat1.GetMessagesRemoteArg) (res chat1.GetMessagesRemoteRes, err error)

func (*ChatRemoteMock) GetPublicConversations

func (m *ChatRemoteMock) GetPublicConversations(ctx context.Context, arg chat1.GetPublicConversationsArg) (res chat1.GetPublicConversationsRes, err error)

func (*ChatRemoteMock) GetRecentJoins

func (m *ChatRemoteMock) GetRecentJoins(ctx context.Context, convID chat1.ConversationID) (res chat1.GetRecentJoinsRes, err error)

func (*ChatRemoteMock) GetResetConversations

func (m *ChatRemoteMock) GetResetConversations(ctx context.Context) (res chat1.GetResetConversationsRes, err error)

func (*ChatRemoteMock) GetS3Params

func (*ChatRemoteMock) GetTLFConversations

func (*ChatRemoteMock) GetThreadRemote

func (m *ChatRemoteMock) GetThreadRemote(ctx context.Context, arg chat1.GetThreadRemoteArg) (res chat1.GetThreadRemoteRes, err error)

func (*ChatRemoteMock) GetUnreadUpdateFull

func (m *ChatRemoteMock) GetUnreadUpdateFull(ctx context.Context, inboxVers chat1.InboxVers) (chat1.UnreadUpdateFull, error)

func (*ChatRemoteMock) GetUnreadlineRemote

func (m *ChatRemoteMock) GetUnreadlineRemote(ctx context.Context, arg chat1.GetUnreadlineRemoteArg) (res chat1.GetUnreadlineRemoteRes, err error)

func (*ChatRemoteMock) JoinConversation

func (*ChatRemoteMock) LeaveConversation

func (*ChatRemoteMock) MarkAsRead

func (m *ChatRemoteMock) MarkAsRead(ctx context.Context, arg chat1.MarkAsReadArg) (res chat1.MarkAsReadRes, err error)

func (*ChatRemoteMock) NewConversationRemote

func (m *ChatRemoteMock) NewConversationRemote(ctx context.Context, arg chat1.ConversationIDTriple) (res chat1.NewConversationRemoteRes, err error)

func (*ChatRemoteMock) NewConversationRemote2

func (m *ChatRemoteMock) NewConversationRemote2(ctx context.Context, arg chat1.NewConversationRemote2Arg) (res chat1.NewConversationRemoteRes, err error)

func (*ChatRemoteMock) PostRemote

func (m *ChatRemoteMock) PostRemote(ctx context.Context, arg chat1.PostRemoteArg) (res chat1.PostRemoteRes, err error)

func (*ChatRemoteMock) PreviewConversation

func (*ChatRemoteMock) RefreshParticipantsRemote

func (m *ChatRemoteMock) RefreshParticipantsRemote(ctx context.Context,
	arg chat1.RefreshParticipantsRemoteArg) (res chat1.RefreshParticipantsRemoteRes, err error)

func (*ChatRemoteMock) RegisterSharePost

func (m *ChatRemoteMock) RegisterSharePost(ctx context.Context, _ chat1.RegisterSharePostArg) error

func (*ChatRemoteMock) RemoteNotificationSuccessful

func (m *ChatRemoteMock) RemoteNotificationSuccessful(ctx context.Context, arg chat1.RemoteNotificationSuccessfulArg) error

func (*ChatRemoteMock) RetentionSweepConv

func (m *ChatRemoteMock) RetentionSweepConv(ctx context.Context, convID chat1.ConversationID) (res chat1.SweepRes, err error)

func (*ChatRemoteMock) S3Sign

func (*ChatRemoteMock) ServerNow

func (m *ChatRemoteMock) ServerNow(ctx context.Context) (res chat1.ServerNowRes, err error)

func (*ChatRemoteMock) SetAppNotificationSettings

func (*ChatRemoteMock) SetConvMinWriterRole

func (*ChatRemoteMock) SetConvRetention

func (m *ChatRemoteMock) SetConvRetention(ctx context.Context, _ chat1.SetConvRetentionArg) (res chat1.SetRetentionRes, err error)

func (*ChatRemoteMock) SetConversationStatus

func (m *ChatRemoteMock) SetConversationStatus(ctx context.Context, arg chat1.SetConversationStatusArg) (res chat1.SetConversationStatusRes, err error)

func (*ChatRemoteMock) SetCurrentUser

func (m *ChatRemoteMock) SetCurrentUser(uid gregor1.UID)

func (*ChatRemoteMock) SetDefaultTeamChannels

func (m *ChatRemoteMock) SetDefaultTeamChannels(ctx context.Context, arg chat1.SetDefaultTeamChannelsArg) (res chat1.SetDefaultTeamChannelsRes, err error)

func (*ChatRemoteMock) SetGlobalAppNotificationSettings

func (m *ChatRemoteMock) SetGlobalAppNotificationSettings(ctx context.Context,
	arg chat1.GlobalAppNotificationSettings) error

func (*ChatRemoteMock) SetTeamRetention

func (m *ChatRemoteMock) SetTeamRetention(ctx context.Context, _ chat1.SetTeamRetentionArg) (res chat1.SetRetentionRes, err error)

func (*ChatRemoteMock) SyncAll

func (m *ChatRemoteMock) SyncAll(ctx context.Context, arg chat1.SyncAllArg) (res chat1.SyncAllResult, err error)

func (*ChatRemoteMock) SyncChat

func (*ChatRemoteMock) SyncInbox

func (m *ChatRemoteMock) SyncInbox(ctx context.Context, vers chat1.InboxVers) (chat1.SyncInboxRes, error)

func (*ChatRemoteMock) TeamIDOfConv

func (m *ChatRemoteMock) TeamIDOfConv(ctx context.Context, convID chat1.ConversationID) (res *keybase1.TeamID, err error)

func (*ChatRemoteMock) TlfFinalize

func (m *ChatRemoteMock) TlfFinalize(ctx context.Context, arg chat1.TlfFinalizeArg) error

func (*ChatRemoteMock) TlfResolve

func (m *ChatRemoteMock) TlfResolve(ctx context.Context, arg chat1.TlfResolveArg) error

func (*ChatRemoteMock) UpdateTypingRemote

func (m *ChatRemoteMock) UpdateTypingRemote(ctx context.Context, arg chat1.UpdateTypingRemoteArg) error

func (*ChatRemoteMock) UpgradeKBFSToImpteam

func (m *ChatRemoteMock) UpgradeKBFSToImpteam(ctx context.Context, arg chat1.UpgradeKBFSToImpteamArg) error

type ChatRemoteMockServerConnection

type ChatRemoteMockServerConnection struct {
	// contains filtered or unexported fields
}

func NewChatRemoteMockServerConnection

func NewChatRemoteMockServerConnection(mock *ChatRemoteMock) *ChatRemoteMockServerConnection

func (ChatRemoteMockServerConnection) GetClient

func (ChatRemoteMockServerConnection) Reconnect

type ChatTestContext

type ChatTestContext struct {
	libkb.TestContext
	ChatG *globals.ChatContext
}

func (ChatTestContext) Cleanup

func (c ChatTestContext) Cleanup()

func (ChatTestContext) Context

func (c ChatTestContext) Context() *globals.Context

type ChatUI

type ChatUI struct {
	InboxCb               chan NonblockInboxResult
	ThreadCb              chan NonblockThreadResult
	ThreadStatusCb        chan chat1.UIChatThreadStatus
	SearchHitCb           chan chat1.ChatSearchHitArg
	SearchDoneCb          chan chat1.ChatSearchDoneArg
	InboxSearchHitCb      chan chat1.ChatSearchInboxHitArg
	InboxSearchDoneCb     chan chat1.ChatSearchInboxDoneArg
	InboxSearchConvHitsCb chan []chat1.UIChatSearchConvHit
	StellarShowConfirm    chan struct{}
	StellarDataConfirm    chan chat1.UIChatPaymentSummary
	StellarDataError      chan keybase1.Status
	StellarDone           chan struct{}
	ShowManageChannels    chan string
	GiphyResults          chan chat1.GiphySearchResults
	GiphyWindow           chan bool
	CoinFlipUpdates       chan []chat1.UICoinFlipStatus
	CommandMarkdown       chan *chat1.UICommandMarkdown
	InboxLayoutCb         chan chat1.UIInboxLayout
}

func NewChatUI

func NewChatUI() *ChatUI

func (*ChatUI) ChatClearWatch

func (c *ChatUI) ChatClearWatch(context.Context, chat1.LocationWatchID) error

func (*ChatUI) ChatCoinFlipStatus

func (c *ChatUI) ChatCoinFlipStatus(ctx context.Context, updates []chat1.UICoinFlipStatus) error

func (*ChatUI) ChatCommandMarkdown

func (c *ChatUI) ChatCommandMarkdown(ctx context.Context, convID chat1.ConversationID,
	md *chat1.UICommandMarkdown) error

func (*ChatUI) ChatConfirmChannelDelete

func (c *ChatUI) ChatConfirmChannelDelete(ctx context.Context, arg chat1.ChatConfirmChannelDeleteArg) (bool, error)

func (*ChatUI) ChatGiphySearchResults

func (c *ChatUI) ChatGiphySearchResults(ctx context.Context, convID chat1.ConversationID,
	results chat1.GiphySearchResults) error

func (*ChatUI) ChatGiphyToggleResultWindow

func (c *ChatUI) ChatGiphyToggleResultWindow(ctx context.Context,
	convID chat1.ConversationID, show, clearInput bool) error

func (*ChatUI) ChatInboxConversation

func (c *ChatUI) ChatInboxConversation(ctx context.Context, arg chat1.ChatInboxConversationArg) error

func (*ChatUI) ChatInboxFailed

func (c *ChatUI) ChatInboxFailed(ctx context.Context, arg chat1.ChatInboxFailedArg) error

func (*ChatUI) ChatInboxLayout

func (c *ChatUI) ChatInboxLayout(ctx context.Context, layout string) error

func (*ChatUI) ChatInboxUnverified

func (c *ChatUI) ChatInboxUnverified(ctx context.Context, arg chat1.ChatInboxUnverifiedArg) error

func (*ChatUI) ChatLoadGalleryHit

func (c *ChatUI) ChatLoadGalleryHit(ctx context.Context, msg chat1.UIMessage) error

func (*ChatUI) ChatMaybeMentionUpdate

func (c *ChatUI) ChatMaybeMentionUpdate(ctx context.Context, teamName, channel string,
	info chat1.UIMaybeMentionInfo) error

func (*ChatUI) ChatSearchBotHits

func (c *ChatUI) ChatSearchBotHits(ctx context.Context, hits chat1.UIChatSearchBotHits) error

func (*ChatUI) ChatSearchConvHits

func (c *ChatUI) ChatSearchConvHits(ctx context.Context, hits chat1.UIChatSearchConvHits) error

func (*ChatUI) ChatSearchDone

func (c *ChatUI) ChatSearchDone(ctx context.Context, arg chat1.ChatSearchDoneArg) error

func (*ChatUI) ChatSearchHit

func (c *ChatUI) ChatSearchHit(ctx context.Context, arg chat1.ChatSearchHitArg) error

func (*ChatUI) ChatSearchInboxDone

func (c *ChatUI) ChatSearchInboxDone(ctx context.Context, arg chat1.ChatSearchInboxDoneArg) error

func (*ChatUI) ChatSearchInboxHit

func (c *ChatUI) ChatSearchInboxHit(ctx context.Context, arg chat1.ChatSearchInboxHitArg) error

func (*ChatUI) ChatSearchInboxStart

func (c *ChatUI) ChatSearchInboxStart(ctx context.Context) error

func (*ChatUI) ChatSearchIndexStatus

func (c *ChatUI) ChatSearchIndexStatus(ctx context.Context, arg chat1.ChatSearchIndexStatusArg) error

func (*ChatUI) ChatSearchTeamHits

func (c *ChatUI) ChatSearchTeamHits(ctx context.Context, hits chat1.UIChatSearchTeamHits) error

func (*ChatUI) ChatShowManageChannels

func (c *ChatUI) ChatShowManageChannels(ctx context.Context, teamname string) error

func (*ChatUI) ChatStellarDataConfirm

func (c *ChatUI) ChatStellarDataConfirm(ctx context.Context, summary chat1.UIChatPaymentSummary) (bool, error)

func (*ChatUI) ChatStellarDataError

func (c *ChatUI) ChatStellarDataError(ctx context.Context, err keybase1.Status) (bool, error)

func (*ChatUI) ChatStellarDone

func (c *ChatUI) ChatStellarDone(ctx context.Context, canceled bool) error

func (*ChatUI) ChatStellarShowConfirm

func (c *ChatUI) ChatStellarShowConfirm(ctx context.Context) error

func (*ChatUI) ChatThreadCached

func (c *ChatUI) ChatThreadCached(ctx context.Context, arg *string) error

func (*ChatUI) ChatThreadFull

func (c *ChatUI) ChatThreadFull(ctx context.Context, arg string) error

func (*ChatUI) ChatThreadStatus

func (c *ChatUI) ChatThreadStatus(ctx context.Context, status chat1.UIChatThreadStatus) error

func (*ChatUI) TriggerContactSync

func (c *ChatUI) TriggerContactSync(context.Context) error

type DummyAssetDeleter

type DummyAssetDeleter struct{}

func NewDummyAssetDeleter

func NewDummyAssetDeleter() DummyAssetDeleter

func (DummyAssetDeleter) DeleteAssets

func (d DummyAssetDeleter) DeleteAssets(ctx context.Context, uid gregor1.UID, convID chat1.ConversationID, assets []chat1.Asset)

DeleteAssets implements github.com/keybase/go/chat/storage/storage.AssetDeleter interface.

type FakeIdentifyUI

type FakeIdentifyUI struct {
	Proofs          map[string]string
	ProofResults    map[string]keybase1.LinkCheckResult
	User            *keybase1.User
	Confirmed       bool
	Keys            map[libkb.PGPFingerprint]*keybase1.TrackDiff
	DisplayKeyCalls int
	Outcome         *keybase1.IdentifyOutcome
	StartCount      int
	Token           keybase1.TrackToken
	BrokenTracking  bool
	DisplayTLFArg   keybase1.DisplayTLFCreateWithInviteArg
	DisplayTLFCount int
	StellarAccounts []keybase1.StellarAccount
	sync.Mutex
}

func (*FakeIdentifyUI) Cancel

func (ui *FakeIdentifyUI) Cancel(_ libkb.MetaContext) error

func (*FakeIdentifyUI) Confirm

func (ui *FakeIdentifyUI) Confirm(_ libkb.MetaContext, outcome *keybase1.IdentifyOutcome) (result keybase1.ConfirmResult, err error)

func (*FakeIdentifyUI) Dismiss

func (*FakeIdentifyUI) DisplayCryptocurrency

func (ui *FakeIdentifyUI) DisplayCryptocurrency(libkb.MetaContext, keybase1.Cryptocurrency) error

func (*FakeIdentifyUI) DisplayKey

func (ui *FakeIdentifyUI) DisplayKey(_ libkb.MetaContext, ik keybase1.IdentifyKey) error

func (*FakeIdentifyUI) DisplayStellarAccount

func (ui *FakeIdentifyUI) DisplayStellarAccount(_ libkb.MetaContext, acc keybase1.StellarAccount) error

func (*FakeIdentifyUI) DisplayTLFCreateWithInvite

func (ui *FakeIdentifyUI) DisplayTLFCreateWithInvite(_ libkb.MetaContext, arg keybase1.DisplayTLFCreateWithInviteArg) error

func (*FakeIdentifyUI) DisplayTrackStatement

func (ui *FakeIdentifyUI) DisplayTrackStatement(libkb.MetaContext, string) error

func (*FakeIdentifyUI) DisplayUserCard

func (ui *FakeIdentifyUI) DisplayUserCard(libkb.MetaContext, keybase1.UserCard) error

func (*FakeIdentifyUI) Finish

func (ui *FakeIdentifyUI) Finish(_ libkb.MetaContext) error

func (*FakeIdentifyUI) FinishSocialProofCheck

func (ui *FakeIdentifyUI) FinishSocialProofCheck(_ libkb.MetaContext, proof keybase1.RemoteProof, result keybase1.LinkCheckResult) error

func (*FakeIdentifyUI) FinishWebProofCheck

func (ui *FakeIdentifyUI) FinishWebProofCheck(_ libkb.MetaContext, proof keybase1.RemoteProof, result keybase1.LinkCheckResult) error

func (*FakeIdentifyUI) LaunchNetworkChecks

func (ui *FakeIdentifyUI) LaunchNetworkChecks(_ libkb.MetaContext, id *keybase1.Identity, user *keybase1.User) error

func (*FakeIdentifyUI) ReportLastTrack

func (ui *FakeIdentifyUI) ReportLastTrack(libkb.MetaContext, *keybase1.TrackSummary) error

func (*FakeIdentifyUI) ReportTrackToken

func (ui *FakeIdentifyUI) ReportTrackToken(_ libkb.MetaContext, tok keybase1.TrackToken) error

func (*FakeIdentifyUI) SetStrict

func (ui *FakeIdentifyUI) SetStrict(b bool)

func (*FakeIdentifyUI) Start

func (ui *FakeIdentifyUI) Start(_ libkb.MetaContext, username string, _ keybase1.IdentifyReason, forceDisplay bool) error

type FakeUser

type FakeUser struct {
	Username    string
	Email       string
	Passphrase  string
	User        *libkb.User
	EldestSeqno keybase1.Seqno
}

func CreateAndSignupFakeUser

func CreateAndSignupFakeUser(prefix string, g *libkb.GlobalContext) (*FakeUser, error)

func CreateAndSignupFakeUserMobile

func CreateAndSignupFakeUserMobile(prefix string, g *libkb.GlobalContext) (*FakeUser, error)

func CreateAndSignupFakeUserPaper

func CreateAndSignupFakeUserPaper(prefix string, g *libkb.GlobalContext) (*FakeUser, error)

func CreateAndSignupFakeUserRandomPW

func CreateAndSignupFakeUserRandomPW(prefix string, g *libkb.GlobalContext) (*FakeUser, error)

func NewFakeUser

func NewFakeUser(prefix string) (*FakeUser, error)

func TCreateFakeUser

func TCreateFakeUser(tc libkb.TestContext) *FakeUser

func (*FakeUser) GetUID

func (fu *FakeUser) GetUID() keybase1.UID

func (*FakeUser) GetUserVersion

func (fu *FakeUser) GetUserVersion() keybase1.UserVersion

func (*FakeUser) Login

func (fu *FakeUser) Login(g *libkb.GlobalContext) error

func (*FakeUser) NewSecretUI

func (fu *FakeUser) NewSecretUI() *libkb.TestSecretUI

func (FakeUser) NormalizedUsername

func (fu FakeUser) NormalizedUsername() libkb.NormalizedUsername

type GPGTestUI

type GPGTestUI struct {
	// contains filtered or unexported fields
}

func (*GPGTestUI) ConfirmDuplicateKeyChosen

func (g *GPGTestUI) ConfirmDuplicateKeyChosen(_ context.Context, _ int) (bool, error)

func (*GPGTestUI) ConfirmImportSecretToExistingKey

func (g *GPGTestUI) ConfirmImportSecretToExistingKey(_ context.Context, _ int) (bool, error)

func (*GPGTestUI) GetTTY

func (g *GPGTestUI) GetTTY(_ context.Context) (string, error)

func (*GPGTestUI) SelectKey

func (g *GPGTestUI) SelectKey(_ context.Context, arg keybase1.SelectKeyArg) (string, error)

func (*GPGTestUI) SelectKeyAndPushOption

func (*GPGTestUI) Sign

func (*GPGTestUI) WantToAddGPGKey

func (g *GPGTestUI) WantToAddGPGKey(_ context.Context, _ int) (bool, error)

type MockChatHelper

type MockChatHelper struct {
	SentMessages []MockMessage
	// contains filtered or unexported fields
}

func NewMockChatHelper

func NewMockChatHelper() *MockChatHelper

func (*MockChatHelper) BulkAddToConv

func (*MockChatHelper) DeleteMsg

func (m *MockChatHelper) DeleteMsg(ctx context.Context, convID chat1.ConversationID, tlfName string,
	msgID chat1.MessageID) error

func (*MockChatHelper) DeleteMsgNonblock

func (m *MockChatHelper) DeleteMsgNonblock(ctx context.Context, convID chat1.ConversationID, tlfName string,
	msgID chat1.MessageID) error

func (*MockChatHelper) FindConversations

func (m *MockChatHelper) FindConversations(ctx context.Context, name string,
	topicName *string, topicType chat1.TopicType,
	membersType chat1.ConversationMembersType, vis keybase1.TLFVisibility) ([]chat1.ConversationLocal, error)

func (*MockChatHelper) FindConversationsByID

func (m *MockChatHelper) FindConversationsByID(ctx context.Context, convIDs []chat1.ConversationID) (convs []chat1.ConversationLocal, err error)

func (*MockChatHelper) GetChannelTopicName

func (m *MockChatHelper) GetChannelTopicName(ctx context.Context, teamID keybase1.TeamID,
	topicType chat1.TopicType, convID chat1.ConversationID) (string, error)

func (*MockChatHelper) GetMessage

func (m *MockChatHelper) GetMessage(ctx context.Context, uid gregor1.UID, convID chat1.ConversationID,
	msgID chat1.MessageID, resolveSupersedes bool, reason *chat1.GetThreadReason) (chat1.MessageUnboxed, error)

func (*MockChatHelper) GetMessages

func (m *MockChatHelper) GetMessages(ctx context.Context, uid gregor1.UID, convID chat1.ConversationID,
	msgIDs []chat1.MessageID, resolveSupersedes bool, reason *chat1.GetThreadReason) ([]chat1.MessageUnboxed, error)

func (*MockChatHelper) InTeam

func (*MockChatHelper) JoinConversationByID

func (m *MockChatHelper) JoinConversationByID(ctx context.Context, uid gregor1.UID,
	convID chat1.ConversationID) error

func (*MockChatHelper) JoinConversationByName

func (m *MockChatHelper) JoinConversationByName(ctx context.Context, uid gregor1.UID, tlfName,
	topicName string, topicType chat1.TopicType, vid keybase1.TLFVisibility) error

func (*MockChatHelper) JourneycardDebugState

func (m *MockChatHelper) JourneycardDebugState(ctx context.Context, uid gregor1.UID, teamID keybase1.TeamID) (string, error)

func (*MockChatHelper) JourneycardResetAllConvs

func (m *MockChatHelper) JourneycardResetAllConvs(ctx context.Context, uid gregor1.UID) error

func (*MockChatHelper) JourneycardTimeTravel

func (m *MockChatHelper) JourneycardTimeTravel(ctx context.Context, uid gregor1.UID, duration time.Duration) (int, int, error)

func (*MockChatHelper) LeaveConversation

func (m *MockChatHelper) LeaveConversation(ctx context.Context, uid gregor1.UID, convID chat1.ConversationID) error

func (*MockChatHelper) NewConversation

func (m *MockChatHelper) NewConversation(ctx context.Context, uid gregor1.UID, tlfName string,
	topicName *string, topicType chat1.TopicType, membersType chat1.ConversationMembersType,
	vis keybase1.TLFVisibility) (chat1.ConversationLocal, bool, error)

func (*MockChatHelper) NewConversationSkipFindExisting

func (m *MockChatHelper) NewConversationSkipFindExisting(ctx context.Context, uid gregor1.UID, tlfName string,
	topicName *string, topicType chat1.TopicType, membersType chat1.ConversationMembersType,
	vis keybase1.TLFVisibility) (chat1.ConversationLocal, bool, error)

func (*MockChatHelper) NewConversationWithMemberSourceConv

func (m *MockChatHelper) NewConversationWithMemberSourceConv(ctx context.Context, uid gregor1.UID, tlfName string,
	topicName *string, topicType chat1.TopicType, membersType chat1.ConversationMembersType,
	vis keybase1.TLFVisibility, retentionPolicy *chat1.RetentionPolicy,
	memberSourceConv *chat1.ConversationID) (chat1.ConversationLocal, bool, error)

func (*MockChatHelper) SendMsgByID

func (m *MockChatHelper) SendMsgByID(ctx context.Context, convID chat1.ConversationID,
	tlfName string, body chat1.MessageBody, msgType chat1.MessageType, vis keybase1.TLFVisibility) error

func (*MockChatHelper) SendMsgByIDNonblock

func (m *MockChatHelper) SendMsgByIDNonblock(ctx context.Context, convID chat1.ConversationID,
	tlfName string, body chat1.MessageBody, msgType chat1.MessageType, inOutboxID *chat1.OutboxID,
	replyTo *chat1.MessageID) (chat1.OutboxID, error)

func (*MockChatHelper) SendMsgByName

func (m *MockChatHelper) SendMsgByName(ctx context.Context, name string, topicName *string,
	membersType chat1.ConversationMembersType, ident keybase1.TLFIdentifyBehavior, body chat1.MessageBody,
	msgType chat1.MessageType) error

func (*MockChatHelper) SendMsgByNameNonblock

func (m *MockChatHelper) SendMsgByNameNonblock(ctx context.Context, name string, topicName *string,
	membersType chat1.ConversationMembersType, ident keybase1.TLFIdentifyBehavior, body chat1.MessageBody,
	msgType chat1.MessageType, outboxID *chat1.OutboxID) (chat1.OutboxID, error)

func (*MockChatHelper) SendTextByID

func (m *MockChatHelper) SendTextByID(ctx context.Context, convID chat1.ConversationID,
	tlfName string, text string, vis keybase1.TLFVisibility) error

func (*MockChatHelper) SendTextByIDNonblock

func (m *MockChatHelper) SendTextByIDNonblock(ctx context.Context, convID chat1.ConversationID,
	tlfName string, text string, outboxID *chat1.OutboxID, replyTo *chat1.MessageID) (chat1.OutboxID, error)

func (*MockChatHelper) SendTextByName

func (m *MockChatHelper) SendTextByName(ctx context.Context, name string, topicName *string,
	membersType chat1.ConversationMembersType, ident keybase1.TLFIdentifyBehavior, text string) error

func (*MockChatHelper) SendTextByNameNonblock

func (m *MockChatHelper) SendTextByNameNonblock(ctx context.Context, name string, topicName *string,
	membersType chat1.ConversationMembersType, ident keybase1.TLFIdentifyBehavior, text string, outboxID *chat1.OutboxID) (chat1.OutboxID, error)

func (*MockChatHelper) UpgradeKBFSToImpteam

func (m *MockChatHelper) UpgradeKBFSToImpteam(ctx context.Context, tlfName string, tlfID chat1.TLFID,
	public bool) error

func (*MockChatHelper) UserReacjis

func (m *MockChatHelper) UserReacjis(ctx context.Context, uid gregor1.UID) keybase1.UserReacjis

type MockMessage

type MockMessage struct {
	Body    chat1.MessageBody
	MsgType chat1.MessageType
	// contains filtered or unexported fields
}

MockMessage only supports what we're currently testing (system message for git push).

func MockSentMessages

func MockSentMessages(g *libkb.GlobalContext, t libkb.TestingTB) []MockMessage

type MockUIRouter

type MockUIRouter struct {
	// contains filtered or unexported fields
}

func NewMockUIRouter

func NewMockUIRouter(chatUI libkb.ChatUI) *MockUIRouter

func (*MockUIRouter) DumpUIs

func (f *MockUIRouter) DumpUIs() map[libkb.UIKind]libkb.ConnectionID

func (*MockUIRouter) GetChatUI

func (f *MockUIRouter) GetChatUI() (libkb.ChatUI, error)

func (*MockUIRouter) GetHomeUI

func (f *MockUIRouter) GetHomeUI() (keybase1.HomeUIInterface, error)

func (*MockUIRouter) GetIdentify3UI

func (*MockUIRouter) GetIdentify3UIAdapter

func (f *MockUIRouter) GetIdentify3UIAdapter(libkb.MetaContext) (libkb.IdentifyUI, error)

func (*MockUIRouter) GetIdentifyUI

func (f *MockUIRouter) GetIdentifyUI() (libkb.IdentifyUI, error)

func (*MockUIRouter) GetIdentifyUICtx

func (f *MockUIRouter) GetIdentifyUICtx(ctx context.Context) (int, libkb.IdentifyUI, error)

func (*MockUIRouter) GetLogUI

func (f *MockUIRouter) GetLogUI() (libkb.LogUI, error)

func (*MockUIRouter) GetRekeyUI

func (f *MockUIRouter) GetRekeyUI() (keybase1.RekeyUIInterface, int, error)

func (*MockUIRouter) GetRekeyUINoSessionID

func (f *MockUIRouter) GetRekeyUINoSessionID() (keybase1.RekeyUIInterface, error)

func (*MockUIRouter) GetSecretUI

func (f *MockUIRouter) GetSecretUI(sessionID int) (libkb.SecretUI, error)

func (*MockUIRouter) SetUI

func (*MockUIRouter) Shutdown

func (f *MockUIRouter) Shutdown()

func (*MockUIRouter) WaitForUIType

func (f *MockUIRouter) WaitForUIType(uiKind libkb.UIKind, timeout time.Duration) bool

type NonblockInboxResult

type NonblockInboxResult struct {
	ConvID   chat1.ConversationID
	Err      error
	ConvRes  *chat1.InboxUIItem
	InboxRes *chat1.UnverifiedInboxUIItems
}

type NonblockSearchResult

type NonblockSearchResult struct {
	chat1.ChatSearchHitArg
}

type NonblockThreadResult

type NonblockThreadResult struct {
	Thread *chat1.UIMessages
	Full   bool
}

type TeamNotifyListener

type TeamNotifyListener struct {
	libkb.NoopNotifyListener
	// contains filtered or unexported fields
}

func NewTeamNotifyListener

func NewTeamNotifyListener() *TeamNotifyListener

func (*TeamNotifyListener) TeamChangedByID

func (n *TeamNotifyListener) TeamChangedByID(teamID keybase1.TeamID, latestSeqno keybase1.Seqno, implicitTeam bool, changes keybase1.TeamChangeSet, latestHiddenSeqno keybase1.Seqno, source keybase1.TeamChangedSource)

func (*TeamNotifyListener) TeamChangedByName

func (n *TeamNotifyListener) TeamChangedByName(teamName string, latestSeqno keybase1.Seqno, implicitTeam bool, changes keybase1.TeamChangeSet, latestHiddenSeqno keybase1.Seqno, source keybase1.TeamChangedSource)

type TestProvisionUI

type TestProvisionUI struct {
	SecretCh   chan kex2.Secret
	DeviceType keybase1.DeviceTypeV2
}

func (*TestProvisionUI) ChooseDevice

func (*TestProvisionUI) ChooseDeviceType

func (*TestProvisionUI) ChooseGPGMethod

func (*TestProvisionUI) ChooseProvisioningMethod

func (*TestProvisionUI) DisplayAndPromptSecret

func (*TestProvisionUI) DisplaySecretExchanged

func (u *TestProvisionUI) DisplaySecretExchanged(_ context.Context, _ int) error

func (*TestProvisionUI) PromptNewDeviceName

func (u *TestProvisionUI) PromptNewDeviceName(_ context.Context, arg keybase1.PromptNewDeviceNameArg) (string, error)

func (*TestProvisionUI) ProvisioneeSuccess

func (u *TestProvisionUI) ProvisioneeSuccess(_ context.Context, _ keybase1.ProvisioneeSuccessArg) error

func (*TestProvisionUI) ProvisionerSuccess

func (u *TestProvisionUI) ProvisionerSuccess(_ context.Context, _ keybase1.ProvisionerSuccessArg) error

func (*TestProvisionUI) SwitchToGPGSignOK

func (u *TestProvisionUI) SwitchToGPGSignOK(ctx context.Context, arg keybase1.SwitchToGPGSignOKArg) (bool, error)

type TlfMock

type TlfMock struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewTlfMock

func NewTlfMock(world *ChatMockWorld) *TlfMock

func (*TlfMock) AllCryptKeys

func (m *TlfMock) AllCryptKeys(ctx context.Context, tlfName string, public bool) (res types.AllCryptKeys, err error)

func (*TlfMock) CompleteAndCanonicalizePrivateTlfName

func (m *TlfMock) CompleteAndCanonicalizePrivateTlfName(ctx context.Context, tlfName string) (keybase1.CanonicalTLFNameAndIDWithBreaks, error)

func (*TlfMock) CryptKeys

func (m *TlfMock) CryptKeys(ctx context.Context, tlfName string) (res keybase1.GetTLFCryptKeysRes, err error)

func (*TlfMock) DecryptionKey

func (m *TlfMock) DecryptionKey(ctx context.Context, tlfName string, tlfID chat1.TLFID,
	membersType chat1.ConversationMembersType, public bool,
	keyGeneration int, kbfsEncrypted bool, botUID *gregor1.UID) (types.CryptKey, error)

func (*TlfMock) EncryptionKey

func (m *TlfMock) EncryptionKey(ctx context.Context, tlfName string, tlfID chat1.TLFID,
	membersType chat1.ConversationMembersType, public bool,
	botUID *gregor1.UID) (key types.CryptKey, ni types.NameInfo, err error)

func (*TlfMock) EphemeralDecryptionKey

func (m *TlfMock) EphemeralDecryptionKey(mctx libkb.MetaContext, tlfName string, tlfID chat1.TLFID,
	membersType chat1.ConversationMembersType, public bool, botUID *gregor1.UID,
	generation keybase1.EkGeneration, contentCtime *gregor1.Time) (types.EphemeralCryptKey, error)

func (*TlfMock) EphemeralEncryptionKey

func (m *TlfMock) EphemeralEncryptionKey(mctx libkb.MetaContext, tlfName string, tlfID chat1.TLFID,
	membersType chat1.ConversationMembersType, public bool, botUID *gregor1.UID) (types.EphemeralCryptKey, error)

func (*TlfMock) LookupID

func (m *TlfMock) LookupID(ctx context.Context, tlfName string, public bool) (res types.NameInfo, err error)

func (*TlfMock) LookupName

func (m *TlfMock) LookupName(ctx context.Context, tlfID chat1.TLFID, public bool, tlfName string) (res types.NameInfo, err error)

func (*TlfMock) PublicCanonicalTLFNameAndID

func (m *TlfMock) PublicCanonicalTLFNameAndID(ctx context.Context, tlfName string) (keybase1.CanonicalTLFNameAndIDWithBreaks, error)

func (*TlfMock) ShouldPairwiseMAC

func (m *TlfMock) ShouldPairwiseMAC(ctx context.Context, tlfName string, tlfID chat1.TLFID,
	membersType chat1.ConversationMembersType, public bool) (bool, []keybase1.KID, error)

func (*TlfMock) TeamBotSettings

func (m *TlfMock) TeamBotSettings(ctx context.Context, tlfName string, tlfID chat1.TLFID,
	membersType chat1.ConversationMembersType, public bool) (map[keybase1.UserVersion]keybase1.TeamBotSettings, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL