detached ac967b8

test: add coordinator unit tests and expand mockery coverage

- Add 13 new port interfaces to .mockery.yaml (Engine, ContentInjector,
  SchemeHandler, MessageRouter, SettingsApplier, FilterApplier,
  FaviconDatabase, IdleInhibitor, PopupCapable, OAuthCallbackCapable,
  DevToolsOpener, Printer)
- lifecycle_test.go: EnsureWebView (reuse, acquire, errors),
  ReleaseWebView (pool release, idle uninhibit, destroy fallback),
  GetWebView, RegisterPopupWebView
- popup_test.go: DetectPopupType, PopupType.String, GetBehavior with
  various configs, OAuth state tracking, SetPopupConfig, concurrency
- title_test.go: GetTitle, SetNavigationOrigin, appearance queue
  management (theme/script queueing), concurrent access safety

58 new tests for the content coordinator package.
commit
ac967b884015a47c5292fadcacac1d6d9d7ea6c8
author
brice · · 2026-03-15 18:34 UTC
parent
9dd9450
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
5 files · +4439 -1722
M .mockery.yaml +12 -0
@@ -33,6 +33,18 @@ packages:
3333 DownloadResponse: {}
3434 PermissionDialogPresenter: {}
3535 PermissionRepository: {}
36+ Engine: {}
37+ ContentInjector: {}
38+ SchemeHandler: {}
39+ MessageRouter: {}
40+ SettingsApplier: {}
41+ FilterApplier: {}
42+ FaviconDatabase: {}
43+ IdleInhibitor: {}
44+ PopupCapable: {}
45+ OAuthCallbackCapable: {}
46+ DevToolsOpener: {}
47+ Printer: {}
3648 github.com/bnema/dumber/internal/domain/repository:
3749 config:
3850 dir: '{{.InterfaceDir}}/mocks'
M internal/application/port/mocks/mocks.go +3391 -1722
@@ -1104,6 +1104,90 @@ func (_c *MockConfigTransformer_TransformLegacyActions_Call) RunAndReturn(run fu
11041104 return _c
11051105 }
11061106
1107+// NewMockContentInjector creates a new instance of MockContentInjector. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
1108+// The first argument is typically a *testing.T value.
1109+func NewMockContentInjector(t interface {
1110+ mock.TestingT
1111+ Cleanup(func())
1112+}) *MockContentInjector {
1113+ mock := &MockContentInjector{}
1114+ mock.Mock.Test(t)
1115+
1116+ t.Cleanup(func() { mock.AssertExpectations(t) })
1117+
1118+ return mock
1119+}
1120+
1121+// MockContentInjector is an autogenerated mock type for the ContentInjector type
1122+type MockContentInjector struct {
1123+ mock.Mock
1124+}
1125+
1126+type MockContentInjector_Expecter struct {
1127+ mock *mock.Mock
1128+}
1129+
1130+func (_m *MockContentInjector) EXPECT() *MockContentInjector_Expecter {
1131+ return &MockContentInjector_Expecter{mock: &_m.Mock}
1132+}
1133+
1134+// InjectThemeCSS provides a mock function for the type MockContentInjector
1135+func (_mock *MockContentInjector) InjectThemeCSS(ctx context.Context, css string) error {
1136+ ret := _mock.Called(ctx, css)
1137+
1138+ if len(ret) == 0 {
1139+ panic("no return value specified for InjectThemeCSS")
1140+ }
1141+
1142+ var r0 error
1143+ if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok {
1144+ r0 = returnFunc(ctx, css)
1145+ } else {
1146+ r0 = ret.Error(0)
1147+ }
1148+ return r0
1149+}
1150+
1151+// MockContentInjector_InjectThemeCSS_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InjectThemeCSS'
1152+type MockContentInjector_InjectThemeCSS_Call struct {
1153+ *mock.Call
1154+}
1155+
1156+// InjectThemeCSS is a helper method to define mock.On call
1157+// - ctx context.Context
1158+// - css string
1159+func (_e *MockContentInjector_Expecter) InjectThemeCSS(ctx interface{}, css interface{}) *MockContentInjector_InjectThemeCSS_Call {
1160+ return &MockContentInjector_InjectThemeCSS_Call{Call: _e.mock.On("InjectThemeCSS", ctx, css)}
1161+}
1162+
1163+func (_c *MockContentInjector_InjectThemeCSS_Call) Run(run func(ctx context.Context, css string)) *MockContentInjector_InjectThemeCSS_Call {
1164+ _c.Call.Run(func(args mock.Arguments) {
1165+ var arg0 context.Context
1166+ if args[0] != nil {
1167+ arg0 = args[0].(context.Context)
1168+ }
1169+ var arg1 string
1170+ if args[1] != nil {
1171+ arg1 = args[1].(string)
1172+ }
1173+ run(
1174+ arg0,
1175+ arg1,
1176+ )
1177+ })
1178+ return _c
1179+}
1180+
1181+func (_c *MockContentInjector_InjectThemeCSS_Call) Return(err error) *MockContentInjector_InjectThemeCSS_Call {
1182+ _c.Call.Return(err)
1183+ return _c
1184+}
1185+
1186+func (_c *MockContentInjector_InjectThemeCSS_Call) RunAndReturn(run func(ctx context.Context, css string) error) *MockContentInjector_InjectThemeCSS_Call {
1187+ _c.Call.Return(run)
1188+ return _c
1189+}
1190+
11071191 // NewMockDatabaseProvider creates a new instance of MockDatabaseProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
11081192 // The first argument is typically a *testing.T value.
11091193 func NewMockDatabaseProvider(t interface {
@@ -1440,13 +1524,13 @@ func (_c *MockDownloadResponse_GetUri_Call) RunAndReturn(run func() string) *Moc
14401524 return _c
14411525 }
14421526
1443-// NewMockFontDetector creates a new instance of MockFontDetector. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
1527+// NewMockEngine creates a new instance of MockEngine. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
14441528 // The first argument is typically a *testing.T value.
1445-func NewMockFontDetector(t interface {
1529+func NewMockEngine(t interface {
14461530 mock.TestingT
14471531 Cleanup(func())
1448-}) *MockFontDetector {
1449- mock := &MockFontDetector{}
1532+}) *MockEngine {
1533+ mock := &MockEngine{}
14501534 mock.Mock.Test(t)
14511535
14521536 t.Cleanup(func() { mock.AssertExpectations(t) })
@@ -1454,699 +1538,539 @@ func NewMockFontDetector(t interface {
14541538 return mock
14551539 }
14561540
1457-// MockFontDetector is an autogenerated mock type for the FontDetector type
1458-type MockFontDetector struct {
1541+// MockEngine is an autogenerated mock type for the Engine type
1542+type MockEngine struct {
14591543 mock.Mock
14601544 }
14611545
1462-type MockFontDetector_Expecter struct {
1546+type MockEngine_Expecter struct {
14631547 mock *mock.Mock
14641548 }
14651549
1466-func (_m *MockFontDetector) EXPECT() *MockFontDetector_Expecter {
1467- return &MockFontDetector_Expecter{mock: &_m.Mock}
1550+func (_m *MockEngine) EXPECT() *MockEngine_Expecter {
1551+ return &MockEngine_Expecter{mock: &_m.Mock}
14681552 }
14691553
1470-// GetAvailableFonts provides a mock function for the type MockFontDetector
1471-func (_mock *MockFontDetector) GetAvailableFonts(ctx context.Context) ([]string, error) {
1472- ret := _mock.Called(ctx)
1554+// Close provides a mock function for the type MockEngine
1555+func (_mock *MockEngine) Close() error {
1556+ ret := _mock.Called()
14731557
14741558 if len(ret) == 0 {
1475- panic("no return value specified for GetAvailableFonts")
1559+ panic("no return value specified for Close")
14761560 }
14771561
1478- var r0 []string
1479- var r1 error
1480- if returnFunc, ok := ret.Get(0).(func(context.Context) ([]string, error)); ok {
1481- return returnFunc(ctx)
1482- }
1483- if returnFunc, ok := ret.Get(0).(func(context.Context) []string); ok {
1484- r0 = returnFunc(ctx)
1485- } else {
1486- if ret.Get(0) != nil {
1487- r0 = ret.Get(0).([]string)
1488- }
1489- }
1490- if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
1491- r1 = returnFunc(ctx)
1562+ var r0 error
1563+ if returnFunc, ok := ret.Get(0).(func() error); ok {
1564+ r0 = returnFunc()
14921565 } else {
1493- r1 = ret.Error(1)
1566+ r0 = ret.Error(0)
14941567 }
1495- return r0, r1
1568+ return r0
14961569 }
14971570
1498-// MockFontDetector_GetAvailableFonts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAvailableFonts'
1499-type MockFontDetector_GetAvailableFonts_Call struct {
1571+// MockEngine_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
1572+type MockEngine_Close_Call struct {
15001573 *mock.Call
15011574 }
15021575
1503-// GetAvailableFonts is a helper method to define mock.On call
1504-// - ctx context.Context
1505-func (_e *MockFontDetector_Expecter) GetAvailableFonts(ctx interface{}) *MockFontDetector_GetAvailableFonts_Call {
1506- return &MockFontDetector_GetAvailableFonts_Call{Call: _e.mock.On("GetAvailableFonts", ctx)}
1576+// Close is a helper method to define mock.On call
1577+func (_e *MockEngine_Expecter) Close() *MockEngine_Close_Call {
1578+ return &MockEngine_Close_Call{Call: _e.mock.On("Close")}
15071579 }
15081580
1509-func (_c *MockFontDetector_GetAvailableFonts_Call) Run(run func(ctx context.Context)) *MockFontDetector_GetAvailableFonts_Call {
1581+func (_c *MockEngine_Close_Call) Run(run func()) *MockEngine_Close_Call {
15101582 _c.Call.Run(func(args mock.Arguments) {
1511- var arg0 context.Context
1512- if args[0] != nil {
1513- arg0 = args[0].(context.Context)
1514- }
1515- run(
1516- arg0,
1517- )
1583+ run()
15181584 })
15191585 return _c
15201586 }
15211587
1522-func (_c *MockFontDetector_GetAvailableFonts_Call) Return(strings []string, err error) *MockFontDetector_GetAvailableFonts_Call {
1523- _c.Call.Return(strings, err)
1588+func (_c *MockEngine_Close_Call) Return(err error) *MockEngine_Close_Call {
1589+ _c.Call.Return(err)
15241590 return _c
15251591 }
15261592
1527-func (_c *MockFontDetector_GetAvailableFonts_Call) RunAndReturn(run func(ctx context.Context) ([]string, error)) *MockFontDetector_GetAvailableFonts_Call {
1593+func (_c *MockEngine_Close_Call) RunAndReturn(run func() error) *MockEngine_Close_Call {
15281594 _c.Call.Return(run)
15291595 return _c
15301596 }
15311597
1532-// IsAvailable provides a mock function for the type MockFontDetector
1533-func (_mock *MockFontDetector) IsAvailable(ctx context.Context) bool {
1534- ret := _mock.Called(ctx)
1598+// ContentInjector provides a mock function for the type MockEngine
1599+func (_mock *MockEngine) ContentInjector() port.ContentInjector {
1600+ ret := _mock.Called()
15351601
15361602 if len(ret) == 0 {
1537- panic("no return value specified for IsAvailable")
1603+ panic("no return value specified for ContentInjector")
15381604 }
15391605
1540- var r0 bool
1541- if returnFunc, ok := ret.Get(0).(func(context.Context) bool); ok {
1542- r0 = returnFunc(ctx)
1606+ var r0 port.ContentInjector
1607+ if returnFunc, ok := ret.Get(0).(func() port.ContentInjector); ok {
1608+ r0 = returnFunc()
15431609 } else {
1544- r0 = ret.Get(0).(bool)
1610+ if ret.Get(0) != nil {
1611+ r0 = ret.Get(0).(port.ContentInjector)
1612+ }
15451613 }
15461614 return r0
15471615 }
15481616
1549-// MockFontDetector_IsAvailable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsAvailable'
1550-type MockFontDetector_IsAvailable_Call struct {
1617+// MockEngine_ContentInjector_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContentInjector'
1618+type MockEngine_ContentInjector_Call struct {
15511619 *mock.Call
15521620 }
15531621
1554-// IsAvailable is a helper method to define mock.On call
1555-// - ctx context.Context
1556-func (_e *MockFontDetector_Expecter) IsAvailable(ctx interface{}) *MockFontDetector_IsAvailable_Call {
1557- return &MockFontDetector_IsAvailable_Call{Call: _e.mock.On("IsAvailable", ctx)}
1622+// ContentInjector is a helper method to define mock.On call
1623+func (_e *MockEngine_Expecter) ContentInjector() *MockEngine_ContentInjector_Call {
1624+ return &MockEngine_ContentInjector_Call{Call: _e.mock.On("ContentInjector")}
15581625 }
15591626
1560-func (_c *MockFontDetector_IsAvailable_Call) Run(run func(ctx context.Context)) *MockFontDetector_IsAvailable_Call {
1627+func (_c *MockEngine_ContentInjector_Call) Run(run func()) *MockEngine_ContentInjector_Call {
15611628 _c.Call.Run(func(args mock.Arguments) {
1562- var arg0 context.Context
1563- if args[0] != nil {
1564- arg0 = args[0].(context.Context)
1565- }
1566- run(
1567- arg0,
1568- )
1629+ run()
15691630 })
15701631 return _c
15711632 }
15721633
1573-func (_c *MockFontDetector_IsAvailable_Call) Return(b bool) *MockFontDetector_IsAvailable_Call {
1574- _c.Call.Return(b)
1634+func (_c *MockEngine_ContentInjector_Call) Return(contentInjector port.ContentInjector) *MockEngine_ContentInjector_Call {
1635+ _c.Call.Return(contentInjector)
15751636 return _c
15761637 }
15771638
1578-func (_c *MockFontDetector_IsAvailable_Call) RunAndReturn(run func(ctx context.Context) bool) *MockFontDetector_IsAvailable_Call {
1639+func (_c *MockEngine_ContentInjector_Call) RunAndReturn(run func() port.ContentInjector) *MockEngine_ContentInjector_Call {
15791640 _c.Call.Return(run)
15801641 return _c
15811642 }
15821643
1583-// SelectBestFont provides a mock function for the type MockFontDetector
1584-func (_mock *MockFontDetector) SelectBestFont(ctx context.Context, category port.FontCategory, fallbackChain []string) string {
1585- ret := _mock.Called(ctx, category, fallbackChain)
1644+// Factory provides a mock function for the type MockEngine
1645+func (_mock *MockEngine) Factory() port.WebViewFactory {
1646+ ret := _mock.Called()
15861647
15871648 if len(ret) == 0 {
1588- panic("no return value specified for SelectBestFont")
1649+ panic("no return value specified for Factory")
15891650 }
15901651
1591- var r0 string
1592- if returnFunc, ok := ret.Get(0).(func(context.Context, port.FontCategory, []string) string); ok {
1593- r0 = returnFunc(ctx, category, fallbackChain)
1652+ var r0 port.WebViewFactory
1653+ if returnFunc, ok := ret.Get(0).(func() port.WebViewFactory); ok {
1654+ r0 = returnFunc()
15941655 } else {
1595- r0 = ret.Get(0).(string)
1656+ if ret.Get(0) != nil {
1657+ r0 = ret.Get(0).(port.WebViewFactory)
1658+ }
15961659 }
15971660 return r0
15981661 }
15991662
1600-// MockFontDetector_SelectBestFont_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SelectBestFont'
1601-type MockFontDetector_SelectBestFont_Call struct {
1663+// MockEngine_Factory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Factory'
1664+type MockEngine_Factory_Call struct {
16021665 *mock.Call
16031666 }
16041667
1605-// SelectBestFont is a helper method to define mock.On call
1606-// - ctx context.Context
1607-// - category port.FontCategory
1608-// - fallbackChain []string
1609-func (_e *MockFontDetector_Expecter) SelectBestFont(ctx interface{}, category interface{}, fallbackChain interface{}) *MockFontDetector_SelectBestFont_Call {
1610- return &MockFontDetector_SelectBestFont_Call{Call: _e.mock.On("SelectBestFont", ctx, category, fallbackChain)}
1668+// Factory is a helper method to define mock.On call
1669+func (_e *MockEngine_Expecter) Factory() *MockEngine_Factory_Call {
1670+ return &MockEngine_Factory_Call{Call: _e.mock.On("Factory")}
16111671 }
16121672
1613-func (_c *MockFontDetector_SelectBestFont_Call) Run(run func(ctx context.Context, category port.FontCategory, fallbackChain []string)) *MockFontDetector_SelectBestFont_Call {
1673+func (_c *MockEngine_Factory_Call) Run(run func()) *MockEngine_Factory_Call {
16141674 _c.Call.Run(func(args mock.Arguments) {
1615- var arg0 context.Context
1616- if args[0] != nil {
1617- arg0 = args[0].(context.Context)
1618- }
1619- var arg1 port.FontCategory
1620- if args[1] != nil {
1621- arg1 = args[1].(port.FontCategory)
1622- }
1623- var arg2 []string
1624- if args[2] != nil {
1625- arg2 = args[2].([]string)
1626- }
1627- run(
1628- arg0,
1629- arg1,
1630- arg2,
1631- )
1675+ run()
16321676 })
16331677 return _c
16341678 }
16351679
1636-func (_c *MockFontDetector_SelectBestFont_Call) Return(s string) *MockFontDetector_SelectBestFont_Call {
1637- _c.Call.Return(s)
1680+func (_c *MockEngine_Factory_Call) Return(webViewFactory port.WebViewFactory) *MockEngine_Factory_Call {
1681+ _c.Call.Return(webViewFactory)
16381682 return _c
16391683 }
16401684
1641-func (_c *MockFontDetector_SelectBestFont_Call) RunAndReturn(run func(ctx context.Context, category port.FontCategory, fallbackChain []string) string) *MockFontDetector_SelectBestFont_Call {
1685+func (_c *MockEngine_Factory_Call) RunAndReturn(run func() port.WebViewFactory) *MockEngine_Factory_Call {
16421686 _c.Call.Return(run)
16431687 return _c
16441688 }
16451689
1646-// NewMockHardwareSurveyor creates a new instance of MockHardwareSurveyor. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
1647-// The first argument is typically a *testing.T value.
1648-func NewMockHardwareSurveyor(t interface {
1649- mock.TestingT
1650- Cleanup(func())
1651-}) *MockHardwareSurveyor {
1652- mock := &MockHardwareSurveyor{}
1653- mock.Mock.Test(t)
1690+// FaviconDatabase provides a mock function for the type MockEngine
1691+func (_mock *MockEngine) FaviconDatabase() port.FaviconDatabase {
1692+ ret := _mock.Called()
16541693
1655- t.Cleanup(func() { mock.AssertExpectations(t) })
1694+ if len(ret) == 0 {
1695+ panic("no return value specified for FaviconDatabase")
1696+ }
16561697
1657- return mock
1698+ var r0 port.FaviconDatabase
1699+ if returnFunc, ok := ret.Get(0).(func() port.FaviconDatabase); ok {
1700+ r0 = returnFunc()
1701+ } else {
1702+ if ret.Get(0) != nil {
1703+ r0 = ret.Get(0).(port.FaviconDatabase)
1704+ }
1705+ }
1706+ return r0
16581707 }
16591708
1660-// MockHardwareSurveyor is an autogenerated mock type for the HardwareSurveyor type
1661-type MockHardwareSurveyor struct {
1662- mock.Mock
1709+// MockEngine_FaviconDatabase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FaviconDatabase'
1710+type MockEngine_FaviconDatabase_Call struct {
1711+ *mock.Call
16631712 }
16641713
1665-type MockHardwareSurveyor_Expecter struct {
1666- mock *mock.Mock
1714+// FaviconDatabase is a helper method to define mock.On call
1715+func (_e *MockEngine_Expecter) FaviconDatabase() *MockEngine_FaviconDatabase_Call {
1716+ return &MockEngine_FaviconDatabase_Call{Call: _e.mock.On("FaviconDatabase")}
16671717 }
16681718
1669-func (_m *MockHardwareSurveyor) EXPECT() *MockHardwareSurveyor_Expecter {
1670- return &MockHardwareSurveyor_Expecter{mock: &_m.Mock}
1719+func (_c *MockEngine_FaviconDatabase_Call) Run(run func()) *MockEngine_FaviconDatabase_Call {
1720+ _c.Call.Run(func(args mock.Arguments) {
1721+ run()
1722+ })
1723+ return _c
16711724 }
16721725
1673-// Survey provides a mock function for the type MockHardwareSurveyor
1674-func (_mock *MockHardwareSurveyor) Survey(ctx context.Context) port.HardwareInfo {
1675- ret := _mock.Called(ctx)
1726+func (_c *MockEngine_FaviconDatabase_Call) Return(faviconDatabase port.FaviconDatabase) *MockEngine_FaviconDatabase_Call {
1727+ _c.Call.Return(faviconDatabase)
1728+ return _c
1729+}
1730+
1731+func (_c *MockEngine_FaviconDatabase_Call) RunAndReturn(run func() port.FaviconDatabase) *MockEngine_FaviconDatabase_Call {
1732+ _c.Call.Return(run)
1733+ return _c
1734+}
1735+
1736+// FilterApplier provides a mock function for the type MockEngine
1737+func (_mock *MockEngine) FilterApplier() port.FilterApplier {
1738+ ret := _mock.Called()
16761739
16771740 if len(ret) == 0 {
1678- panic("no return value specified for Survey")
1741+ panic("no return value specified for FilterApplier")
16791742 }
16801743
1681- var r0 port.HardwareInfo
1682- if returnFunc, ok := ret.Get(0).(func(context.Context) port.HardwareInfo); ok {
1683- r0 = returnFunc(ctx)
1744+ var r0 port.FilterApplier
1745+ if returnFunc, ok := ret.Get(0).(func() port.FilterApplier); ok {
1746+ r0 = returnFunc()
16841747 } else {
1685- r0 = ret.Get(0).(port.HardwareInfo)
1748+ if ret.Get(0) != nil {
1749+ r0 = ret.Get(0).(port.FilterApplier)
1750+ }
16861751 }
16871752 return r0
16881753 }
16891754
1690-// MockHardwareSurveyor_Survey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Survey'
1691-type MockHardwareSurveyor_Survey_Call struct {
1755+// MockEngine_FilterApplier_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterApplier'
1756+type MockEngine_FilterApplier_Call struct {
16921757 *mock.Call
16931758 }
16941759
1695-// Survey is a helper method to define mock.On call
1696-// - ctx context.Context
1697-func (_e *MockHardwareSurveyor_Expecter) Survey(ctx interface{}) *MockHardwareSurveyor_Survey_Call {
1698- return &MockHardwareSurveyor_Survey_Call{Call: _e.mock.On("Survey", ctx)}
1760+// FilterApplier is a helper method to define mock.On call
1761+func (_e *MockEngine_Expecter) FilterApplier() *MockEngine_FilterApplier_Call {
1762+ return &MockEngine_FilterApplier_Call{Call: _e.mock.On("FilterApplier")}
16991763 }
17001764
1701-func (_c *MockHardwareSurveyor_Survey_Call) Run(run func(ctx context.Context)) *MockHardwareSurveyor_Survey_Call {
1765+func (_c *MockEngine_FilterApplier_Call) Run(run func()) *MockEngine_FilterApplier_Call {
17021766 _c.Call.Run(func(args mock.Arguments) {
1703- var arg0 context.Context
1704- if args[0] != nil {
1705- arg0 = args[0].(context.Context)
1706- }
1707- run(
1708- arg0,
1709- )
1767+ run()
17101768 })
17111769 return _c
17121770 }
17131771
1714-func (_c *MockHardwareSurveyor_Survey_Call) Return(hardwareInfo port.HardwareInfo) *MockHardwareSurveyor_Survey_Call {
1715- _c.Call.Return(hardwareInfo)
1772+func (_c *MockEngine_FilterApplier_Call) Return(filterApplier port.FilterApplier) *MockEngine_FilterApplier_Call {
1773+ _c.Call.Return(filterApplier)
17161774 return _c
17171775 }
17181776
1719-func (_c *MockHardwareSurveyor_Survey_Call) RunAndReturn(run func(ctx context.Context) port.HardwareInfo) *MockHardwareSurveyor_Survey_Call {
1777+func (_c *MockEngine_FilterApplier_Call) RunAndReturn(run func() port.FilterApplier) *MockEngine_FilterApplier_Call {
17201778 _c.Call.Return(run)
17211779 return _c
17221780 }
17231781
1724-// NewMockKeybindingsProvider creates a new instance of MockKeybindingsProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
1725-// The first argument is typically a *testing.T value.
1726-func NewMockKeybindingsProvider(t interface {
1727- mock.TestingT
1728- Cleanup(func())
1729-}) *MockKeybindingsProvider {
1730- mock := &MockKeybindingsProvider{}
1731- mock.Mock.Test(t)
1732-
1733- t.Cleanup(func() { mock.AssertExpectations(t) })
1734-
1735- return mock
1736-}
1737-
1738-// MockKeybindingsProvider is an autogenerated mock type for the KeybindingsProvider type
1739-type MockKeybindingsProvider struct {
1740- mock.Mock
1741-}
1742-
1743-type MockKeybindingsProvider_Expecter struct {
1744- mock *mock.Mock
1745-}
1746-
1747-func (_m *MockKeybindingsProvider) EXPECT() *MockKeybindingsProvider_Expecter {
1748- return &MockKeybindingsProvider_Expecter{mock: &_m.Mock}
1749-}
1750-
1751-// CheckConflicts provides a mock function for the type MockKeybindingsProvider
1752-func (_mock *MockKeybindingsProvider) CheckConflicts(ctx context.Context, mode string, action string, keys []string) ([]port.KeybindingConflict, error) {
1753- ret := _mock.Called(ctx, mode, action, keys)
1782+// Init provides a mock function for the type MockEngine
1783+func (_mock *MockEngine) Init(ctx context.Context, opts port.EngineOptions) error {
1784+ ret := _mock.Called(ctx, opts)
17541785
17551786 if len(ret) == 0 {
1756- panic("no return value specified for CheckConflicts")
1787+ panic("no return value specified for Init")
17571788 }
17581789
1759- var r0 []port.KeybindingConflict
1760- var r1 error
1761- if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, []string) ([]port.KeybindingConflict, error)); ok {
1762- return returnFunc(ctx, mode, action, keys)
1763- }
1764- if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, []string) []port.KeybindingConflict); ok {
1765- r0 = returnFunc(ctx, mode, action, keys)
1766- } else {
1767- if ret.Get(0) != nil {
1768- r0 = ret.Get(0).([]port.KeybindingConflict)
1769- }
1770- }
1771- if returnFunc, ok := ret.Get(1).(func(context.Context, string, string, []string) error); ok {
1772- r1 = returnFunc(ctx, mode, action, keys)
1790+ var r0 error
1791+ if returnFunc, ok := ret.Get(0).(func(context.Context, port.EngineOptions) error); ok {
1792+ r0 = returnFunc(ctx, opts)
17731793 } else {
1774- r1 = ret.Error(1)
1794+ r0 = ret.Error(0)
17751795 }
1776- return r0, r1
1796+ return r0
17771797 }
17781798
1779-// MockKeybindingsProvider_CheckConflicts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckConflicts'
1780-type MockKeybindingsProvider_CheckConflicts_Call struct {
1799+// MockEngine_Init_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Init'
1800+type MockEngine_Init_Call struct {
17811801 *mock.Call
17821802 }
17831803
1784-// CheckConflicts is a helper method to define mock.On call
1804+// Init is a helper method to define mock.On call
17851805 // - ctx context.Context
1786-// - mode string
1787-// - action string
1788-// - keys []string
1789-func (_e *MockKeybindingsProvider_Expecter) CheckConflicts(ctx interface{}, mode interface{}, action interface{}, keys interface{}) *MockKeybindingsProvider_CheckConflicts_Call {
1790- return &MockKeybindingsProvider_CheckConflicts_Call{Call: _e.mock.On("CheckConflicts", ctx, mode, action, keys)}
1806+// - opts port.EngineOptions
1807+func (_e *MockEngine_Expecter) Init(ctx interface{}, opts interface{}) *MockEngine_Init_Call {
1808+ return &MockEngine_Init_Call{Call: _e.mock.On("Init", ctx, opts)}
17911809 }
17921810
1793-func (_c *MockKeybindingsProvider_CheckConflicts_Call) Run(run func(ctx context.Context, mode string, action string, keys []string)) *MockKeybindingsProvider_CheckConflicts_Call {
1811+func (_c *MockEngine_Init_Call) Run(run func(ctx context.Context, opts port.EngineOptions)) *MockEngine_Init_Call {
17941812 _c.Call.Run(func(args mock.Arguments) {
17951813 var arg0 context.Context
17961814 if args[0] != nil {
17971815 arg0 = args[0].(context.Context)
17981816 }
1799- var arg1 string
1817+ var arg1 port.EngineOptions
18001818 if args[1] != nil {
1801- arg1 = args[1].(string)
1802- }
1803- var arg2 string
1804- if args[2] != nil {
1805- arg2 = args[2].(string)
1806- }
1807- var arg3 []string
1808- if args[3] != nil {
1809- arg3 = args[3].([]string)
1819+ arg1 = args[1].(port.EngineOptions)
18101820 }
18111821 run(
18121822 arg0,
18131823 arg1,
1814- arg2,
1815- arg3,
18161824 )
18171825 })
18181826 return _c
18191827 }
18201828
1821-func (_c *MockKeybindingsProvider_CheckConflicts_Call) Return(keybindingConflicts []port.KeybindingConflict, err error) *MockKeybindingsProvider_CheckConflicts_Call {
1822- _c.Call.Return(keybindingConflicts, err)
1829+func (_c *MockEngine_Init_Call) Return(err error) *MockEngine_Init_Call {
1830+ _c.Call.Return(err)
18231831 return _c
18241832 }
18251833
1826-func (_c *MockKeybindingsProvider_CheckConflicts_Call) RunAndReturn(run func(ctx context.Context, mode string, action string, keys []string) ([]port.KeybindingConflict, error)) *MockKeybindingsProvider_CheckConflicts_Call {
1834+func (_c *MockEngine_Init_Call) RunAndReturn(run func(ctx context.Context, opts port.EngineOptions) error) *MockEngine_Init_Call {
18271835 _c.Call.Return(run)
18281836 return _c
18291837 }
18301838
1831-// GetDefaultKeybindings provides a mock function for the type MockKeybindingsProvider
1832-func (_mock *MockKeybindingsProvider) GetDefaultKeybindings(ctx context.Context) (port.KeybindingsConfig, error) {
1833- ret := _mock.Called(ctx)
1839+// InternalSchemePath provides a mock function for the type MockEngine
1840+func (_mock *MockEngine) InternalSchemePath() string {
1841+ ret := _mock.Called()
18341842
18351843 if len(ret) == 0 {
1836- panic("no return value specified for GetDefaultKeybindings")
1844+ panic("no return value specified for InternalSchemePath")
18371845 }
18381846
1839- var r0 port.KeybindingsConfig
1840- var r1 error
1841- if returnFunc, ok := ret.Get(0).(func(context.Context) (port.KeybindingsConfig, error)); ok {
1842- return returnFunc(ctx)
1843- }
1844- if returnFunc, ok := ret.Get(0).(func(context.Context) port.KeybindingsConfig); ok {
1845- r0 = returnFunc(ctx)
1846- } else {
1847- r0 = ret.Get(0).(port.KeybindingsConfig)
1848- }
1849- if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
1850- r1 = returnFunc(ctx)
1847+ var r0 string
1848+ if returnFunc, ok := ret.Get(0).(func() string); ok {
1849+ r0 = returnFunc()
18511850 } else {
1852- r1 = ret.Error(1)
1851+ r0 = ret.Get(0).(string)
18531852 }
1854- return r0, r1
1853+ return r0
18551854 }
18561855
1857-// MockKeybindingsProvider_GetDefaultKeybindings_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDefaultKeybindings'
1858-type MockKeybindingsProvider_GetDefaultKeybindings_Call struct {
1856+// MockEngine_InternalSchemePath_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InternalSchemePath'
1857+type MockEngine_InternalSchemePath_Call struct {
18591858 *mock.Call
18601859 }
18611860
1862-// GetDefaultKeybindings is a helper method to define mock.On call
1863-// - ctx context.Context
1864-func (_e *MockKeybindingsProvider_Expecter) GetDefaultKeybindings(ctx interface{}) *MockKeybindingsProvider_GetDefaultKeybindings_Call {
1865- return &MockKeybindingsProvider_GetDefaultKeybindings_Call{Call: _e.mock.On("GetDefaultKeybindings", ctx)}
1861+// InternalSchemePath is a helper method to define mock.On call
1862+func (_e *MockEngine_Expecter) InternalSchemePath() *MockEngine_InternalSchemePath_Call {
1863+ return &MockEngine_InternalSchemePath_Call{Call: _e.mock.On("InternalSchemePath")}
18661864 }
18671865
1868-func (_c *MockKeybindingsProvider_GetDefaultKeybindings_Call) Run(run func(ctx context.Context)) *MockKeybindingsProvider_GetDefaultKeybindings_Call {
1866+func (_c *MockEngine_InternalSchemePath_Call) Run(run func()) *MockEngine_InternalSchemePath_Call {
18691867 _c.Call.Run(func(args mock.Arguments) {
1870- var arg0 context.Context
1871- if args[0] != nil {
1872- arg0 = args[0].(context.Context)
1873- }
1874- run(
1875- arg0,
1876- )
1868+ run()
18771869 })
18781870 return _c
18791871 }
18801872
1881-func (_c *MockKeybindingsProvider_GetDefaultKeybindings_Call) Return(keybindingsConfig port.KeybindingsConfig, err error) *MockKeybindingsProvider_GetDefaultKeybindings_Call {
1882- _c.Call.Return(keybindingsConfig, err)
1873+func (_c *MockEngine_InternalSchemePath_Call) Return(s string) *MockEngine_InternalSchemePath_Call {
1874+ _c.Call.Return(s)
18831875 return _c
18841876 }
18851877
1886-func (_c *MockKeybindingsProvider_GetDefaultKeybindings_Call) RunAndReturn(run func(ctx context.Context) (port.KeybindingsConfig, error)) *MockKeybindingsProvider_GetDefaultKeybindings_Call {
1878+func (_c *MockEngine_InternalSchemePath_Call) RunAndReturn(run func() string) *MockEngine_InternalSchemePath_Call {
18871879 _c.Call.Return(run)
18881880 return _c
18891881 }
18901882
1891-// GetKeybindings provides a mock function for the type MockKeybindingsProvider
1892-func (_mock *MockKeybindingsProvider) GetKeybindings(ctx context.Context) (port.KeybindingsConfig, error) {
1893- ret := _mock.Called(ctx)
1883+// MessageRouter provides a mock function for the type MockEngine
1884+func (_mock *MockEngine) MessageRouter() port.MessageRouter {
1885+ ret := _mock.Called()
18941886
18951887 if len(ret) == 0 {
1896- panic("no return value specified for GetKeybindings")
1888+ panic("no return value specified for MessageRouter")
18971889 }
18981890
1899- var r0 port.KeybindingsConfig
1900- var r1 error
1901- if returnFunc, ok := ret.Get(0).(func(context.Context) (port.KeybindingsConfig, error)); ok {
1902- return returnFunc(ctx)
1903- }
1904- if returnFunc, ok := ret.Get(0).(func(context.Context) port.KeybindingsConfig); ok {
1905- r0 = returnFunc(ctx)
1906- } else {
1907- r0 = ret.Get(0).(port.KeybindingsConfig)
1908- }
1909- if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
1910- r1 = returnFunc(ctx)
1891+ var r0 port.MessageRouter
1892+ if returnFunc, ok := ret.Get(0).(func() port.MessageRouter); ok {
1893+ r0 = returnFunc()
19111894 } else {
1912- r1 = ret.Error(1)
1895+ if ret.Get(0) != nil {
1896+ r0 = ret.Get(0).(port.MessageRouter)
1897+ }
19131898 }
1914- return r0, r1
1899+ return r0
19151900 }
19161901
1917-// MockKeybindingsProvider_GetKeybindings_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetKeybindings'
1918-type MockKeybindingsProvider_GetKeybindings_Call struct {
1902+// MockEngine_MessageRouter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MessageRouter'
1903+type MockEngine_MessageRouter_Call struct {
19191904 *mock.Call
19201905 }
19211906
1922-// GetKeybindings is a helper method to define mock.On call
1923-// - ctx context.Context
1924-func (_e *MockKeybindingsProvider_Expecter) GetKeybindings(ctx interface{}) *MockKeybindingsProvider_GetKeybindings_Call {
1925- return &MockKeybindingsProvider_GetKeybindings_Call{Call: _e.mock.On("GetKeybindings", ctx)}
1907+// MessageRouter is a helper method to define mock.On call
1908+func (_e *MockEngine_Expecter) MessageRouter() *MockEngine_MessageRouter_Call {
1909+ return &MockEngine_MessageRouter_Call{Call: _e.mock.On("MessageRouter")}
19261910 }
19271911
1928-func (_c *MockKeybindingsProvider_GetKeybindings_Call) Run(run func(ctx context.Context)) *MockKeybindingsProvider_GetKeybindings_Call {
1912+func (_c *MockEngine_MessageRouter_Call) Run(run func()) *MockEngine_MessageRouter_Call {
19291913 _c.Call.Run(func(args mock.Arguments) {
1930- var arg0 context.Context
1931- if args[0] != nil {
1932- arg0 = args[0].(context.Context)
1933- }
1934- run(
1935- arg0,
1936- )
1914+ run()
19371915 })
19381916 return _c
19391917 }
19401918
1941-func (_c *MockKeybindingsProvider_GetKeybindings_Call) Return(keybindingsConfig port.KeybindingsConfig, err error) *MockKeybindingsProvider_GetKeybindings_Call {
1942- _c.Call.Return(keybindingsConfig, err)
1919+func (_c *MockEngine_MessageRouter_Call) Return(messageRouter port.MessageRouter) *MockEngine_MessageRouter_Call {
1920+ _c.Call.Return(messageRouter)
19431921 return _c
19441922 }
19451923
1946-func (_c *MockKeybindingsProvider_GetKeybindings_Call) RunAndReturn(run func(ctx context.Context) (port.KeybindingsConfig, error)) *MockKeybindingsProvider_GetKeybindings_Call {
1924+func (_c *MockEngine_MessageRouter_Call) RunAndReturn(run func() port.MessageRouter) *MockEngine_MessageRouter_Call {
19471925 _c.Call.Return(run)
19481926 return _c
19491927 }
19501928
1951-// NewMockKeybindingsSaver creates a new instance of MockKeybindingsSaver. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
1952-// The first argument is typically a *testing.T value.
1953-func NewMockKeybindingsSaver(t interface {
1954- mock.TestingT
1955- Cleanup(func())
1956-}) *MockKeybindingsSaver {
1957- mock := &MockKeybindingsSaver{}
1958- mock.Mock.Test(t)
1959-
1960- t.Cleanup(func() { mock.AssertExpectations(t) })
1961-
1962- return mock
1963-}
1964-
1965-// MockKeybindingsSaver is an autogenerated mock type for the KeybindingsSaver type
1966-type MockKeybindingsSaver struct {
1967- mock.Mock
1968-}
1969-
1970-type MockKeybindingsSaver_Expecter struct {
1971- mock *mock.Mock
1972-}
1973-
1974-func (_m *MockKeybindingsSaver) EXPECT() *MockKeybindingsSaver_Expecter {
1975- return &MockKeybindingsSaver_Expecter{mock: &_m.Mock}
1976-}
1977-
1978-// ResetAllKeybindings provides a mock function for the type MockKeybindingsSaver
1979-func (_mock *MockKeybindingsSaver) ResetAllKeybindings(ctx context.Context) error {
1980- ret := _mock.Called(ctx)
1929+// Pool provides a mock function for the type MockEngine
1930+func (_mock *MockEngine) Pool() port.WebViewPool {
1931+ ret := _mock.Called()
19811932
19821933 if len(ret) == 0 {
1983- panic("no return value specified for ResetAllKeybindings")
1934+ panic("no return value specified for Pool")
19841935 }
19851936
1986- var r0 error
1987- if returnFunc, ok := ret.Get(0).(func(context.Context) error); ok {
1988- r0 = returnFunc(ctx)
1937+ var r0 port.WebViewPool
1938+ if returnFunc, ok := ret.Get(0).(func() port.WebViewPool); ok {
1939+ r0 = returnFunc()
19891940 } else {
1990- r0 = ret.Error(0)
1941+ if ret.Get(0) != nil {
1942+ r0 = ret.Get(0).(port.WebViewPool)
1943+ }
19911944 }
19921945 return r0
19931946 }
19941947
1995-// MockKeybindingsSaver_ResetAllKeybindings_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResetAllKeybindings'
1996-type MockKeybindingsSaver_ResetAllKeybindings_Call struct {
1948+// MockEngine_Pool_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Pool'
1949+type MockEngine_Pool_Call struct {
19971950 *mock.Call
19981951 }
19991952
2000-// ResetAllKeybindings is a helper method to define mock.On call
2001-// - ctx context.Context
2002-func (_e *MockKeybindingsSaver_Expecter) ResetAllKeybindings(ctx interface{}) *MockKeybindingsSaver_ResetAllKeybindings_Call {
2003- return &MockKeybindingsSaver_ResetAllKeybindings_Call{Call: _e.mock.On("ResetAllKeybindings", ctx)}
1953+// Pool is a helper method to define mock.On call
1954+func (_e *MockEngine_Expecter) Pool() *MockEngine_Pool_Call {
1955+ return &MockEngine_Pool_Call{Call: _e.mock.On("Pool")}
20041956 }
20051957
2006-func (_c *MockKeybindingsSaver_ResetAllKeybindings_Call) Run(run func(ctx context.Context)) *MockKeybindingsSaver_ResetAllKeybindings_Call {
1958+func (_c *MockEngine_Pool_Call) Run(run func()) *MockEngine_Pool_Call {
20071959 _c.Call.Run(func(args mock.Arguments) {
2008- var arg0 context.Context
2009- if args[0] != nil {
2010- arg0 = args[0].(context.Context)
2011- }
2012- run(
2013- arg0,
2014- )
1960+ run()
20151961 })
20161962 return _c
20171963 }
20181964
2019-func (_c *MockKeybindingsSaver_ResetAllKeybindings_Call) Return(err error) *MockKeybindingsSaver_ResetAllKeybindings_Call {
2020- _c.Call.Return(err)
1965+func (_c *MockEngine_Pool_Call) Return(webViewPool port.WebViewPool) *MockEngine_Pool_Call {
1966+ _c.Call.Return(webViewPool)
20211967 return _c
20221968 }
20231969
2024-func (_c *MockKeybindingsSaver_ResetAllKeybindings_Call) RunAndReturn(run func(ctx context.Context) error) *MockKeybindingsSaver_ResetAllKeybindings_Call {
1970+func (_c *MockEngine_Pool_Call) RunAndReturn(run func() port.WebViewPool) *MockEngine_Pool_Call {
20251971 _c.Call.Return(run)
20261972 return _c
20271973 }
20281974
2029-// ResetKeybinding provides a mock function for the type MockKeybindingsSaver
2030-func (_mock *MockKeybindingsSaver) ResetKeybinding(ctx context.Context, req port.ResetKeybindingRequest) error {
2031- ret := _mock.Called(ctx, req)
1975+// SchemeHandler provides a mock function for the type MockEngine
1976+func (_mock *MockEngine) SchemeHandler() port.SchemeHandler {
1977+ ret := _mock.Called()
20321978
20331979 if len(ret) == 0 {
2034- panic("no return value specified for ResetKeybinding")
1980+ panic("no return value specified for SchemeHandler")
20351981 }
20361982
2037- var r0 error
2038- if returnFunc, ok := ret.Get(0).(func(context.Context, port.ResetKeybindingRequest) error); ok {
2039- r0 = returnFunc(ctx, req)
1983+ var r0 port.SchemeHandler
1984+ if returnFunc, ok := ret.Get(0).(func() port.SchemeHandler); ok {
1985+ r0 = returnFunc()
20401986 } else {
2041- r0 = ret.Error(0)
1987+ if ret.Get(0) != nil {
1988+ r0 = ret.Get(0).(port.SchemeHandler)
1989+ }
20421990 }
20431991 return r0
20441992 }
20451993
2046-// MockKeybindingsSaver_ResetKeybinding_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResetKeybinding'
2047-type MockKeybindingsSaver_ResetKeybinding_Call struct {
1994+// MockEngine_SchemeHandler_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SchemeHandler'
1995+type MockEngine_SchemeHandler_Call struct {
20481996 *mock.Call
20491997 }
20501998
2051-// ResetKeybinding is a helper method to define mock.On call
2052-// - ctx context.Context
2053-// - req port.ResetKeybindingRequest
2054-func (_e *MockKeybindingsSaver_Expecter) ResetKeybinding(ctx interface{}, req interface{}) *MockKeybindingsSaver_ResetKeybinding_Call {
2055- return &MockKeybindingsSaver_ResetKeybinding_Call{Call: _e.mock.On("ResetKeybinding", ctx, req)}
1999+// SchemeHandler is a helper method to define mock.On call
2000+func (_e *MockEngine_Expecter) SchemeHandler() *MockEngine_SchemeHandler_Call {
2001+ return &MockEngine_SchemeHandler_Call{Call: _e.mock.On("SchemeHandler")}
20562002 }
20572003
2058-func (_c *MockKeybindingsSaver_ResetKeybinding_Call) Run(run func(ctx context.Context, req port.ResetKeybindingRequest)) *MockKeybindingsSaver_ResetKeybinding_Call {
2004+func (_c *MockEngine_SchemeHandler_Call) Run(run func()) *MockEngine_SchemeHandler_Call {
20592005 _c.Call.Run(func(args mock.Arguments) {
2060- var arg0 context.Context
2061- if args[0] != nil {
2062- arg0 = args[0].(context.Context)
2063- }
2064- var arg1 port.ResetKeybindingRequest
2065- if args[1] != nil {
2066- arg1 = args[1].(port.ResetKeybindingRequest)
2067- }
2068- run(
2069- arg0,
2070- arg1,
2071- )
2006+ run()
20722007 })
20732008 return _c
20742009 }
20752010
2076-func (_c *MockKeybindingsSaver_ResetKeybinding_Call) Return(err error) *MockKeybindingsSaver_ResetKeybinding_Call {
2077- _c.Call.Return(err)
2011+func (_c *MockEngine_SchemeHandler_Call) Return(schemeHandler port.SchemeHandler) *MockEngine_SchemeHandler_Call {
2012+ _c.Call.Return(schemeHandler)
20782013 return _c
20792014 }
20802015
2081-func (_c *MockKeybindingsSaver_ResetKeybinding_Call) RunAndReturn(run func(ctx context.Context, req port.ResetKeybindingRequest) error) *MockKeybindingsSaver_ResetKeybinding_Call {
2016+func (_c *MockEngine_SchemeHandler_Call) RunAndReturn(run func() port.SchemeHandler) *MockEngine_SchemeHandler_Call {
20822017 _c.Call.Return(run)
20832018 return _c
20842019 }
20852020
2086-// SetKeybinding provides a mock function for the type MockKeybindingsSaver
2087-func (_mock *MockKeybindingsSaver) SetKeybinding(ctx context.Context, req port.SetKeybindingRequest) error {
2088- ret := _mock.Called(ctx, req)
2021+// SettingsApplier provides a mock function for the type MockEngine
2022+func (_mock *MockEngine) SettingsApplier() port.SettingsApplier {
2023+ ret := _mock.Called()
20892024
20902025 if len(ret) == 0 {
2091- panic("no return value specified for SetKeybinding")
2026+ panic("no return value specified for SettingsApplier")
20922027 }
20932028
2094- var r0 error
2095- if returnFunc, ok := ret.Get(0).(func(context.Context, port.SetKeybindingRequest) error); ok {
2096- r0 = returnFunc(ctx, req)
2029+ var r0 port.SettingsApplier
2030+ if returnFunc, ok := ret.Get(0).(func() port.SettingsApplier); ok {
2031+ r0 = returnFunc()
20972032 } else {
2098- r0 = ret.Error(0)
2033+ if ret.Get(0) != nil {
2034+ r0 = ret.Get(0).(port.SettingsApplier)
2035+ }
20992036 }
21002037 return r0
21012038 }
21022039
2103-// MockKeybindingsSaver_SetKeybinding_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetKeybinding'
2104-type MockKeybindingsSaver_SetKeybinding_Call struct {
2040+// MockEngine_SettingsApplier_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SettingsApplier'
2041+type MockEngine_SettingsApplier_Call struct {
21052042 *mock.Call
21062043 }
21072044
2108-// SetKeybinding is a helper method to define mock.On call
2109-// - ctx context.Context
2110-// - req port.SetKeybindingRequest
2111-func (_e *MockKeybindingsSaver_Expecter) SetKeybinding(ctx interface{}, req interface{}) *MockKeybindingsSaver_SetKeybinding_Call {
2112- return &MockKeybindingsSaver_SetKeybinding_Call{Call: _e.mock.On("SetKeybinding", ctx, req)}
2045+// SettingsApplier is a helper method to define mock.On call
2046+func (_e *MockEngine_Expecter) SettingsApplier() *MockEngine_SettingsApplier_Call {
2047+ return &MockEngine_SettingsApplier_Call{Call: _e.mock.On("SettingsApplier")}
21132048 }
21142049
2115-func (_c *MockKeybindingsSaver_SetKeybinding_Call) Run(run func(ctx context.Context, req port.SetKeybindingRequest)) *MockKeybindingsSaver_SetKeybinding_Call {
2050+func (_c *MockEngine_SettingsApplier_Call) Run(run func()) *MockEngine_SettingsApplier_Call {
21162051 _c.Call.Run(func(args mock.Arguments) {
2117- var arg0 context.Context
2118- if args[0] != nil {
2119- arg0 = args[0].(context.Context)
2120- }
2121- var arg1 port.SetKeybindingRequest
2122- if args[1] != nil {
2123- arg1 = args[1].(port.SetKeybindingRequest)
2124- }
2125- run(
2126- arg0,
2127- arg1,
2128- )
2052+ run()
21292053 })
21302054 return _c
21312055 }
21322056
2133-func (_c *MockKeybindingsSaver_SetKeybinding_Call) Return(err error) *MockKeybindingsSaver_SetKeybinding_Call {
2134- _c.Call.Return(err)
2057+func (_c *MockEngine_SettingsApplier_Call) Return(settingsApplier port.SettingsApplier) *MockEngine_SettingsApplier_Call {
2058+ _c.Call.Return(settingsApplier)
21352059 return _c
21362060 }
21372061
2138-func (_c *MockKeybindingsSaver_SetKeybinding_Call) RunAndReturn(run func(ctx context.Context, req port.SetKeybindingRequest) error) *MockKeybindingsSaver_SetKeybinding_Call {
2062+func (_c *MockEngine_SettingsApplier_Call) RunAndReturn(run func() port.SettingsApplier) *MockEngine_SettingsApplier_Call {
21392063 _c.Call.Return(run)
21402064 return _c
21412065 }
21422066
2143-// NewMockPermissionDialogPresenter creates a new instance of MockPermissionDialogPresenter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
2067+// NewMockSchemeHandler creates a new instance of MockSchemeHandler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
21442068 // The first argument is typically a *testing.T value.
2145-func NewMockPermissionDialogPresenter(t interface {
2069+func NewMockSchemeHandler(t interface {
21462070 mock.TestingT
21472071 Cleanup(func())
2148-}) *MockPermissionDialogPresenter {
2149- mock := &MockPermissionDialogPresenter{}
2072+}) *MockSchemeHandler {
2073+ mock := &MockSchemeHandler{}
21502074 mock.Mock.Test(t)
21512075
21522076 t.Cleanup(func() { mock.AssertExpectations(t) })
@@ -2154,84 +2078,72 @@ func NewMockPermissionDialogPresenter(t interface {
21542078 return mock
21552079 }
21562080
2157-// MockPermissionDialogPresenter is an autogenerated mock type for the PermissionDialogPresenter type
2158-type MockPermissionDialogPresenter struct {
2081+// MockSchemeHandler is an autogenerated mock type for the SchemeHandler type
2082+type MockSchemeHandler struct {
21592083 mock.Mock
21602084 }
21612085
2162-type MockPermissionDialogPresenter_Expecter struct {
2086+type MockSchemeHandler_Expecter struct {
21632087 mock *mock.Mock
21642088 }
21652089
2166-func (_m *MockPermissionDialogPresenter) EXPECT() *MockPermissionDialogPresenter_Expecter {
2167- return &MockPermissionDialogPresenter_Expecter{mock: &_m.Mock}
2090+func (_m *MockSchemeHandler) EXPECT() *MockSchemeHandler_Expecter {
2091+ return &MockSchemeHandler_Expecter{mock: &_m.Mock}
21682092 }
21692093
2170-// ShowPermissionDialog provides a mock function for the type MockPermissionDialogPresenter
2171-func (_mock *MockPermissionDialogPresenter) ShowPermissionDialog(ctx context.Context, origin string, permTypes []entity.PermissionType, callback func(result port.PermissionDialogResult)) {
2172- _mock.Called(ctx, origin, permTypes, callback)
2094+// RegisterScheme provides a mock function for the type MockSchemeHandler
2095+func (_mock *MockSchemeHandler) RegisterScheme(scheme string, handler func(uri string) ([]byte, string, error)) {
2096+ _mock.Called(scheme, handler)
21732097 return
21742098 }
21752099
2176-// MockPermissionDialogPresenter_ShowPermissionDialog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ShowPermissionDialog'
2177-type MockPermissionDialogPresenter_ShowPermissionDialog_Call struct {
2100+// MockSchemeHandler_RegisterScheme_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegisterScheme'
2101+type MockSchemeHandler_RegisterScheme_Call struct {
21782102 *mock.Call
21792103 }
21802104
2181-// ShowPermissionDialog is a helper method to define mock.On call
2182-// - ctx context.Context
2183-// - origin string
2184-// - permTypes []entity.PermissionType
2185-// - callback func(result port.PermissionDialogResult)
2186-func (_e *MockPermissionDialogPresenter_Expecter) ShowPermissionDialog(ctx interface{}, origin interface{}, permTypes interface{}, callback interface{}) *MockPermissionDialogPresenter_ShowPermissionDialog_Call {
2187- return &MockPermissionDialogPresenter_ShowPermissionDialog_Call{Call: _e.mock.On("ShowPermissionDialog", ctx, origin, permTypes, callback)}
2105+// RegisterScheme is a helper method to define mock.On call
2106+// - scheme string
2107+// - handler func(uri string) ([]byte, string, error)
2108+func (_e *MockSchemeHandler_Expecter) RegisterScheme(scheme interface{}, handler interface{}) *MockSchemeHandler_RegisterScheme_Call {
2109+ return &MockSchemeHandler_RegisterScheme_Call{Call: _e.mock.On("RegisterScheme", scheme, handler)}
21882110 }
21892111
2190-func (_c *MockPermissionDialogPresenter_ShowPermissionDialog_Call) Run(run func(ctx context.Context, origin string, permTypes []entity.PermissionType, callback func(result port.PermissionDialogResult))) *MockPermissionDialogPresenter_ShowPermissionDialog_Call {
2112+func (_c *MockSchemeHandler_RegisterScheme_Call) Run(run func(scheme string, handler func(uri string) ([]byte, string, error))) *MockSchemeHandler_RegisterScheme_Call {
21912113 _c.Call.Run(func(args mock.Arguments) {
2192- var arg0 context.Context
2114+ var arg0 string
21932115 if args[0] != nil {
2194- arg0 = args[0].(context.Context)
2116+ arg0 = args[0].(string)
21952117 }
2196- var arg1 string
2118+ var arg1 func(uri string) ([]byte, string, error)
21972119 if args[1] != nil {
2198- arg1 = args[1].(string)
2199- }
2200- var arg2 []entity.PermissionType
2201- if args[2] != nil {
2202- arg2 = args[2].([]entity.PermissionType)
2203- }
2204- var arg3 func(result port.PermissionDialogResult)
2205- if args[3] != nil {
2206- arg3 = args[3].(func(result port.PermissionDialogResult))
2120+ arg1 = args[1].(func(uri string) ([]byte, string, error))
22072121 }
22082122 run(
22092123 arg0,
22102124 arg1,
2211- arg2,
2212- arg3,
22132125 )
22142126 })
22152127 return _c
22162128 }
22172129
2218-func (_c *MockPermissionDialogPresenter_ShowPermissionDialog_Call) Return() *MockPermissionDialogPresenter_ShowPermissionDialog_Call {
2130+func (_c *MockSchemeHandler_RegisterScheme_Call) Return() *MockSchemeHandler_RegisterScheme_Call {
22192131 _c.Call.Return()
22202132 return _c
22212133 }
22222134
2223-func (_c *MockPermissionDialogPresenter_ShowPermissionDialog_Call) RunAndReturn(run func(ctx context.Context, origin string, permTypes []entity.PermissionType, callback func(result port.PermissionDialogResult))) *MockPermissionDialogPresenter_ShowPermissionDialog_Call {
2135+func (_c *MockSchemeHandler_RegisterScheme_Call) RunAndReturn(run func(scheme string, handler func(uri string) ([]byte, string, error))) *MockSchemeHandler_RegisterScheme_Call {
22242136 _c.Run(run)
22252137 return _c
22262138 }
22272139
2228-// NewMockPermissionRepository creates a new instance of MockPermissionRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
2140+// NewMockMessageRouter creates a new instance of MockMessageRouter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
22292141 // The first argument is typically a *testing.T value.
2230-func NewMockPermissionRepository(t interface {
2142+func NewMockMessageRouter(t interface {
22312143 mock.TestingT
22322144 Cleanup(func())
2233-}) *MockPermissionRepository {
2234- mock := &MockPermissionRepository{}
2145+}) *MockMessageRouter {
2146+ mock := &MockMessageRouter{}
22352147 mock.Mock.Test(t)
22362148
22372149 t.Cleanup(func() { mock.AssertExpectations(t) })
@@ -2239,205 +2151,176 @@ func NewMockPermissionRepository(t interface {
22392151 return mock
22402152 }
22412153
2242-// MockPermissionRepository is an autogenerated mock type for the PermissionRepository type
2243-type MockPermissionRepository struct {
2154+// MockMessageRouter is an autogenerated mock type for the MessageRouter type
2155+type MockMessageRouter struct {
22442156 mock.Mock
22452157 }
22462158
2247-type MockPermissionRepository_Expecter struct {
2159+type MockMessageRouter_Expecter struct {
22482160 mock *mock.Mock
22492161 }
22502162
2251-func (_m *MockPermissionRepository) EXPECT() *MockPermissionRepository_Expecter {
2252- return &MockPermissionRepository_Expecter{mock: &_m.Mock}
2163+func (_m *MockMessageRouter) EXPECT() *MockMessageRouter_Expecter {
2164+ return &MockMessageRouter_Expecter{mock: &_m.Mock}
22532165 }
22542166
2255-// Delete provides a mock function for the type MockPermissionRepository
2256-func (_mock *MockPermissionRepository) Delete(ctx context.Context, origin string, permType entity.PermissionType) error {
2257- ret := _mock.Called(ctx, origin, permType)
2167+// PostMessage provides a mock function for the type MockMessageRouter
2168+func (_mock *MockMessageRouter) PostMessage(webviewID port.WebViewID, message string) error {
2169+ ret := _mock.Called(webviewID, message)
22582170
22592171 if len(ret) == 0 {
2260- panic("no return value specified for Delete")
2172+ panic("no return value specified for PostMessage")
22612173 }
22622174
22632175 var r0 error
2264- if returnFunc, ok := ret.Get(0).(func(context.Context, string, entity.PermissionType) error); ok {
2265- r0 = returnFunc(ctx, origin, permType)
2176+ if returnFunc, ok := ret.Get(0).(func(port.WebViewID, string) error); ok {
2177+ r0 = returnFunc(webviewID, message)
22662178 } else {
22672179 r0 = ret.Error(0)
22682180 }
22692181 return r0
22702182 }
22712183
2272-// MockPermissionRepository_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete'
2273-type MockPermissionRepository_Delete_Call struct {
2184+// MockMessageRouter_PostMessage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PostMessage'
2185+type MockMessageRouter_PostMessage_Call struct {
22742186 *mock.Call
22752187 }
22762188
2277-// Delete is a helper method to define mock.On call
2278-// - ctx context.Context
2279-// - origin string
2280-// - permType entity.PermissionType
2281-func (_e *MockPermissionRepository_Expecter) Delete(ctx interface{}, origin interface{}, permType interface{}) *MockPermissionRepository_Delete_Call {
2282- return &MockPermissionRepository_Delete_Call{Call: _e.mock.On("Delete", ctx, origin, permType)}
2189+// PostMessage is a helper method to define mock.On call
2190+// - webviewID port.WebViewID
2191+// - message string
2192+func (_e *MockMessageRouter_Expecter) PostMessage(webviewID interface{}, message interface{}) *MockMessageRouter_PostMessage_Call {
2193+ return &MockMessageRouter_PostMessage_Call{Call: _e.mock.On("PostMessage", webviewID, message)}
22832194 }
22842195
2285-func (_c *MockPermissionRepository_Delete_Call) Run(run func(ctx context.Context, origin string, permType entity.PermissionType)) *MockPermissionRepository_Delete_Call {
2196+func (_c *MockMessageRouter_PostMessage_Call) Run(run func(webviewID port.WebViewID, message string)) *MockMessageRouter_PostMessage_Call {
22862197 _c.Call.Run(func(args mock.Arguments) {
2287- var arg0 context.Context
2198+ var arg0 port.WebViewID
22882199 if args[0] != nil {
2289- arg0 = args[0].(context.Context)
2200+ arg0 = args[0].(port.WebViewID)
22902201 }
22912202 var arg1 string
22922203 if args[1] != nil {
22932204 arg1 = args[1].(string)
22942205 }
2295- var arg2 entity.PermissionType
2296- if args[2] != nil {
2297- arg2 = args[2].(entity.PermissionType)
2298- }
22992206 run(
23002207 arg0,
23012208 arg1,
2302- arg2,
23032209 )
23042210 })
23052211 return _c
23062212 }
23072213
2308-func (_c *MockPermissionRepository_Delete_Call) Return(err error) *MockPermissionRepository_Delete_Call {
2214+func (_c *MockMessageRouter_PostMessage_Call) Return(err error) *MockMessageRouter_PostMessage_Call {
23092215 _c.Call.Return(err)
23102216 return _c
23112217 }
23122218
2313-func (_c *MockPermissionRepository_Delete_Call) RunAndReturn(run func(ctx context.Context, origin string, permType entity.PermissionType) error) *MockPermissionRepository_Delete_Call {
2219+func (_c *MockMessageRouter_PostMessage_Call) RunAndReturn(run func(webviewID port.WebViewID, message string) error) *MockMessageRouter_PostMessage_Call {
23142220 _c.Call.Return(run)
23152221 return _c
23162222 }
23172223
2318-// Get provides a mock function for the type MockPermissionRepository
2319-func (_mock *MockPermissionRepository) Get(ctx context.Context, origin string, permType entity.PermissionType) (*entity.PermissionRecord, error) {
2320- ret := _mock.Called(ctx, origin, permType)
2321-
2322- if len(ret) == 0 {
2323- panic("no return value specified for Get")
2324- }
2325-
2326- var r0 *entity.PermissionRecord
2327- var r1 error
2328- if returnFunc, ok := ret.Get(0).(func(context.Context, string, entity.PermissionType) (*entity.PermissionRecord, error)); ok {
2329- return returnFunc(ctx, origin, permType)
2330- }
2331- if returnFunc, ok := ret.Get(0).(func(context.Context, string, entity.PermissionType) *entity.PermissionRecord); ok {
2332- r0 = returnFunc(ctx, origin, permType)
2333- } else {
2334- if ret.Get(0) != nil {
2335- r0 = ret.Get(0).(*entity.PermissionRecord)
2336- }
2337- }
2338- if returnFunc, ok := ret.Get(1).(func(context.Context, string, entity.PermissionType) error); ok {
2339- r1 = returnFunc(ctx, origin, permType)
2340- } else {
2341- r1 = ret.Error(1)
2342- }
2343- return r0, r1
2224+// RegisterHandler provides a mock function for the type MockMessageRouter
2225+func (_mock *MockMessageRouter) RegisterHandler(name string, handler func(message string) (string, error)) {
2226+ _mock.Called(name, handler)
2227+ return
23442228 }
23452229
2346-// MockPermissionRepository_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'
2347-type MockPermissionRepository_Get_Call struct {
2230+// MockMessageRouter_RegisterHandler_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegisterHandler'
2231+type MockMessageRouter_RegisterHandler_Call struct {
23482232 *mock.Call
23492233 }
23502234
2351-// Get is a helper method to define mock.On call
2352-// - ctx context.Context
2353-// - origin string
2354-// - permType entity.PermissionType
2355-func (_e *MockPermissionRepository_Expecter) Get(ctx interface{}, origin interface{}, permType interface{}) *MockPermissionRepository_Get_Call {
2356- return &MockPermissionRepository_Get_Call{Call: _e.mock.On("Get", ctx, origin, permType)}
2235+// RegisterHandler is a helper method to define mock.On call
2236+// - name string
2237+// - handler func(message string) (string, error)
2238+func (_e *MockMessageRouter_Expecter) RegisterHandler(name interface{}, handler interface{}) *MockMessageRouter_RegisterHandler_Call {
2239+ return &MockMessageRouter_RegisterHandler_Call{Call: _e.mock.On("RegisterHandler", name, handler)}
23572240 }
23582241
2359-func (_c *MockPermissionRepository_Get_Call) Run(run func(ctx context.Context, origin string, permType entity.PermissionType)) *MockPermissionRepository_Get_Call {
2242+func (_c *MockMessageRouter_RegisterHandler_Call) Run(run func(name string, handler func(message string) (string, error))) *MockMessageRouter_RegisterHandler_Call {
23602243 _c.Call.Run(func(args mock.Arguments) {
2361- var arg0 context.Context
2244+ var arg0 string
23622245 if args[0] != nil {
2363- arg0 = args[0].(context.Context)
2246+ arg0 = args[0].(string)
23642247 }
2365- var arg1 string
2248+ var arg1 func(message string) (string, error)
23662249 if args[1] != nil {
2367- arg1 = args[1].(string)
2368- }
2369- var arg2 entity.PermissionType
2370- if args[2] != nil {
2371- arg2 = args[2].(entity.PermissionType)
2250+ arg1 = args[1].(func(message string) (string, error))
23722251 }
23732252 run(
23742253 arg0,
23752254 arg1,
2376- arg2,
23772255 )
23782256 })
23792257 return _c
23802258 }
23812259
2382-func (_c *MockPermissionRepository_Get_Call) Return(permissionRecord *entity.PermissionRecord, err error) *MockPermissionRepository_Get_Call {
2383- _c.Call.Return(permissionRecord, err)
2260+func (_c *MockMessageRouter_RegisterHandler_Call) Return() *MockMessageRouter_RegisterHandler_Call {
2261+ _c.Call.Return()
23842262 return _c
23852263 }
23862264
2387-func (_c *MockPermissionRepository_Get_Call) RunAndReturn(run func(ctx context.Context, origin string, permType entity.PermissionType) (*entity.PermissionRecord, error)) *MockPermissionRepository_Get_Call {
2388- _c.Call.Return(run)
2265+func (_c *MockMessageRouter_RegisterHandler_Call) RunAndReturn(run func(name string, handler func(message string) (string, error))) *MockMessageRouter_RegisterHandler_Call {
2266+ _c.Run(run)
23892267 return _c
23902268 }
23912269
2392-// GetAll provides a mock function for the type MockPermissionRepository
2393-func (_mock *MockPermissionRepository) GetAll(ctx context.Context, origin string) ([]*entity.PermissionRecord, error) {
2394- ret := _mock.Called(ctx, origin)
2270+// NewMockSettingsApplier creates a new instance of MockSettingsApplier. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
2271+// The first argument is typically a *testing.T value.
2272+func NewMockSettingsApplier(t interface {
2273+ mock.TestingT
2274+ Cleanup(func())
2275+}) *MockSettingsApplier {
2276+ mock := &MockSettingsApplier{}
2277+ mock.Mock.Test(t)
23952278
2396- if len(ret) == 0 {
2397- panic("no return value specified for GetAll")
2398- }
2279+ t.Cleanup(func() { mock.AssertExpectations(t) })
23992280
2400- var r0 []*entity.PermissionRecord
2401- var r1 error
2402- if returnFunc, ok := ret.Get(0).(func(context.Context, string) ([]*entity.PermissionRecord, error)); ok {
2403- return returnFunc(ctx, origin)
2404- }
2405- if returnFunc, ok := ret.Get(0).(func(context.Context, string) []*entity.PermissionRecord); ok {
2406- r0 = returnFunc(ctx, origin)
2407- } else {
2408- if ret.Get(0) != nil {
2409- r0 = ret.Get(0).([]*entity.PermissionRecord)
2410- }
2411- }
2412- if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
2413- r1 = returnFunc(ctx, origin)
2414- } else {
2415- r1 = ret.Error(1)
2416- }
2417- return r0, r1
2281+ return mock
24182282 }
24192283
2420-// MockPermissionRepository_GetAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAll'
2421-type MockPermissionRepository_GetAll_Call struct {
2284+// MockSettingsApplier is an autogenerated mock type for the SettingsApplier type
2285+type MockSettingsApplier struct {
2286+ mock.Mock
2287+}
2288+
2289+type MockSettingsApplier_Expecter struct {
2290+ mock *mock.Mock
2291+}
2292+
2293+func (_m *MockSettingsApplier) EXPECT() *MockSettingsApplier_Expecter {
2294+ return &MockSettingsApplier_Expecter{mock: &_m.Mock}
2295+}
2296+
2297+// ApplyToAll provides a mock function for the type MockSettingsApplier
2298+func (_mock *MockSettingsApplier) ApplyToAll(ctx context.Context, webviews []port.WebView) {
2299+ _mock.Called(ctx, webviews)
2300+ return
2301+}
2302+
2303+// MockSettingsApplier_ApplyToAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ApplyToAll'
2304+type MockSettingsApplier_ApplyToAll_Call struct {
24222305 *mock.Call
24232306 }
24242307
2425-// GetAll is a helper method to define mock.On call
2308+// ApplyToAll is a helper method to define mock.On call
24262309 // - ctx context.Context
2427-// - origin string
2428-func (_e *MockPermissionRepository_Expecter) GetAll(ctx interface{}, origin interface{}) *MockPermissionRepository_GetAll_Call {
2429- return &MockPermissionRepository_GetAll_Call{Call: _e.mock.On("GetAll", ctx, origin)}
2310+// - webviews []port.WebView
2311+func (_e *MockSettingsApplier_Expecter) ApplyToAll(ctx interface{}, webviews interface{}) *MockSettingsApplier_ApplyToAll_Call {
2312+ return &MockSettingsApplier_ApplyToAll_Call{Call: _e.mock.On("ApplyToAll", ctx, webviews)}
24302313 }
24312314
2432-func (_c *MockPermissionRepository_GetAll_Call) Run(run func(ctx context.Context, origin string)) *MockPermissionRepository_GetAll_Call {
2315+func (_c *MockSettingsApplier_ApplyToAll_Call) Run(run func(ctx context.Context, webviews []port.WebView)) *MockSettingsApplier_ApplyToAll_Call {
24332316 _c.Call.Run(func(args mock.Arguments) {
24342317 var arg0 context.Context
24352318 if args[0] != nil {
24362319 arg0 = args[0].(context.Context)
24372320 }
2438- var arg1 string
2321+ var arg1 []port.WebView
24392322 if args[1] != nil {
2440- arg1 = args[1].(string)
2323+ arg1 = args[1].([]port.WebView)
24412324 }
24422325 run(
24432326 arg0,
@@ -2447,54 +2330,70 @@ func (_c *MockPermissionRepository_GetAll_Call) Run(run func(ctx context.Context
24472330 return _c
24482331 }
24492332
2450-func (_c *MockPermissionRepository_GetAll_Call) Return(permissionRecords []*entity.PermissionRecord, err error) *MockPermissionRepository_GetAll_Call {
2451- _c.Call.Return(permissionRecords, err)
2333+func (_c *MockSettingsApplier_ApplyToAll_Call) Return() *MockSettingsApplier_ApplyToAll_Call {
2334+ _c.Call.Return()
24522335 return _c
24532336 }
24542337
2455-func (_c *MockPermissionRepository_GetAll_Call) RunAndReturn(run func(ctx context.Context, origin string) ([]*entity.PermissionRecord, error)) *MockPermissionRepository_GetAll_Call {
2456- _c.Call.Return(run)
2338+func (_c *MockSettingsApplier_ApplyToAll_Call) RunAndReturn(run func(ctx context.Context, webviews []port.WebView)) *MockSettingsApplier_ApplyToAll_Call {
2339+ _c.Run(run)
24572340 return _c
24582341 }
24592342
2460-// Set provides a mock function for the type MockPermissionRepository
2461-func (_mock *MockPermissionRepository) Set(ctx context.Context, record *entity.PermissionRecord) error {
2462- ret := _mock.Called(ctx, record)
2343+// NewMockFilterApplier creates a new instance of MockFilterApplier. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
2344+// The first argument is typically a *testing.T value.
2345+func NewMockFilterApplier(t interface {
2346+ mock.TestingT
2347+ Cleanup(func())
2348+}) *MockFilterApplier {
2349+ mock := &MockFilterApplier{}
2350+ mock.Mock.Test(t)
24632351
2464- if len(ret) == 0 {
2465- panic("no return value specified for Set")
2466- }
2352+ t.Cleanup(func() { mock.AssertExpectations(t) })
24672353
2468- var r0 error
2469- if returnFunc, ok := ret.Get(0).(func(context.Context, *entity.PermissionRecord) error); ok {
2470- r0 = returnFunc(ctx, record)
2471- } else {
2472- r0 = ret.Error(0)
2473- }
2474- return r0
2354+ return mock
24752355 }
24762356
2477-// MockPermissionRepository_Set_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Set'
2478-type MockPermissionRepository_Set_Call struct {
2357+// MockFilterApplier is an autogenerated mock type for the FilterApplier type
2358+type MockFilterApplier struct {
2359+ mock.Mock
2360+}
2361+
2362+type MockFilterApplier_Expecter struct {
2363+ mock *mock.Mock
2364+}
2365+
2366+func (_m *MockFilterApplier) EXPECT() *MockFilterApplier_Expecter {
2367+ return &MockFilterApplier_Expecter{mock: &_m.Mock}
2368+}
2369+
2370+// ApplyToAll provides a mock function for the type MockFilterApplier
2371+func (_mock *MockFilterApplier) ApplyToAll(ctx context.Context, webviews []port.WebView) {
2372+ _mock.Called(ctx, webviews)
2373+ return
2374+}
2375+
2376+// MockFilterApplier_ApplyToAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ApplyToAll'
2377+type MockFilterApplier_ApplyToAll_Call struct {
24792378 *mock.Call
24802379 }
24812380
2482-// Set is a helper method to define mock.On call
2381+// ApplyToAll is a helper method to define mock.On call
24832382 // - ctx context.Context
2484-// - record *entity.PermissionRecord
2485-func (_e *MockPermissionRepository_Expecter) Set(ctx interface{}, record interface{}) *MockPermissionRepository_Set_Call {
2486- return &MockPermissionRepository_Set_Call{Call: _e.mock.On("Set", ctx, record)}
2383+// - webviews []port.WebView
2384+func (_e *MockFilterApplier_Expecter) ApplyToAll(ctx interface{}, webviews interface{}) *MockFilterApplier_ApplyToAll_Call {
2385+ return &MockFilterApplier_ApplyToAll_Call{Call: _e.mock.On("ApplyToAll", ctx, webviews)}
24872386 }
24882387
2489-func (_c *MockPermissionRepository_Set_Call) Run(run func(ctx context.Context, record *entity.PermissionRecord)) *MockPermissionRepository_Set_Call {
2388+func (_c *MockFilterApplier_ApplyToAll_Call) Run(run func(ctx context.Context, webviews []port.WebView)) *MockFilterApplier_ApplyToAll_Call {
24902389 _c.Call.Run(func(args mock.Arguments) {
24912390 var arg0 context.Context
24922391 if args[0] != nil {
24932392 arg0 = args[0].(context.Context)
24942393 }
2495- var arg1 *entity.PermissionRecord
2394+ var arg1 []port.WebView
24962395 if args[1] != nil {
2497- arg1 = args[1].(*entity.PermissionRecord)
2396+ arg1 = args[1].([]port.WebView)
24982397 }
24992398 run(
25002399 arg0,
@@ -2504,23 +2403,23 @@ func (_c *MockPermissionRepository_Set_Call) Run(run func(ctx context.Context, r
25042403 return _c
25052404 }
25062405
2507-func (_c *MockPermissionRepository_Set_Call) Return(err error) *MockPermissionRepository_Set_Call {
2508- _c.Call.Return(err)
2406+func (_c *MockFilterApplier_ApplyToAll_Call) Return() *MockFilterApplier_ApplyToAll_Call {
2407+ _c.Call.Return()
25092408 return _c
25102409 }
25112410
2512-func (_c *MockPermissionRepository_Set_Call) RunAndReturn(run func(ctx context.Context, record *entity.PermissionRecord) error) *MockPermissionRepository_Set_Call {
2513- _c.Call.Return(run)
2411+func (_c *MockFilterApplier_ApplyToAll_Call) RunAndReturn(run func(ctx context.Context, webviews []port.WebView)) *MockFilterApplier_ApplyToAll_Call {
2412+ _c.Run(run)
25142413 return _c
25152414 }
25162415
2517-// NewMockSessionLogger creates a new instance of MockSessionLogger. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
2416+// NewMockFaviconDatabase creates a new instance of MockFaviconDatabase. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
25182417 // The first argument is typically a *testing.T value.
2519-func NewMockSessionLogger(t interface {
2418+func NewMockFaviconDatabase(t interface {
25202419 mock.TestingT
25212420 Cleanup(func())
2522-}) *MockSessionLogger {
2523- mock := &MockSessionLogger{}
2421+}) *MockFaviconDatabase {
2422+ mock := &MockFaviconDatabase{}
25242423 mock.Mock.Test(t)
25252424
25262425 t.Cleanup(func() { mock.AssertExpectations(t) })
@@ -2528,106 +2427,72 @@ func NewMockSessionLogger(t interface {
25282427 return mock
25292428 }
25302429
2531-// MockSessionLogger is an autogenerated mock type for the SessionLogger type
2532-type MockSessionLogger struct {
2430+// MockFaviconDatabase is an autogenerated mock type for the FaviconDatabase type
2431+type MockFaviconDatabase struct {
25332432 mock.Mock
25342433 }
25352434
2536-type MockSessionLogger_Expecter struct {
2435+type MockFaviconDatabase_Expecter struct {
25372436 mock *mock.Mock
25382437 }
25392438
2540-func (_m *MockSessionLogger) EXPECT() *MockSessionLogger_Expecter {
2541- return &MockSessionLogger_Expecter{mock: &_m.Mock}
2439+func (_m *MockFaviconDatabase) EXPECT() *MockFaviconDatabase_Expecter {
2440+ return &MockFaviconDatabase_Expecter{mock: &_m.Mock}
25422441 }
25432442
2544-// CreateLogger provides a mock function for the type MockSessionLogger
2545-func (_mock *MockSessionLogger) CreateLogger(ctx context.Context, sessionID entity.SessionID, cfg port.SessionLogConfig) (zerolog.Logger, func(), error) {
2546- ret := _mock.Called(ctx, sessionID, cfg)
2547-
2548- if len(ret) == 0 {
2549- panic("no return value specified for CreateLogger")
2550- }
2551-
2552- var r0 zerolog.Logger
2553- var r1 func()
2554- var r2 error
2555- if returnFunc, ok := ret.Get(0).(func(context.Context, entity.SessionID, port.SessionLogConfig) (zerolog.Logger, func(), error)); ok {
2556- return returnFunc(ctx, sessionID, cfg)
2557- }
2558- if returnFunc, ok := ret.Get(0).(func(context.Context, entity.SessionID, port.SessionLogConfig) zerolog.Logger); ok {
2559- r0 = returnFunc(ctx, sessionID, cfg)
2560- } else {
2561- r0 = ret.Get(0).(zerolog.Logger)
2562- }
2563- if returnFunc, ok := ret.Get(1).(func(context.Context, entity.SessionID, port.SessionLogConfig) func()); ok {
2564- r1 = returnFunc(ctx, sessionID, cfg)
2565- } else {
2566- if ret.Get(1) != nil {
2567- r1 = ret.Get(1).(func())
2568- }
2569- }
2570- if returnFunc, ok := ret.Get(2).(func(context.Context, entity.SessionID, port.SessionLogConfig) error); ok {
2571- r2 = returnFunc(ctx, sessionID, cfg)
2572- } else {
2573- r2 = ret.Error(2)
2574- }
2575- return r0, r1, r2
2443+// GetFaviconAsync provides a mock function for the type MockFaviconDatabase
2444+func (_mock *MockFaviconDatabase) GetFaviconAsync(pageURL string, callback func(port.Texture)) {
2445+ _mock.Called(pageURL, callback)
2446+ return
25762447 }
25772448
2578-// MockSessionLogger_CreateLogger_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateLogger'
2579-type MockSessionLogger_CreateLogger_Call struct {
2449+// MockFaviconDatabase_GetFaviconAsync_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFaviconAsync'
2450+type MockFaviconDatabase_GetFaviconAsync_Call struct {
25802451 *mock.Call
25812452 }
25822453
2583-// CreateLogger is a helper method to define mock.On call
2584-// - ctx context.Context
2585-// - sessionID entity.SessionID
2586-// - cfg port.SessionLogConfig
2587-func (_e *MockSessionLogger_Expecter) CreateLogger(ctx interface{}, sessionID interface{}, cfg interface{}) *MockSessionLogger_CreateLogger_Call {
2588- return &MockSessionLogger_CreateLogger_Call{Call: _e.mock.On("CreateLogger", ctx, sessionID, cfg)}
2454+// GetFaviconAsync is a helper method to define mock.On call
2455+// - pageURL string
2456+// - callback func(port.Texture)
2457+func (_e *MockFaviconDatabase_Expecter) GetFaviconAsync(pageURL interface{}, callback interface{}) *MockFaviconDatabase_GetFaviconAsync_Call {
2458+ return &MockFaviconDatabase_GetFaviconAsync_Call{Call: _e.mock.On("GetFaviconAsync", pageURL, callback)}
25892459 }
25902460
2591-func (_c *MockSessionLogger_CreateLogger_Call) Run(run func(ctx context.Context, sessionID entity.SessionID, cfg port.SessionLogConfig)) *MockSessionLogger_CreateLogger_Call {
2461+func (_c *MockFaviconDatabase_GetFaviconAsync_Call) Run(run func(pageURL string, callback func(port.Texture))) *MockFaviconDatabase_GetFaviconAsync_Call {
25922462 _c.Call.Run(func(args mock.Arguments) {
2593- var arg0 context.Context
2463+ var arg0 string
25942464 if args[0] != nil {
2595- arg0 = args[0].(context.Context)
2465+ arg0 = args[0].(string)
25962466 }
2597- var arg1 entity.SessionID
2467+ var arg1 func(port.Texture)
25982468 if args[1] != nil {
2599- arg1 = args[1].(entity.SessionID)
2600- }
2601- var arg2 port.SessionLogConfig
2602- if args[2] != nil {
2603- arg2 = args[2].(port.SessionLogConfig)
2469+ arg1 = args[1].(func(port.Texture))
26042470 }
26052471 run(
26062472 arg0,
26072473 arg1,
2608- arg2,
26092474 )
26102475 })
26112476 return _c
26122477 }
26132478
2614-func (_c *MockSessionLogger_CreateLogger_Call) Return(logger zerolog.Logger, fn func(), err error) *MockSessionLogger_CreateLogger_Call {
2615- _c.Call.Return(logger, fn, err)
2479+func (_c *MockFaviconDatabase_GetFaviconAsync_Call) Return() *MockFaviconDatabase_GetFaviconAsync_Call {
2480+ _c.Call.Return()
26162481 return _c
26172482 }
26182483
2619-func (_c *MockSessionLogger_CreateLogger_Call) RunAndReturn(run func(ctx context.Context, sessionID entity.SessionID, cfg port.SessionLogConfig) (zerolog.Logger, func(), error)) *MockSessionLogger_CreateLogger_Call {
2620- _c.Call.Return(run)
2484+func (_c *MockFaviconDatabase_GetFaviconAsync_Call) RunAndReturn(run func(pageURL string, callback func(port.Texture))) *MockFaviconDatabase_GetFaviconAsync_Call {
2485+ _c.Run(run)
26212486 return _c
26222487 }
26232488
2624-// NewMockTabListProvider creates a new instance of MockTabListProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
2489+// NewMockFontDetector creates a new instance of MockFontDetector. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
26252490 // The first argument is typically a *testing.T value.
2626-func NewMockTabListProvider(t interface {
2491+func NewMockFontDetector(t interface {
26272492 mock.TestingT
26282493 Cleanup(func())
2629-}) *MockTabListProvider {
2630- mock := &MockTabListProvider{}
2494+}) *MockFontDetector {
2495+ mock := &MockFontDetector{}
26312496 mock.Mock.Test(t)
26322497
26332498 t.Cleanup(func() { mock.AssertExpectations(t) })
@@ -2635,194 +2500,202 @@ func NewMockTabListProvider(t interface {
26352500 return mock
26362501 }
26372502
2638-// MockTabListProvider is an autogenerated mock type for the TabListProvider type
2639-type MockTabListProvider struct {
2503+// MockFontDetector is an autogenerated mock type for the FontDetector type
2504+type MockFontDetector struct {
26402505 mock.Mock
26412506 }
26422507
2643-type MockTabListProvider_Expecter struct {
2508+type MockFontDetector_Expecter struct {
26442509 mock *mock.Mock
26452510 }
26462511
2647-func (_m *MockTabListProvider) EXPECT() *MockTabListProvider_Expecter {
2648- return &MockTabListProvider_Expecter{mock: &_m.Mock}
2512+func (_m *MockFontDetector) EXPECT() *MockFontDetector_Expecter {
2513+ return &MockFontDetector_Expecter{mock: &_m.Mock}
26492514 }
26502515
2651-// GetSessionID provides a mock function for the type MockTabListProvider
2652-func (_mock *MockTabListProvider) GetSessionID() entity.SessionID {
2653- ret := _mock.Called()
2516+// GetAvailableFonts provides a mock function for the type MockFontDetector
2517+func (_mock *MockFontDetector) GetAvailableFonts(ctx context.Context) ([]string, error) {
2518+ ret := _mock.Called(ctx)
26542519
26552520 if len(ret) == 0 {
2656- panic("no return value specified for GetSessionID")
2521+ panic("no return value specified for GetAvailableFonts")
26572522 }
26582523
2659- var r0 entity.SessionID
2660- if returnFunc, ok := ret.Get(0).(func() entity.SessionID); ok {
2661- r0 = returnFunc()
2524+ var r0 []string
2525+ var r1 error
2526+ if returnFunc, ok := ret.Get(0).(func(context.Context) ([]string, error)); ok {
2527+ return returnFunc(ctx)
2528+ }
2529+ if returnFunc, ok := ret.Get(0).(func(context.Context) []string); ok {
2530+ r0 = returnFunc(ctx)
26622531 } else {
2663- r0 = ret.Get(0).(entity.SessionID)
2532+ if ret.Get(0) != nil {
2533+ r0 = ret.Get(0).([]string)
2534+ }
26642535 }
2665- return r0
2536+ if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
2537+ r1 = returnFunc(ctx)
2538+ } else {
2539+ r1 = ret.Error(1)
2540+ }
2541+ return r0, r1
26662542 }
26672543
2668-// MockTabListProvider_GetSessionID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSessionID'
2669-type MockTabListProvider_GetSessionID_Call struct {
2544+// MockFontDetector_GetAvailableFonts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAvailableFonts'
2545+type MockFontDetector_GetAvailableFonts_Call struct {
26702546 *mock.Call
26712547 }
26722548
2673-// GetSessionID is a helper method to define mock.On call
2674-func (_e *MockTabListProvider_Expecter) GetSessionID() *MockTabListProvider_GetSessionID_Call {
2675- return &MockTabListProvider_GetSessionID_Call{Call: _e.mock.On("GetSessionID")}
2549+// GetAvailableFonts is a helper method to define mock.On call
2550+// - ctx context.Context
2551+func (_e *MockFontDetector_Expecter) GetAvailableFonts(ctx interface{}) *MockFontDetector_GetAvailableFonts_Call {
2552+ return &MockFontDetector_GetAvailableFonts_Call{Call: _e.mock.On("GetAvailableFonts", ctx)}
26762553 }
26772554
2678-func (_c *MockTabListProvider_GetSessionID_Call) Run(run func()) *MockTabListProvider_GetSessionID_Call {
2555+func (_c *MockFontDetector_GetAvailableFonts_Call) Run(run func(ctx context.Context)) *MockFontDetector_GetAvailableFonts_Call {
26792556 _c.Call.Run(func(args mock.Arguments) {
2680- run()
2557+ var arg0 context.Context
2558+ if args[0] != nil {
2559+ arg0 = args[0].(context.Context)
2560+ }
2561+ run(
2562+ arg0,
2563+ )
26812564 })
26822565 return _c
26832566 }
26842567
2685-func (_c *MockTabListProvider_GetSessionID_Call) Return(sessionID entity.SessionID) *MockTabListProvider_GetSessionID_Call {
2686- _c.Call.Return(sessionID)
2568+func (_c *MockFontDetector_GetAvailableFonts_Call) Return(strings []string, err error) *MockFontDetector_GetAvailableFonts_Call {
2569+ _c.Call.Return(strings, err)
26872570 return _c
26882571 }
26892572
2690-func (_c *MockTabListProvider_GetSessionID_Call) RunAndReturn(run func() entity.SessionID) *MockTabListProvider_GetSessionID_Call {
2573+func (_c *MockFontDetector_GetAvailableFonts_Call) RunAndReturn(run func(ctx context.Context) ([]string, error)) *MockFontDetector_GetAvailableFonts_Call {
26912574 _c.Call.Return(run)
26922575 return _c
26932576 }
26942577
2695-// GetTabList provides a mock function for the type MockTabListProvider
2696-func (_mock *MockTabListProvider) GetTabList() *entity.TabList {
2697- ret := _mock.Called()
2578+// IsAvailable provides a mock function for the type MockFontDetector
2579+func (_mock *MockFontDetector) IsAvailable(ctx context.Context) bool {
2580+ ret := _mock.Called(ctx)
26982581
26992582 if len(ret) == 0 {
2700- panic("no return value specified for GetTabList")
2583+ panic("no return value specified for IsAvailable")
27012584 }
27022585
2703- var r0 *entity.TabList
2704- if returnFunc, ok := ret.Get(0).(func() *entity.TabList); ok {
2705- r0 = returnFunc()
2586+ var r0 bool
2587+ if returnFunc, ok := ret.Get(0).(func(context.Context) bool); ok {
2588+ r0 = returnFunc(ctx)
27062589 } else {
2707- if ret.Get(0) != nil {
2708- r0 = ret.Get(0).(*entity.TabList)
2709- }
2590+ r0 = ret.Get(0).(bool)
27102591 }
27112592 return r0
27122593 }
27132594
2714-// MockTabListProvider_GetTabList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTabList'
2715-type MockTabListProvider_GetTabList_Call struct {
2595+// MockFontDetector_IsAvailable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsAvailable'
2596+type MockFontDetector_IsAvailable_Call struct {
27162597 *mock.Call
27172598 }
27182599
2719-// GetTabList is a helper method to define mock.On call
2720-func (_e *MockTabListProvider_Expecter) GetTabList() *MockTabListProvider_GetTabList_Call {
2721- return &MockTabListProvider_GetTabList_Call{Call: _e.mock.On("GetTabList")}
2600+// IsAvailable is a helper method to define mock.On call
2601+// - ctx context.Context
2602+func (_e *MockFontDetector_Expecter) IsAvailable(ctx interface{}) *MockFontDetector_IsAvailable_Call {
2603+ return &MockFontDetector_IsAvailable_Call{Call: _e.mock.On("IsAvailable", ctx)}
27222604 }
27232605
2724-func (_c *MockTabListProvider_GetTabList_Call) Run(run func()) *MockTabListProvider_GetTabList_Call {
2606+func (_c *MockFontDetector_IsAvailable_Call) Run(run func(ctx context.Context)) *MockFontDetector_IsAvailable_Call {
27252607 _c.Call.Run(func(args mock.Arguments) {
2726- run()
2608+ var arg0 context.Context
2609+ if args[0] != nil {
2610+ arg0 = args[0].(context.Context)
2611+ }
2612+ run(
2613+ arg0,
2614+ )
27272615 })
27282616 return _c
27292617 }
27302618
2731-func (_c *MockTabListProvider_GetTabList_Call) Return(tabList *entity.TabList) *MockTabListProvider_GetTabList_Call {
2732- _c.Call.Return(tabList)
2619+func (_c *MockFontDetector_IsAvailable_Call) Return(b bool) *MockFontDetector_IsAvailable_Call {
2620+ _c.Call.Return(b)
27332621 return _c
27342622 }
27352623
2736-func (_c *MockTabListProvider_GetTabList_Call) RunAndReturn(run func() *entity.TabList) *MockTabListProvider_GetTabList_Call {
2624+func (_c *MockFontDetector_IsAvailable_Call) RunAndReturn(run func(ctx context.Context) bool) *MockFontDetector_IsAvailable_Call {
27372625 _c.Call.Return(run)
27382626 return _c
27392627 }
27402628
2741-// NewMockSessionSpawner creates a new instance of MockSessionSpawner. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
2742-// The first argument is typically a *testing.T value.
2743-func NewMockSessionSpawner(t interface {
2744- mock.TestingT
2745- Cleanup(func())
2746-}) *MockSessionSpawner {
2747- mock := &MockSessionSpawner{}
2748- mock.Mock.Test(t)
2749-
2750- t.Cleanup(func() { mock.AssertExpectations(t) })
2751-
2752- return mock
2753-}
2754-
2755-// MockSessionSpawner is an autogenerated mock type for the SessionSpawner type
2756-type MockSessionSpawner struct {
2757- mock.Mock
2758-}
2759-
2760-type MockSessionSpawner_Expecter struct {
2761- mock *mock.Mock
2762-}
2763-
2764-func (_m *MockSessionSpawner) EXPECT() *MockSessionSpawner_Expecter {
2765- return &MockSessionSpawner_Expecter{mock: &_m.Mock}
2766-}
2767-
2768-// SpawnWithSession provides a mock function for the type MockSessionSpawner
2769-func (_mock *MockSessionSpawner) SpawnWithSession(sessionID entity.SessionID) error {
2770- ret := _mock.Called(sessionID)
2629+// SelectBestFont provides a mock function for the type MockFontDetector
2630+func (_mock *MockFontDetector) SelectBestFont(ctx context.Context, category port.FontCategory, fallbackChain []string) string {
2631+ ret := _mock.Called(ctx, category, fallbackChain)
27712632
27722633 if len(ret) == 0 {
2773- panic("no return value specified for SpawnWithSession")
2634+ panic("no return value specified for SelectBestFont")
27742635 }
27752636
2776- var r0 error
2777- if returnFunc, ok := ret.Get(0).(func(entity.SessionID) error); ok {
2778- r0 = returnFunc(sessionID)
2637+ var r0 string
2638+ if returnFunc, ok := ret.Get(0).(func(context.Context, port.FontCategory, []string) string); ok {
2639+ r0 = returnFunc(ctx, category, fallbackChain)
27792640 } else {
2780- r0 = ret.Error(0)
2641+ r0 = ret.Get(0).(string)
27812642 }
27822643 return r0
27832644 }
27842645
2785-// MockSessionSpawner_SpawnWithSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SpawnWithSession'
2786-type MockSessionSpawner_SpawnWithSession_Call struct {
2646+// MockFontDetector_SelectBestFont_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SelectBestFont'
2647+type MockFontDetector_SelectBestFont_Call struct {
27872648 *mock.Call
27882649 }
27892650
2790-// SpawnWithSession is a helper method to define mock.On call
2791-// - sessionID entity.SessionID
2792-func (_e *MockSessionSpawner_Expecter) SpawnWithSession(sessionID interface{}) *MockSessionSpawner_SpawnWithSession_Call {
2793- return &MockSessionSpawner_SpawnWithSession_Call{Call: _e.mock.On("SpawnWithSession", sessionID)}
2651+// SelectBestFont is a helper method to define mock.On call
2652+// - ctx context.Context
2653+// - category port.FontCategory
2654+// - fallbackChain []string
2655+func (_e *MockFontDetector_Expecter) SelectBestFont(ctx interface{}, category interface{}, fallbackChain interface{}) *MockFontDetector_SelectBestFont_Call {
2656+ return &MockFontDetector_SelectBestFont_Call{Call: _e.mock.On("SelectBestFont", ctx, category, fallbackChain)}
27942657 }
27952658
2796-func (_c *MockSessionSpawner_SpawnWithSession_Call) Run(run func(sessionID entity.SessionID)) *MockSessionSpawner_SpawnWithSession_Call {
2659+func (_c *MockFontDetector_SelectBestFont_Call) Run(run func(ctx context.Context, category port.FontCategory, fallbackChain []string)) *MockFontDetector_SelectBestFont_Call {
27972660 _c.Call.Run(func(args mock.Arguments) {
2798- var arg0 entity.SessionID
2661+ var arg0 context.Context
27992662 if args[0] != nil {
2800- arg0 = args[0].(entity.SessionID)
2663+ arg0 = args[0].(context.Context)
2664+ }
2665+ var arg1 port.FontCategory
2666+ if args[1] != nil {
2667+ arg1 = args[1].(port.FontCategory)
2668+ }
2669+ var arg2 []string
2670+ if args[2] != nil {
2671+ arg2 = args[2].([]string)
28012672 }
28022673 run(
28032674 arg0,
2675+ arg1,
2676+ arg2,
28042677 )
28052678 })
28062679 return _c
28072680 }
28082681
2809-func (_c *MockSessionSpawner_SpawnWithSession_Call) Return(err error) *MockSessionSpawner_SpawnWithSession_Call {
2810- _c.Call.Return(err)
2682+func (_c *MockFontDetector_SelectBestFont_Call) Return(s string) *MockFontDetector_SelectBestFont_Call {
2683+ _c.Call.Return(s)
28112684 return _c
28122685 }
28132686
2814-func (_c *MockSessionSpawner_SpawnWithSession_Call) RunAndReturn(run func(sessionID entity.SessionID) error) *MockSessionSpawner_SpawnWithSession_Call {
2687+func (_c *MockFontDetector_SelectBestFont_Call) RunAndReturn(run func(ctx context.Context, category port.FontCategory, fallbackChain []string) string) *MockFontDetector_SelectBestFont_Call {
28152688 _c.Call.Return(run)
28162689 return _c
28172690 }
28182691
2819-// NewMockTextInputTarget creates a new instance of MockTextInputTarget. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
2692+// NewMockHardwareSurveyor creates a new instance of MockHardwareSurveyor. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
28202693 // The first argument is typically a *testing.T value.
2821-func NewMockTextInputTarget(t interface {
2694+func NewMockHardwareSurveyor(t interface {
28222695 mock.TestingT
28232696 Cleanup(func())
2824-}) *MockTextInputTarget {
2825- mock := &MockTextInputTarget{}
2697+}) *MockHardwareSurveyor {
2698+ mock := &MockHardwareSurveyor{}
28262699 mock.Mock.Test(t)
28272700
28282701 t.Cleanup(func() { mock.AssertExpectations(t) })
@@ -2830,106 +2703,171 @@ func NewMockTextInputTarget(t interface {
28302703 return mock
28312704 }
28322705
2833-// MockTextInputTarget is an autogenerated mock type for the TextInputTarget type
2834-type MockTextInputTarget struct {
2706+// MockHardwareSurveyor is an autogenerated mock type for the HardwareSurveyor type
2707+type MockHardwareSurveyor struct {
28352708 mock.Mock
28362709 }
28372710
2838-type MockTextInputTarget_Expecter struct {
2711+type MockHardwareSurveyor_Expecter struct {
28392712 mock *mock.Mock
28402713 }
28412714
2842-func (_m *MockTextInputTarget) EXPECT() *MockTextInputTarget_Expecter {
2843- return &MockTextInputTarget_Expecter{mock: &_m.Mock}
2715+func (_m *MockHardwareSurveyor) EXPECT() *MockHardwareSurveyor_Expecter {
2716+ return &MockHardwareSurveyor_Expecter{mock: &_m.Mock}
28442717 }
28452718
2846-// DeleteBeforeCursor provides a mock function for the type MockTextInputTarget
2847-func (_mock *MockTextInputTarget) DeleteBeforeCursor(ctx context.Context, n int) error {
2848- ret := _mock.Called(ctx, n)
2719+// Survey provides a mock function for the type MockHardwareSurveyor
2720+func (_mock *MockHardwareSurveyor) Survey(ctx context.Context) port.HardwareInfo {
2721+ ret := _mock.Called(ctx)
28492722
28502723 if len(ret) == 0 {
2851- panic("no return value specified for DeleteBeforeCursor")
2724+ panic("no return value specified for Survey")
28522725 }
28532726
2854- var r0 error
2855- if returnFunc, ok := ret.Get(0).(func(context.Context, int) error); ok {
2856- r0 = returnFunc(ctx, n)
2727+ var r0 port.HardwareInfo
2728+ if returnFunc, ok := ret.Get(0).(func(context.Context) port.HardwareInfo); ok {
2729+ r0 = returnFunc(ctx)
28572730 } else {
2858- r0 = ret.Error(0)
2731+ r0 = ret.Get(0).(port.HardwareInfo)
28592732 }
28602733 return r0
28612734 }
28622735
2863-// MockTextInputTarget_DeleteBeforeCursor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteBeforeCursor'
2864-type MockTextInputTarget_DeleteBeforeCursor_Call struct {
2736+// MockHardwareSurveyor_Survey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Survey'
2737+type MockHardwareSurveyor_Survey_Call struct {
28652738 *mock.Call
28662739 }
28672740
2868-// DeleteBeforeCursor is a helper method to define mock.On call
2741+// Survey is a helper method to define mock.On call
28692742 // - ctx context.Context
2870-// - n int
2871-func (_e *MockTextInputTarget_Expecter) DeleteBeforeCursor(ctx interface{}, n interface{}) *MockTextInputTarget_DeleteBeforeCursor_Call {
2872- return &MockTextInputTarget_DeleteBeforeCursor_Call{Call: _e.mock.On("DeleteBeforeCursor", ctx, n)}
2743+func (_e *MockHardwareSurveyor_Expecter) Survey(ctx interface{}) *MockHardwareSurveyor_Survey_Call {
2744+ return &MockHardwareSurveyor_Survey_Call{Call: _e.mock.On("Survey", ctx)}
28732745 }
28742746
2875-func (_c *MockTextInputTarget_DeleteBeforeCursor_Call) Run(run func(ctx context.Context, n int)) *MockTextInputTarget_DeleteBeforeCursor_Call {
2747+func (_c *MockHardwareSurveyor_Survey_Call) Run(run func(ctx context.Context)) *MockHardwareSurveyor_Survey_Call {
28762748 _c.Call.Run(func(args mock.Arguments) {
28772749 var arg0 context.Context
28782750 if args[0] != nil {
28792751 arg0 = args[0].(context.Context)
28802752 }
2881- var arg1 int
2882- if args[1] != nil {
2883- arg1 = args[1].(int)
2884- }
28852753 run(
28862754 arg0,
2887- arg1,
28882755 )
28892756 })
28902757 return _c
28912758 }
28922759
2893-func (_c *MockTextInputTarget_DeleteBeforeCursor_Call) Return(err error) *MockTextInputTarget_DeleteBeforeCursor_Call {
2760+func (_c *MockHardwareSurveyor_Survey_Call) Return(hardwareInfo port.HardwareInfo) *MockHardwareSurveyor_Survey_Call {
2761+ _c.Call.Return(hardwareInfo)
2762+ return _c
2763+}
2764+
2765+func (_c *MockHardwareSurveyor_Survey_Call) RunAndReturn(run func(ctx context.Context) port.HardwareInfo) *MockHardwareSurveyor_Survey_Call {
2766+ _c.Call.Return(run)
2767+ return _c
2768+}
2769+
2770+// NewMockIdleInhibitor creates a new instance of MockIdleInhibitor. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
2771+// The first argument is typically a *testing.T value.
2772+func NewMockIdleInhibitor(t interface {
2773+ mock.TestingT
2774+ Cleanup(func())
2775+}) *MockIdleInhibitor {
2776+ mock := &MockIdleInhibitor{}
2777+ mock.Mock.Test(t)
2778+
2779+ t.Cleanup(func() { mock.AssertExpectations(t) })
2780+
2781+ return mock
2782+}
2783+
2784+// MockIdleInhibitor is an autogenerated mock type for the IdleInhibitor type
2785+type MockIdleInhibitor struct {
2786+ mock.Mock
2787+}
2788+
2789+type MockIdleInhibitor_Expecter struct {
2790+ mock *mock.Mock
2791+}
2792+
2793+func (_m *MockIdleInhibitor) EXPECT() *MockIdleInhibitor_Expecter {
2794+ return &MockIdleInhibitor_Expecter{mock: &_m.Mock}
2795+}
2796+
2797+// Close provides a mock function for the type MockIdleInhibitor
2798+func (_mock *MockIdleInhibitor) Close() error {
2799+ ret := _mock.Called()
2800+
2801+ if len(ret) == 0 {
2802+ panic("no return value specified for Close")
2803+ }
2804+
2805+ var r0 error
2806+ if returnFunc, ok := ret.Get(0).(func() error); ok {
2807+ r0 = returnFunc()
2808+ } else {
2809+ r0 = ret.Error(0)
2810+ }
2811+ return r0
2812+}
2813+
2814+// MockIdleInhibitor_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
2815+type MockIdleInhibitor_Close_Call struct {
2816+ *mock.Call
2817+}
2818+
2819+// Close is a helper method to define mock.On call
2820+func (_e *MockIdleInhibitor_Expecter) Close() *MockIdleInhibitor_Close_Call {
2821+ return &MockIdleInhibitor_Close_Call{Call: _e.mock.On("Close")}
2822+}
2823+
2824+func (_c *MockIdleInhibitor_Close_Call) Run(run func()) *MockIdleInhibitor_Close_Call {
2825+ _c.Call.Run(func(args mock.Arguments) {
2826+ run()
2827+ })
2828+ return _c
2829+}
2830+
2831+func (_c *MockIdleInhibitor_Close_Call) Return(err error) *MockIdleInhibitor_Close_Call {
28942832 _c.Call.Return(err)
28952833 return _c
28962834 }
28972835
2898-func (_c *MockTextInputTarget_DeleteBeforeCursor_Call) RunAndReturn(run func(ctx context.Context, n int) error) *MockTextInputTarget_DeleteBeforeCursor_Call {
2836+func (_c *MockIdleInhibitor_Close_Call) RunAndReturn(run func() error) *MockIdleInhibitor_Close_Call {
28992837 _c.Call.Return(run)
29002838 return _c
29012839 }
29022840
2903-// InsertText provides a mock function for the type MockTextInputTarget
2904-func (_mock *MockTextInputTarget) InsertText(ctx context.Context, text string) error {
2905- ret := _mock.Called(ctx, text)
2841+// Inhibit provides a mock function for the type MockIdleInhibitor
2842+func (_mock *MockIdleInhibitor) Inhibit(ctx context.Context, reason string) error {
2843+ ret := _mock.Called(ctx, reason)
29062844
29072845 if len(ret) == 0 {
2908- panic("no return value specified for InsertText")
2846+ panic("no return value specified for Inhibit")
29092847 }
29102848
29112849 var r0 error
29122850 if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok {
2913- r0 = returnFunc(ctx, text)
2851+ r0 = returnFunc(ctx, reason)
29142852 } else {
29152853 r0 = ret.Error(0)
29162854 }
29172855 return r0
29182856 }
29192857
2920-// MockTextInputTarget_InsertText_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InsertText'
2921-type MockTextInputTarget_InsertText_Call struct {
2858+// MockIdleInhibitor_Inhibit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Inhibit'
2859+type MockIdleInhibitor_Inhibit_Call struct {
29222860 *mock.Call
29232861 }
29242862
2925-// InsertText is a helper method to define mock.On call
2863+// Inhibit is a helper method to define mock.On call
29262864 // - ctx context.Context
2927-// - text string
2928-func (_e *MockTextInputTarget_Expecter) InsertText(ctx interface{}, text interface{}) *MockTextInputTarget_InsertText_Call {
2929- return &MockTextInputTarget_InsertText_Call{Call: _e.mock.On("InsertText", ctx, text)}
2865+// - reason string
2866+func (_e *MockIdleInhibitor_Expecter) Inhibit(ctx interface{}, reason interface{}) *MockIdleInhibitor_Inhibit_Call {
2867+ return &MockIdleInhibitor_Inhibit_Call{Call: _e.mock.On("Inhibit", ctx, reason)}
29302868 }
29312869
2932-func (_c *MockTextInputTarget_InsertText_Call) Run(run func(ctx context.Context, text string)) *MockTextInputTarget_InsertText_Call {
2870+func (_c *MockIdleInhibitor_Inhibit_Call) Run(run func(ctx context.Context, reason string)) *MockIdleInhibitor_Inhibit_Call {
29332871 _c.Call.Run(func(args mock.Arguments) {
29342872 var arg0 context.Context
29352873 if args[0] != nil {
@@ -2947,111 +2885,93 @@ func (_c *MockTextInputTarget_InsertText_Call) Run(run func(ctx context.Context,
29472885 return _c
29482886 }
29492887
2950-func (_c *MockTextInputTarget_InsertText_Call) Return(err error) *MockTextInputTarget_InsertText_Call {
2888+func (_c *MockIdleInhibitor_Inhibit_Call) Return(err error) *MockIdleInhibitor_Inhibit_Call {
29512889 _c.Call.Return(err)
29522890 return _c
29532891 }
29542892
2955-func (_c *MockTextInputTarget_InsertText_Call) RunAndReturn(run func(ctx context.Context, text string) error) *MockTextInputTarget_InsertText_Call {
2893+func (_c *MockIdleInhibitor_Inhibit_Call) RunAndReturn(run func(ctx context.Context, reason string) error) *MockIdleInhibitor_Inhibit_Call {
29562894 _c.Call.Return(run)
29572895 return _c
29582896 }
29592897
2960-// NewMockFocusedInputProvider creates a new instance of MockFocusedInputProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
2961-// The first argument is typically a *testing.T value.
2962-func NewMockFocusedInputProvider(t interface {
2963- mock.TestingT
2964- Cleanup(func())
2965-}) *MockFocusedInputProvider {
2966- mock := &MockFocusedInputProvider{}
2967- mock.Mock.Test(t)
2968-
2969- t.Cleanup(func() { mock.AssertExpectations(t) })
2970-
2971- return mock
2972-}
2973-
2974-// MockFocusedInputProvider is an autogenerated mock type for the FocusedInputProvider type
2975-type MockFocusedInputProvider struct {
2976- mock.Mock
2977-}
2978-
2979-type MockFocusedInputProvider_Expecter struct {
2980- mock *mock.Mock
2981-}
2982-
2983-func (_m *MockFocusedInputProvider) EXPECT() *MockFocusedInputProvider_Expecter {
2984- return &MockFocusedInputProvider_Expecter{mock: &_m.Mock}
2985-}
2986-
2987-// GetFocusedInput provides a mock function for the type MockFocusedInputProvider
2988-func (_mock *MockFocusedInputProvider) GetFocusedInput() port.TextInputTarget {
2898+// IsInhibited provides a mock function for the type MockIdleInhibitor
2899+func (_mock *MockIdleInhibitor) IsInhibited() bool {
29892900 ret := _mock.Called()
29902901
29912902 if len(ret) == 0 {
2992- panic("no return value specified for GetFocusedInput")
2903+ panic("no return value specified for IsInhibited")
29932904 }
29942905
2995- var r0 port.TextInputTarget
2996- if returnFunc, ok := ret.Get(0).(func() port.TextInputTarget); ok {
2906+ var r0 bool
2907+ if returnFunc, ok := ret.Get(0).(func() bool); ok {
29972908 r0 = returnFunc()
29982909 } else {
2999- if ret.Get(0) != nil {
3000- r0 = ret.Get(0).(port.TextInputTarget)
3001- }
2910+ r0 = ret.Get(0).(bool)
30022911 }
30032912 return r0
30042913 }
30052914
3006-// MockFocusedInputProvider_GetFocusedInput_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFocusedInput'
3007-type MockFocusedInputProvider_GetFocusedInput_Call struct {
2915+// MockIdleInhibitor_IsInhibited_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsInhibited'
2916+type MockIdleInhibitor_IsInhibited_Call struct {
30082917 *mock.Call
30092918 }
30102919
3011-// GetFocusedInput is a helper method to define mock.On call
3012-func (_e *MockFocusedInputProvider_Expecter) GetFocusedInput() *MockFocusedInputProvider_GetFocusedInput_Call {
3013- return &MockFocusedInputProvider_GetFocusedInput_Call{Call: _e.mock.On("GetFocusedInput")}
2920+// IsInhibited is a helper method to define mock.On call
2921+func (_e *MockIdleInhibitor_Expecter) IsInhibited() *MockIdleInhibitor_IsInhibited_Call {
2922+ return &MockIdleInhibitor_IsInhibited_Call{Call: _e.mock.On("IsInhibited")}
30142923 }
30152924
3016-func (_c *MockFocusedInputProvider_GetFocusedInput_Call) Run(run func()) *MockFocusedInputProvider_GetFocusedInput_Call {
2925+func (_c *MockIdleInhibitor_IsInhibited_Call) Run(run func()) *MockIdleInhibitor_IsInhibited_Call {
30172926 _c.Call.Run(func(args mock.Arguments) {
30182927 run()
30192928 })
30202929 return _c
30212930 }
30222931
3023-func (_c *MockFocusedInputProvider_GetFocusedInput_Call) Return(textInputTarget port.TextInputTarget) *MockFocusedInputProvider_GetFocusedInput_Call {
3024- _c.Call.Return(textInputTarget)
2932+func (_c *MockIdleInhibitor_IsInhibited_Call) Return(b bool) *MockIdleInhibitor_IsInhibited_Call {
2933+ _c.Call.Return(b)
30252934 return _c
30262935 }
30272936
3028-func (_c *MockFocusedInputProvider_GetFocusedInput_Call) RunAndReturn(run func() port.TextInputTarget) *MockFocusedInputProvider_GetFocusedInput_Call {
2937+func (_c *MockIdleInhibitor_IsInhibited_Call) RunAndReturn(run func() bool) *MockIdleInhibitor_IsInhibited_Call {
30292938 _c.Call.Return(run)
30302939 return _c
30312940 }
30322941
3033-// SetFocusedInput provides a mock function for the type MockFocusedInputProvider
3034-func (_mock *MockFocusedInputProvider) SetFocusedInput(target port.TextInputTarget) {
3035- _mock.Called(target)
3036- return
2942+// Uninhibit provides a mock function for the type MockIdleInhibitor
2943+func (_mock *MockIdleInhibitor) Uninhibit(ctx context.Context) error {
2944+ ret := _mock.Called(ctx)
2945+
2946+ if len(ret) == 0 {
2947+ panic("no return value specified for Uninhibit")
2948+ }
2949+
2950+ var r0 error
2951+ if returnFunc, ok := ret.Get(0).(func(context.Context) error); ok {
2952+ r0 = returnFunc(ctx)
2953+ } else {
2954+ r0 = ret.Error(0)
2955+ }
2956+ return r0
30372957 }
30382958
3039-// MockFocusedInputProvider_SetFocusedInput_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetFocusedInput'
3040-type MockFocusedInputProvider_SetFocusedInput_Call struct {
2959+// MockIdleInhibitor_Uninhibit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Uninhibit'
2960+type MockIdleInhibitor_Uninhibit_Call struct {
30412961 *mock.Call
30422962 }
30432963
3044-// SetFocusedInput is a helper method to define mock.On call
3045-// - target port.TextInputTarget
3046-func (_e *MockFocusedInputProvider_Expecter) SetFocusedInput(target interface{}) *MockFocusedInputProvider_SetFocusedInput_Call {
3047- return &MockFocusedInputProvider_SetFocusedInput_Call{Call: _e.mock.On("SetFocusedInput", target)}
2964+// Uninhibit is a helper method to define mock.On call
2965+// - ctx context.Context
2966+func (_e *MockIdleInhibitor_Expecter) Uninhibit(ctx interface{}) *MockIdleInhibitor_Uninhibit_Call {
2967+ return &MockIdleInhibitor_Uninhibit_Call{Call: _e.mock.On("Uninhibit", ctx)}
30482968 }
30492969
3050-func (_c *MockFocusedInputProvider_SetFocusedInput_Call) Run(run func(target port.TextInputTarget)) *MockFocusedInputProvider_SetFocusedInput_Call {
2970+func (_c *MockIdleInhibitor_Uninhibit_Call) Run(run func(ctx context.Context)) *MockIdleInhibitor_Uninhibit_Call {
30512971 _c.Call.Run(func(args mock.Arguments) {
3052- var arg0 port.TextInputTarget
2972+ var arg0 context.Context
30532973 if args[0] != nil {
3054- arg0 = args[0].(port.TextInputTarget)
2974+ arg0 = args[0].(context.Context)
30552975 }
30562976 run(
30572977 arg0,
@@ -3060,23 +2980,23 @@ func (_c *MockFocusedInputProvider_SetFocusedInput_Call) Run(run func(target por
30602980 return _c
30612981 }
30622982
3063-func (_c *MockFocusedInputProvider_SetFocusedInput_Call) Return() *MockFocusedInputProvider_SetFocusedInput_Call {
3064- _c.Call.Return()
2983+func (_c *MockIdleInhibitor_Uninhibit_Call) Return(err error) *MockIdleInhibitor_Uninhibit_Call {
2984+ _c.Call.Return(err)
30652985 return _c
30662986 }
30672987
3068-func (_c *MockFocusedInputProvider_SetFocusedInput_Call) RunAndReturn(run func(target port.TextInputTarget)) *MockFocusedInputProvider_SetFocusedInput_Call {
3069- _c.Run(run)
2988+func (_c *MockIdleInhibitor_Uninhibit_Call) RunAndReturn(run func(ctx context.Context) error) *MockIdleInhibitor_Uninhibit_Call {
2989+ _c.Call.Return(run)
30702990 return _c
30712991 }
30722992
3073-// NewMockMemoryPressureApplier creates a new instance of MockMemoryPressureApplier. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
2993+// NewMockKeybindingsProvider creates a new instance of MockKeybindingsProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
30742994 // The first argument is typically a *testing.T value.
3075-func NewMockMemoryPressureApplier(t interface {
2995+func NewMockKeybindingsProvider(t interface {
30762996 mock.TestingT
30772997 Cleanup(func())
3078-}) *MockMemoryPressureApplier {
3079- mock := &MockMemoryPressureApplier{}
2998+}) *MockKeybindingsProvider {
2999+ mock := &MockKeybindingsProvider{}
30803000 mock.Mock.Test(t)
30813001
30823002 t.Cleanup(func() { mock.AssertExpectations(t) })
@@ -3084,151 +3004,226 @@ func NewMockMemoryPressureApplier(t interface {
30843004 return mock
30853005 }
30863006
3087-// MockMemoryPressureApplier is an autogenerated mock type for the MemoryPressureApplier type
3088-type MockMemoryPressureApplier struct {
3007+// MockKeybindingsProvider is an autogenerated mock type for the KeybindingsProvider type
3008+type MockKeybindingsProvider struct {
30893009 mock.Mock
30903010 }
30913011
3092-type MockMemoryPressureApplier_Expecter struct {
3012+type MockKeybindingsProvider_Expecter struct {
30933013 mock *mock.Mock
30943014 }
30953015
3096-func (_m *MockMemoryPressureApplier) EXPECT() *MockMemoryPressureApplier_Expecter {
3097- return &MockMemoryPressureApplier_Expecter{mock: &_m.Mock}
3016+func (_m *MockKeybindingsProvider) EXPECT() *MockKeybindingsProvider_Expecter {
3017+ return &MockKeybindingsProvider_Expecter{mock: &_m.Mock}
30983018 }
30993019
3100-// ApplyNetworkProcessSettings provides a mock function for the type MockMemoryPressureApplier
3101-func (_mock *MockMemoryPressureApplier) ApplyNetworkProcessSettings(ctx context.Context, cfg *port.MemoryPressureConfig) error {
3102- ret := _mock.Called(ctx, cfg)
3020+// CheckConflicts provides a mock function for the type MockKeybindingsProvider
3021+func (_mock *MockKeybindingsProvider) CheckConflicts(ctx context.Context, mode string, action string, keys []string) ([]port.KeybindingConflict, error) {
3022+ ret := _mock.Called(ctx, mode, action, keys)
31033023
31043024 if len(ret) == 0 {
3105- panic("no return value specified for ApplyNetworkProcessSettings")
3025+ panic("no return value specified for CheckConflicts")
31063026 }
31073027
3108- var r0 error
3109- if returnFunc, ok := ret.Get(0).(func(context.Context, *port.MemoryPressureConfig) error); ok {
3110- r0 = returnFunc(ctx, cfg)
3111- } else {
3112- r0 = ret.Error(0)
3028+ var r0 []port.KeybindingConflict
3029+ var r1 error
3030+ if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, []string) ([]port.KeybindingConflict, error)); ok {
3031+ return returnFunc(ctx, mode, action, keys)
31133032 }
3114- return r0
3033+ if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, []string) []port.KeybindingConflict); ok {
3034+ r0 = returnFunc(ctx, mode, action, keys)
3035+ } else {
3036+ if ret.Get(0) != nil {
3037+ r0 = ret.Get(0).([]port.KeybindingConflict)
3038+ }
3039+ }
3040+ if returnFunc, ok := ret.Get(1).(func(context.Context, string, string, []string) error); ok {
3041+ r1 = returnFunc(ctx, mode, action, keys)
3042+ } else {
3043+ r1 = ret.Error(1)
3044+ }
3045+ return r0, r1
31153046 }
31163047
3117-// MockMemoryPressureApplier_ApplyNetworkProcessSettings_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ApplyNetworkProcessSettings'
3118-type MockMemoryPressureApplier_ApplyNetworkProcessSettings_Call struct {
3048+// MockKeybindingsProvider_CheckConflicts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckConflicts'
3049+type MockKeybindingsProvider_CheckConflicts_Call struct {
31193050 *mock.Call
31203051 }
31213052
3122-// ApplyNetworkProcessSettings is a helper method to define mock.On call
3053+// CheckConflicts is a helper method to define mock.On call
31233054 // - ctx context.Context
3124-// - cfg *port.MemoryPressureConfig
3125-func (_e *MockMemoryPressureApplier_Expecter) ApplyNetworkProcessSettings(ctx interface{}, cfg interface{}) *MockMemoryPressureApplier_ApplyNetworkProcessSettings_Call {
3126- return &MockMemoryPressureApplier_ApplyNetworkProcessSettings_Call{Call: _e.mock.On("ApplyNetworkProcessSettings", ctx, cfg)}
3055+// - mode string
3056+// - action string
3057+// - keys []string
3058+func (_e *MockKeybindingsProvider_Expecter) CheckConflicts(ctx interface{}, mode interface{}, action interface{}, keys interface{}) *MockKeybindingsProvider_CheckConflicts_Call {
3059+ return &MockKeybindingsProvider_CheckConflicts_Call{Call: _e.mock.On("CheckConflicts", ctx, mode, action, keys)}
31273060 }
31283061
3129-func (_c *MockMemoryPressureApplier_ApplyNetworkProcessSettings_Call) Run(run func(ctx context.Context, cfg *port.MemoryPressureConfig)) *MockMemoryPressureApplier_ApplyNetworkProcessSettings_Call {
3062+func (_c *MockKeybindingsProvider_CheckConflicts_Call) Run(run func(ctx context.Context, mode string, action string, keys []string)) *MockKeybindingsProvider_CheckConflicts_Call {
31303063 _c.Call.Run(func(args mock.Arguments) {
31313064 var arg0 context.Context
31323065 if args[0] != nil {
31333066 arg0 = args[0].(context.Context)
31343067 }
3135- var arg1 *port.MemoryPressureConfig
3068+ var arg1 string
31363069 if args[1] != nil {
3137- arg1 = args[1].(*port.MemoryPressureConfig)
3070+ arg1 = args[1].(string)
3071+ }
3072+ var arg2 string
3073+ if args[2] != nil {
3074+ arg2 = args[2].(string)
3075+ }
3076+ var arg3 []string
3077+ if args[3] != nil {
3078+ arg3 = args[3].([]string)
31383079 }
31393080 run(
31403081 arg0,
31413082 arg1,
3083+ arg2,
3084+ arg3,
31423085 )
31433086 })
31443087 return _c
31453088 }
31463089
3147-func (_c *MockMemoryPressureApplier_ApplyNetworkProcessSettings_Call) Return(err error) *MockMemoryPressureApplier_ApplyNetworkProcessSettings_Call {
3148- _c.Call.Return(err)
3090+func (_c *MockKeybindingsProvider_CheckConflicts_Call) Return(keybindingConflicts []port.KeybindingConflict, err error) *MockKeybindingsProvider_CheckConflicts_Call {
3091+ _c.Call.Return(keybindingConflicts, err)
31493092 return _c
31503093 }
31513094
3152-func (_c *MockMemoryPressureApplier_ApplyNetworkProcessSettings_Call) RunAndReturn(run func(ctx context.Context, cfg *port.MemoryPressureConfig) error) *MockMemoryPressureApplier_ApplyNetworkProcessSettings_Call {
3095+func (_c *MockKeybindingsProvider_CheckConflicts_Call) RunAndReturn(run func(ctx context.Context, mode string, action string, keys []string) ([]port.KeybindingConflict, error)) *MockKeybindingsProvider_CheckConflicts_Call {
31533096 _c.Call.Return(run)
31543097 return _c
31553098 }
31563099
3157-// ApplyWebProcessSettings provides a mock function for the type MockMemoryPressureApplier
3158-func (_mock *MockMemoryPressureApplier) ApplyWebProcessSettings(ctx context.Context, cfg *port.MemoryPressureConfig) (any, error) {
3159- ret := _mock.Called(ctx, cfg)
3100+// GetDefaultKeybindings provides a mock function for the type MockKeybindingsProvider
3101+func (_mock *MockKeybindingsProvider) GetDefaultKeybindings(ctx context.Context) (port.KeybindingsConfig, error) {
3102+ ret := _mock.Called(ctx)
31603103
31613104 if len(ret) == 0 {
3162- panic("no return value specified for ApplyWebProcessSettings")
3105+ panic("no return value specified for GetDefaultKeybindings")
31633106 }
31643107
3165- var r0 any
3108+ var r0 port.KeybindingsConfig
31663109 var r1 error
3167- if returnFunc, ok := ret.Get(0).(func(context.Context, *port.MemoryPressureConfig) (any, error)); ok {
3168- return returnFunc(ctx, cfg)
3110+ if returnFunc, ok := ret.Get(0).(func(context.Context) (port.KeybindingsConfig, error)); ok {
3111+ return returnFunc(ctx)
31693112 }
3170- if returnFunc, ok := ret.Get(0).(func(context.Context, *port.MemoryPressureConfig) any); ok {
3171- r0 = returnFunc(ctx, cfg)
3113+ if returnFunc, ok := ret.Get(0).(func(context.Context) port.KeybindingsConfig); ok {
3114+ r0 = returnFunc(ctx)
31723115 } else {
3173- if ret.Get(0) != nil {
3174- r0 = ret.Get(0).(any)
3175- }
3116+ r0 = ret.Get(0).(port.KeybindingsConfig)
31763117 }
3177- if returnFunc, ok := ret.Get(1).(func(context.Context, *port.MemoryPressureConfig) error); ok {
3178- r1 = returnFunc(ctx, cfg)
3118+ if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
3119+ r1 = returnFunc(ctx)
31793120 } else {
31803121 r1 = ret.Error(1)
31813122 }
31823123 return r0, r1
31833124 }
31843125
3185-// MockMemoryPressureApplier_ApplyWebProcessSettings_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ApplyWebProcessSettings'
3186-type MockMemoryPressureApplier_ApplyWebProcessSettings_Call struct {
3126+// MockKeybindingsProvider_GetDefaultKeybindings_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDefaultKeybindings'
3127+type MockKeybindingsProvider_GetDefaultKeybindings_Call struct {
31873128 *mock.Call
31883129 }
31893130
3190-// ApplyWebProcessSettings is a helper method to define mock.On call
3131+// GetDefaultKeybindings is a helper method to define mock.On call
31913132 // - ctx context.Context
3192-// - cfg *port.MemoryPressureConfig
3193-func (_e *MockMemoryPressureApplier_Expecter) ApplyWebProcessSettings(ctx interface{}, cfg interface{}) *MockMemoryPressureApplier_ApplyWebProcessSettings_Call {
3194- return &MockMemoryPressureApplier_ApplyWebProcessSettings_Call{Call: _e.mock.On("ApplyWebProcessSettings", ctx, cfg)}
3133+func (_e *MockKeybindingsProvider_Expecter) GetDefaultKeybindings(ctx interface{}) *MockKeybindingsProvider_GetDefaultKeybindings_Call {
3134+ return &MockKeybindingsProvider_GetDefaultKeybindings_Call{Call: _e.mock.On("GetDefaultKeybindings", ctx)}
31953135 }
31963136
3197-func (_c *MockMemoryPressureApplier_ApplyWebProcessSettings_Call) Run(run func(ctx context.Context, cfg *port.MemoryPressureConfig)) *MockMemoryPressureApplier_ApplyWebProcessSettings_Call {
3137+func (_c *MockKeybindingsProvider_GetDefaultKeybindings_Call) Run(run func(ctx context.Context)) *MockKeybindingsProvider_GetDefaultKeybindings_Call {
31983138 _c.Call.Run(func(args mock.Arguments) {
31993139 var arg0 context.Context
32003140 if args[0] != nil {
32013141 arg0 = args[0].(context.Context)
32023142 }
3203- var arg1 *port.MemoryPressureConfig
3204- if args[1] != nil {
3205- arg1 = args[1].(*port.MemoryPressureConfig)
3143+ run(
3144+ arg0,
3145+ )
3146+ })
3147+ return _c
3148+}
3149+
3150+func (_c *MockKeybindingsProvider_GetDefaultKeybindings_Call) Return(keybindingsConfig port.KeybindingsConfig, err error) *MockKeybindingsProvider_GetDefaultKeybindings_Call {
3151+ _c.Call.Return(keybindingsConfig, err)
3152+ return _c
3153+}
3154+
3155+func (_c *MockKeybindingsProvider_GetDefaultKeybindings_Call) RunAndReturn(run func(ctx context.Context) (port.KeybindingsConfig, error)) *MockKeybindingsProvider_GetDefaultKeybindings_Call {
3156+ _c.Call.Return(run)
3157+ return _c
3158+}
3159+
3160+// GetKeybindings provides a mock function for the type MockKeybindingsProvider
3161+func (_mock *MockKeybindingsProvider) GetKeybindings(ctx context.Context) (port.KeybindingsConfig, error) {
3162+ ret := _mock.Called(ctx)
3163+
3164+ if len(ret) == 0 {
3165+ panic("no return value specified for GetKeybindings")
3166+ }
3167+
3168+ var r0 port.KeybindingsConfig
3169+ var r1 error
3170+ if returnFunc, ok := ret.Get(0).(func(context.Context) (port.KeybindingsConfig, error)); ok {
3171+ return returnFunc(ctx)
3172+ }
3173+ if returnFunc, ok := ret.Get(0).(func(context.Context) port.KeybindingsConfig); ok {
3174+ r0 = returnFunc(ctx)
3175+ } else {
3176+ r0 = ret.Get(0).(port.KeybindingsConfig)
3177+ }
3178+ if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
3179+ r1 = returnFunc(ctx)
3180+ } else {
3181+ r1 = ret.Error(1)
3182+ }
3183+ return r0, r1
3184+}
3185+
3186+// MockKeybindingsProvider_GetKeybindings_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetKeybindings'
3187+type MockKeybindingsProvider_GetKeybindings_Call struct {
3188+ *mock.Call
3189+}
3190+
3191+// GetKeybindings is a helper method to define mock.On call
3192+// - ctx context.Context
3193+func (_e *MockKeybindingsProvider_Expecter) GetKeybindings(ctx interface{}) *MockKeybindingsProvider_GetKeybindings_Call {
3194+ return &MockKeybindingsProvider_GetKeybindings_Call{Call: _e.mock.On("GetKeybindings", ctx)}
3195+}
3196+
3197+func (_c *MockKeybindingsProvider_GetKeybindings_Call) Run(run func(ctx context.Context)) *MockKeybindingsProvider_GetKeybindings_Call {
3198+ _c.Call.Run(func(args mock.Arguments) {
3199+ var arg0 context.Context
3200+ if args[0] != nil {
3201+ arg0 = args[0].(context.Context)
32063202 }
32073203 run(
32083204 arg0,
3209- arg1,
32103205 )
32113206 })
32123207 return _c
32133208 }
32143209
3215-func (_c *MockMemoryPressureApplier_ApplyWebProcessSettings_Call) Return(v any, err error) *MockMemoryPressureApplier_ApplyWebProcessSettings_Call {
3216- _c.Call.Return(v, err)
3210+func (_c *MockKeybindingsProvider_GetKeybindings_Call) Return(keybindingsConfig port.KeybindingsConfig, err error) *MockKeybindingsProvider_GetKeybindings_Call {
3211+ _c.Call.Return(keybindingsConfig, err)
32173212 return _c
32183213 }
32193214
3220-func (_c *MockMemoryPressureApplier_ApplyWebProcessSettings_Call) RunAndReturn(run func(ctx context.Context, cfg *port.MemoryPressureConfig) (any, error)) *MockMemoryPressureApplier_ApplyWebProcessSettings_Call {
3215+func (_c *MockKeybindingsProvider_GetKeybindings_Call) RunAndReturn(run func(ctx context.Context) (port.KeybindingsConfig, error)) *MockKeybindingsProvider_GetKeybindings_Call {
32213216 _c.Call.Return(run)
32223217 return _c
32233218 }
32243219
3225-// NewMockWebKitContextProvider creates a new instance of MockWebKitContextProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
3220+// NewMockKeybindingsSaver creates a new instance of MockKeybindingsSaver. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
32263221 // The first argument is typically a *testing.T value.
3227-func NewMockWebKitContextProvider(t interface {
3222+func NewMockKeybindingsSaver(t interface {
32283223 mock.TestingT
32293224 Cleanup(func())
3230-}) *MockWebKitContextProvider {
3231- mock := &MockWebKitContextProvider{}
3225+}) *MockKeybindingsSaver {
3226+ mock := &MockKeybindingsSaver{}
32323227 mock.Mock.Test(t)
32333228
32343229 t.Cleanup(func() { mock.AssertExpectations(t) })
@@ -3236,189 +3231,165 @@ func NewMockWebKitContextProvider(t interface {
32363231 return mock
32373232 }
32383233
3239-// MockWebKitContextProvider is an autogenerated mock type for the WebKitContextProvider type
3240-type MockWebKitContextProvider struct {
3234+// MockKeybindingsSaver is an autogenerated mock type for the KeybindingsSaver type
3235+type MockKeybindingsSaver struct {
32413236 mock.Mock
32423237 }
32433238
3244-type MockWebKitContextProvider_Expecter struct {
3239+type MockKeybindingsSaver_Expecter struct {
32453240 mock *mock.Mock
32463241 }
32473242
3248-func (_m *MockWebKitContextProvider) EXPECT() *MockWebKitContextProvider_Expecter {
3249- return &MockWebKitContextProvider_Expecter{mock: &_m.Mock}
3243+func (_m *MockKeybindingsSaver) EXPECT() *MockKeybindingsSaver_Expecter {
3244+ return &MockKeybindingsSaver_Expecter{mock: &_m.Mock}
32503245 }
32513246
3252-// CacheDir provides a mock function for the type MockWebKitContextProvider
3253-func (_mock *MockWebKitContextProvider) CacheDir() string {
3254- ret := _mock.Called()
3247+// ResetAllKeybindings provides a mock function for the type MockKeybindingsSaver
3248+func (_mock *MockKeybindingsSaver) ResetAllKeybindings(ctx context.Context) error {
3249+ ret := _mock.Called(ctx)
32553250
32563251 if len(ret) == 0 {
3257- panic("no return value specified for CacheDir")
3252+ panic("no return value specified for ResetAllKeybindings")
32583253 }
32593254
3260- var r0 string
3261- if returnFunc, ok := ret.Get(0).(func() string); ok {
3262- r0 = returnFunc()
3255+ var r0 error
3256+ if returnFunc, ok := ret.Get(0).(func(context.Context) error); ok {
3257+ r0 = returnFunc(ctx)
32633258 } else {
3264- r0 = ret.Get(0).(string)
3259+ r0 = ret.Error(0)
32653260 }
32663261 return r0
32673262 }
32683263
3269-// MockWebKitContextProvider_CacheDir_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CacheDir'
3270-type MockWebKitContextProvider_CacheDir_Call struct {
3264+// MockKeybindingsSaver_ResetAllKeybindings_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResetAllKeybindings'
3265+type MockKeybindingsSaver_ResetAllKeybindings_Call struct {
32713266 *mock.Call
32723267 }
32733268
3274-// CacheDir is a helper method to define mock.On call
3275-func (_e *MockWebKitContextProvider_Expecter) CacheDir() *MockWebKitContextProvider_CacheDir_Call {
3276- return &MockWebKitContextProvider_CacheDir_Call{Call: _e.mock.On("CacheDir")}
3269+// ResetAllKeybindings is a helper method to define mock.On call
3270+// - ctx context.Context
3271+func (_e *MockKeybindingsSaver_Expecter) ResetAllKeybindings(ctx interface{}) *MockKeybindingsSaver_ResetAllKeybindings_Call {
3272+ return &MockKeybindingsSaver_ResetAllKeybindings_Call{Call: _e.mock.On("ResetAllKeybindings", ctx)}
32773273 }
32783274
3279-func (_c *MockWebKitContextProvider_CacheDir_Call) Run(run func()) *MockWebKitContextProvider_CacheDir_Call {
3275+func (_c *MockKeybindingsSaver_ResetAllKeybindings_Call) Run(run func(ctx context.Context)) *MockKeybindingsSaver_ResetAllKeybindings_Call {
32803276 _c.Call.Run(func(args mock.Arguments) {
3281- run()
3277+ var arg0 context.Context
3278+ if args[0] != nil {
3279+ arg0 = args[0].(context.Context)
3280+ }
3281+ run(
3282+ arg0,
3283+ )
32823284 })
32833285 return _c
32843286 }
32853287
3286-func (_c *MockWebKitContextProvider_CacheDir_Call) Return(s string) *MockWebKitContextProvider_CacheDir_Call {
3287- _c.Call.Return(s)
3288+func (_c *MockKeybindingsSaver_ResetAllKeybindings_Call) Return(err error) *MockKeybindingsSaver_ResetAllKeybindings_Call {
3289+ _c.Call.Return(err)
32883290 return _c
32893291 }
32903292
3291-func (_c *MockWebKitContextProvider_CacheDir_Call) RunAndReturn(run func() string) *MockWebKitContextProvider_CacheDir_Call {
3293+func (_c *MockKeybindingsSaver_ResetAllKeybindings_Call) RunAndReturn(run func(ctx context.Context) error) *MockKeybindingsSaver_ResetAllKeybindings_Call {
32923294 _c.Call.Return(run)
32933295 return _c
32943296 }
32953297
3296-// Close provides a mock function for the type MockWebKitContextProvider
3297-func (_mock *MockWebKitContextProvider) Close() error {
3298- ret := _mock.Called()
3298+// ResetKeybinding provides a mock function for the type MockKeybindingsSaver
3299+func (_mock *MockKeybindingsSaver) ResetKeybinding(ctx context.Context, req port.ResetKeybindingRequest) error {
3300+ ret := _mock.Called(ctx, req)
32993301
33003302 if len(ret) == 0 {
3301- panic("no return value specified for Close")
3303+ panic("no return value specified for ResetKeybinding")
33023304 }
33033305
33043306 var r0 error
3305- if returnFunc, ok := ret.Get(0).(func() error); ok {
3306- r0 = returnFunc()
3307+ if returnFunc, ok := ret.Get(0).(func(context.Context, port.ResetKeybindingRequest) error); ok {
3308+ r0 = returnFunc(ctx, req)
33073309 } else {
33083310 r0 = ret.Error(0)
33093311 }
33103312 return r0
33113313 }
33123314
3313-// MockWebKitContextProvider_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
3314-type MockWebKitContextProvider_Close_Call struct {
3315+// MockKeybindingsSaver_ResetKeybinding_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResetKeybinding'
3316+type MockKeybindingsSaver_ResetKeybinding_Call struct {
33153317 *mock.Call
33163318 }
33173319
3318-// Close is a helper method to define mock.On call
3319-func (_e *MockWebKitContextProvider_Expecter) Close() *MockWebKitContextProvider_Close_Call {
3320- return &MockWebKitContextProvider_Close_Call{Call: _e.mock.On("Close")}
3320+// ResetKeybinding is a helper method to define mock.On call
3321+// - ctx context.Context
3322+// - req port.ResetKeybindingRequest
3323+func (_e *MockKeybindingsSaver_Expecter) ResetKeybinding(ctx interface{}, req interface{}) *MockKeybindingsSaver_ResetKeybinding_Call {
3324+ return &MockKeybindingsSaver_ResetKeybinding_Call{Call: _e.mock.On("ResetKeybinding", ctx, req)}
33213325 }
33223326
3323-func (_c *MockWebKitContextProvider_Close_Call) Run(run func()) *MockWebKitContextProvider_Close_Call {
3327+func (_c *MockKeybindingsSaver_ResetKeybinding_Call) Run(run func(ctx context.Context, req port.ResetKeybindingRequest)) *MockKeybindingsSaver_ResetKeybinding_Call {
33243328 _c.Call.Run(func(args mock.Arguments) {
3325- run()
3326- })
3327- return _c
3328-}
3329-
3330-func (_c *MockWebKitContextProvider_Close_Call) Return(err error) *MockWebKitContextProvider_Close_Call {
3331- _c.Call.Return(err)
3332- return _c
3333-}
3334-
3335-func (_c *MockWebKitContextProvider_Close_Call) RunAndReturn(run func() error) *MockWebKitContextProvider_Close_Call {
3336- _c.Call.Return(run)
3337- return _c
3338-}
3339-
3340-// DataDir provides a mock function for the type MockWebKitContextProvider
3341-func (_mock *MockWebKitContextProvider) DataDir() string {
3342- ret := _mock.Called()
3343-
3344- if len(ret) == 0 {
3345- panic("no return value specified for DataDir")
3346- }
3347-
3348- var r0 string
3349- if returnFunc, ok := ret.Get(0).(func() string); ok {
3350- r0 = returnFunc()
3351- } else {
3352- r0 = ret.Get(0).(string)
3353- }
3354- return r0
3355-}
3356-
3357-// MockWebKitContextProvider_DataDir_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DataDir'
3358-type MockWebKitContextProvider_DataDir_Call struct {
3359- *mock.Call
3360-}
3361-
3362-// DataDir is a helper method to define mock.On call
3363-func (_e *MockWebKitContextProvider_Expecter) DataDir() *MockWebKitContextProvider_DataDir_Call {
3364- return &MockWebKitContextProvider_DataDir_Call{Call: _e.mock.On("DataDir")}
3365-}
3366-
3367-func (_c *MockWebKitContextProvider_DataDir_Call) Run(run func()) *MockWebKitContextProvider_DataDir_Call {
3368- _c.Call.Run(func(args mock.Arguments) {
3369- run()
3329+ var arg0 context.Context
3330+ if args[0] != nil {
3331+ arg0 = args[0].(context.Context)
3332+ }
3333+ var arg1 port.ResetKeybindingRequest
3334+ if args[1] != nil {
3335+ arg1 = args[1].(port.ResetKeybindingRequest)
3336+ }
3337+ run(
3338+ arg0,
3339+ arg1,
3340+ )
33703341 })
33713342 return _c
33723343 }
33733344
3374-func (_c *MockWebKitContextProvider_DataDir_Call) Return(s string) *MockWebKitContextProvider_DataDir_Call {
3375- _c.Call.Return(s)
3345+func (_c *MockKeybindingsSaver_ResetKeybinding_Call) Return(err error) *MockKeybindingsSaver_ResetKeybinding_Call {
3346+ _c.Call.Return(err)
33763347 return _c
33773348 }
33783349
3379-func (_c *MockWebKitContextProvider_DataDir_Call) RunAndReturn(run func() string) *MockWebKitContextProvider_DataDir_Call {
3350+func (_c *MockKeybindingsSaver_ResetKeybinding_Call) RunAndReturn(run func(ctx context.Context, req port.ResetKeybindingRequest) error) *MockKeybindingsSaver_ResetKeybinding_Call {
33803351 _c.Call.Return(run)
33813352 return _c
33823353 }
33833354
3384-// Initialize provides a mock function for the type MockWebKitContextProvider
3385-func (_mock *MockWebKitContextProvider) Initialize(ctx context.Context, opts port.WebKitContextOptions) error {
3386- ret := _mock.Called(ctx, opts)
3355+// SetKeybinding provides a mock function for the type MockKeybindingsSaver
3356+func (_mock *MockKeybindingsSaver) SetKeybinding(ctx context.Context, req port.SetKeybindingRequest) error {
3357+ ret := _mock.Called(ctx, req)
33873358
33883359 if len(ret) == 0 {
3389- panic("no return value specified for Initialize")
3360+ panic("no return value specified for SetKeybinding")
33903361 }
33913362
33923363 var r0 error
3393- if returnFunc, ok := ret.Get(0).(func(context.Context, port.WebKitContextOptions) error); ok {
3394- r0 = returnFunc(ctx, opts)
3364+ if returnFunc, ok := ret.Get(0).(func(context.Context, port.SetKeybindingRequest) error); ok {
3365+ r0 = returnFunc(ctx, req)
33953366 } else {
33963367 r0 = ret.Error(0)
33973368 }
33983369 return r0
33993370 }
34003371
3401-// MockWebKitContextProvider_Initialize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Initialize'
3402-type MockWebKitContextProvider_Initialize_Call struct {
3372+// MockKeybindingsSaver_SetKeybinding_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetKeybinding'
3373+type MockKeybindingsSaver_SetKeybinding_Call struct {
34033374 *mock.Call
34043375 }
34053376
3406-// Initialize is a helper method to define mock.On call
3377+// SetKeybinding is a helper method to define mock.On call
34073378 // - ctx context.Context
3408-// - opts port.WebKitContextOptions
3409-func (_e *MockWebKitContextProvider_Expecter) Initialize(ctx interface{}, opts interface{}) *MockWebKitContextProvider_Initialize_Call {
3410- return &MockWebKitContextProvider_Initialize_Call{Call: _e.mock.On("Initialize", ctx, opts)}
3379+// - req port.SetKeybindingRequest
3380+func (_e *MockKeybindingsSaver_Expecter) SetKeybinding(ctx interface{}, req interface{}) *MockKeybindingsSaver_SetKeybinding_Call {
3381+ return &MockKeybindingsSaver_SetKeybinding_Call{Call: _e.mock.On("SetKeybinding", ctx, req)}
34113382 }
34123383
3413-func (_c *MockWebKitContextProvider_Initialize_Call) Run(run func(ctx context.Context, opts port.WebKitContextOptions)) *MockWebKitContextProvider_Initialize_Call {
3384+func (_c *MockKeybindingsSaver_SetKeybinding_Call) Run(run func(ctx context.Context, req port.SetKeybindingRequest)) *MockKeybindingsSaver_SetKeybinding_Call {
34143385 _c.Call.Run(func(args mock.Arguments) {
34153386 var arg0 context.Context
34163387 if args[0] != nil {
34173388 arg0 = args[0].(context.Context)
34183389 }
3419- var arg1 port.WebKitContextOptions
3390+ var arg1 port.SetKeybindingRequest
34203391 if args[1] != nil {
3421- arg1 = args[1].(port.WebKitContextOptions)
3392+ arg1 = args[1].(port.SetKeybindingRequest)
34223393 }
34233394 run(
34243395 arg0,
@@ -3428,63 +3399,108 @@ func (_c *MockWebKitContextProvider_Initialize_Call) Run(run func(ctx context.Co
34283399 return _c
34293400 }
34303401
3431-func (_c *MockWebKitContextProvider_Initialize_Call) Return(err error) *MockWebKitContextProvider_Initialize_Call {
3402+func (_c *MockKeybindingsSaver_SetKeybinding_Call) Return(err error) *MockKeybindingsSaver_SetKeybinding_Call {
34323403 _c.Call.Return(err)
34333404 return _c
34343405 }
34353406
3436-func (_c *MockWebKitContextProvider_Initialize_Call) RunAndReturn(run func(ctx context.Context, opts port.WebKitContextOptions) error) *MockWebKitContextProvider_Initialize_Call {
3407+func (_c *MockKeybindingsSaver_SetKeybinding_Call) RunAndReturn(run func(ctx context.Context, req port.SetKeybindingRequest) error) *MockKeybindingsSaver_SetKeybinding_Call {
34373408 _c.Call.Return(run)
34383409 return _c
34393410 }
34403411
3441-// PrefetchDNS provides a mock function for the type MockWebKitContextProvider
3442-func (_mock *MockWebKitContextProvider) PrefetchDNS(hostname string) {
3443- _mock.Called(hostname)
3412+// NewMockPermissionDialogPresenter creates a new instance of MockPermissionDialogPresenter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
3413+// The first argument is typically a *testing.T value.
3414+func NewMockPermissionDialogPresenter(t interface {
3415+ mock.TestingT
3416+ Cleanup(func())
3417+}) *MockPermissionDialogPresenter {
3418+ mock := &MockPermissionDialogPresenter{}
3419+ mock.Mock.Test(t)
3420+
3421+ t.Cleanup(func() { mock.AssertExpectations(t) })
3422+
3423+ return mock
3424+}
3425+
3426+// MockPermissionDialogPresenter is an autogenerated mock type for the PermissionDialogPresenter type
3427+type MockPermissionDialogPresenter struct {
3428+ mock.Mock
3429+}
3430+
3431+type MockPermissionDialogPresenter_Expecter struct {
3432+ mock *mock.Mock
3433+}
3434+
3435+func (_m *MockPermissionDialogPresenter) EXPECT() *MockPermissionDialogPresenter_Expecter {
3436+ return &MockPermissionDialogPresenter_Expecter{mock: &_m.Mock}
3437+}
3438+
3439+// ShowPermissionDialog provides a mock function for the type MockPermissionDialogPresenter
3440+func (_mock *MockPermissionDialogPresenter) ShowPermissionDialog(ctx context.Context, origin string, permTypes []entity.PermissionType, callback func(result port.PermissionDialogResult)) {
3441+ _mock.Called(ctx, origin, permTypes, callback)
34443442 return
34453443 }
34463444
3447-// MockWebKitContextProvider_PrefetchDNS_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PrefetchDNS'
3448-type MockWebKitContextProvider_PrefetchDNS_Call struct {
3445+// MockPermissionDialogPresenter_ShowPermissionDialog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ShowPermissionDialog'
3446+type MockPermissionDialogPresenter_ShowPermissionDialog_Call struct {
34493447 *mock.Call
34503448 }
34513449
3452-// PrefetchDNS is a helper method to define mock.On call
3453-// - hostname string
3454-func (_e *MockWebKitContextProvider_Expecter) PrefetchDNS(hostname interface{}) *MockWebKitContextProvider_PrefetchDNS_Call {
3455- return &MockWebKitContextProvider_PrefetchDNS_Call{Call: _e.mock.On("PrefetchDNS", hostname)}
3450+// ShowPermissionDialog is a helper method to define mock.On call
3451+// - ctx context.Context
3452+// - origin string
3453+// - permTypes []entity.PermissionType
3454+// - callback func(result port.PermissionDialogResult)
3455+func (_e *MockPermissionDialogPresenter_Expecter) ShowPermissionDialog(ctx interface{}, origin interface{}, permTypes interface{}, callback interface{}) *MockPermissionDialogPresenter_ShowPermissionDialog_Call {
3456+ return &MockPermissionDialogPresenter_ShowPermissionDialog_Call{Call: _e.mock.On("ShowPermissionDialog", ctx, origin, permTypes, callback)}
34563457 }
34573458
3458-func (_c *MockWebKitContextProvider_PrefetchDNS_Call) Run(run func(hostname string)) *MockWebKitContextProvider_PrefetchDNS_Call {
3459+func (_c *MockPermissionDialogPresenter_ShowPermissionDialog_Call) Run(run func(ctx context.Context, origin string, permTypes []entity.PermissionType, callback func(result port.PermissionDialogResult))) *MockPermissionDialogPresenter_ShowPermissionDialog_Call {
34593460 _c.Call.Run(func(args mock.Arguments) {
3460- var arg0 string
3461+ var arg0 context.Context
34613462 if args[0] != nil {
3462- arg0 = args[0].(string)
3463+ arg0 = args[0].(context.Context)
3464+ }
3465+ var arg1 string
3466+ if args[1] != nil {
3467+ arg1 = args[1].(string)
3468+ }
3469+ var arg2 []entity.PermissionType
3470+ if args[2] != nil {
3471+ arg2 = args[2].([]entity.PermissionType)
3472+ }
3473+ var arg3 func(result port.PermissionDialogResult)
3474+ if args[3] != nil {
3475+ arg3 = args[3].(func(result port.PermissionDialogResult))
34633476 }
34643477 run(
34653478 arg0,
3479+ arg1,
3480+ arg2,
3481+ arg3,
34663482 )
34673483 })
34683484 return _c
34693485 }
34703486
3471-func (_c *MockWebKitContextProvider_PrefetchDNS_Call) Return() *MockWebKitContextProvider_PrefetchDNS_Call {
3487+func (_c *MockPermissionDialogPresenter_ShowPermissionDialog_Call) Return() *MockPermissionDialogPresenter_ShowPermissionDialog_Call {
34723488 _c.Call.Return()
34733489 return _c
34743490 }
34753491
3476-func (_c *MockWebKitContextProvider_PrefetchDNS_Call) RunAndReturn(run func(hostname string)) *MockWebKitContextProvider_PrefetchDNS_Call {
3492+func (_c *MockPermissionDialogPresenter_ShowPermissionDialog_Call) RunAndReturn(run func(ctx context.Context, origin string, permTypes []entity.PermissionType, callback func(result port.PermissionDialogResult))) *MockPermissionDialogPresenter_ShowPermissionDialog_Call {
34773493 _c.Run(run)
34783494 return _c
34793495 }
34803496
3481-// NewMockWebView creates a new instance of MockWebView. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
3497+// NewMockPermissionRepository creates a new instance of MockPermissionRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
34823498 // The first argument is typically a *testing.T value.
3483-func NewMockWebView(t interface {
3499+func NewMockPermissionRepository(t interface {
34843500 mock.TestingT
34853501 Cleanup(func())
3486-}) *MockWebView {
3487- mock := &MockWebView{}
3502+}) *MockPermissionRepository {
3503+ mock := &MockPermissionRepository{}
34883504 mock.Mock.Test(t)
34893505
34903506 t.Cleanup(func() { mock.AssertExpectations(t) })
@@ -3492,745 +3508,2418 @@ func NewMockWebView(t interface {
34923508 return mock
34933509 }
34943510
3495-// MockWebView is an autogenerated mock type for the WebView type
3496-type MockWebView struct {
3511+// MockPermissionRepository is an autogenerated mock type for the PermissionRepository type
3512+type MockPermissionRepository struct {
34973513 mock.Mock
34983514 }
34993515
3500-type MockWebView_Expecter struct {
3516+type MockPermissionRepository_Expecter struct {
35013517 mock *mock.Mock
35023518 }
35033519
3504-func (_m *MockWebView) EXPECT() *MockWebView_Expecter {
3505- return &MockWebView_Expecter{mock: &_m.Mock}
3520+func (_m *MockPermissionRepository) EXPECT() *MockPermissionRepository_Expecter {
3521+ return &MockPermissionRepository_Expecter{mock: &_m.Mock}
35063522 }
35073523
3508-// CanGoBack provides a mock function for the type MockWebView
3509-func (_mock *MockWebView) CanGoBack() bool {
3510- ret := _mock.Called()
3524+// Delete provides a mock function for the type MockPermissionRepository
3525+func (_mock *MockPermissionRepository) Delete(ctx context.Context, origin string, permType entity.PermissionType) error {
3526+ ret := _mock.Called(ctx, origin, permType)
35113527
35123528 if len(ret) == 0 {
3513- panic("no return value specified for CanGoBack")
3529+ panic("no return value specified for Delete")
35143530 }
35153531
3516- var r0 bool
3517- if returnFunc, ok := ret.Get(0).(func() bool); ok {
3518- r0 = returnFunc()
3532+ var r0 error
3533+ if returnFunc, ok := ret.Get(0).(func(context.Context, string, entity.PermissionType) error); ok {
3534+ r0 = returnFunc(ctx, origin, permType)
35193535 } else {
3520- r0 = ret.Get(0).(bool)
3536+ r0 = ret.Error(0)
35213537 }
35223538 return r0
35233539 }
35243540
3525-// MockWebView_CanGoBack_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CanGoBack'
3526-type MockWebView_CanGoBack_Call struct {
3541+// MockPermissionRepository_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete'
3542+type MockPermissionRepository_Delete_Call struct {
35273543 *mock.Call
35283544 }
35293545
3530-// CanGoBack is a helper method to define mock.On call
3531-func (_e *MockWebView_Expecter) CanGoBack() *MockWebView_CanGoBack_Call {
3532- return &MockWebView_CanGoBack_Call{Call: _e.mock.On("CanGoBack")}
3546+// Delete is a helper method to define mock.On call
3547+// - ctx context.Context
3548+// - origin string
3549+// - permType entity.PermissionType
3550+func (_e *MockPermissionRepository_Expecter) Delete(ctx interface{}, origin interface{}, permType interface{}) *MockPermissionRepository_Delete_Call {
3551+ return &MockPermissionRepository_Delete_Call{Call: _e.mock.On("Delete", ctx, origin, permType)}
35333552 }
35343553
3535-func (_c *MockWebView_CanGoBack_Call) Run(run func()) *MockWebView_CanGoBack_Call {
3554+func (_c *MockPermissionRepository_Delete_Call) Run(run func(ctx context.Context, origin string, permType entity.PermissionType)) *MockPermissionRepository_Delete_Call {
35363555 _c.Call.Run(func(args mock.Arguments) {
3537- run()
3556+ var arg0 context.Context
3557+ if args[0] != nil {
3558+ arg0 = args[0].(context.Context)
3559+ }
3560+ var arg1 string
3561+ if args[1] != nil {
3562+ arg1 = args[1].(string)
3563+ }
3564+ var arg2 entity.PermissionType
3565+ if args[2] != nil {
3566+ arg2 = args[2].(entity.PermissionType)
3567+ }
3568+ run(
3569+ arg0,
3570+ arg1,
3571+ arg2,
3572+ )
35383573 })
35393574 return _c
35403575 }
35413576
3542-func (_c *MockWebView_CanGoBack_Call) Return(b bool) *MockWebView_CanGoBack_Call {
3543- _c.Call.Return(b)
3577+func (_c *MockPermissionRepository_Delete_Call) Return(err error) *MockPermissionRepository_Delete_Call {
3578+ _c.Call.Return(err)
35443579 return _c
35453580 }
35463581
3547-func (_c *MockWebView_CanGoBack_Call) RunAndReturn(run func() bool) *MockWebView_CanGoBack_Call {
3582+func (_c *MockPermissionRepository_Delete_Call) RunAndReturn(run func(ctx context.Context, origin string, permType entity.PermissionType) error) *MockPermissionRepository_Delete_Call {
35483583 _c.Call.Return(run)
35493584 return _c
35503585 }
35513586
3552-// CanGoForward provides a mock function for the type MockWebView
3553-func (_mock *MockWebView) CanGoForward() bool {
3554- ret := _mock.Called()
3587+// Get provides a mock function for the type MockPermissionRepository
3588+func (_mock *MockPermissionRepository) Get(ctx context.Context, origin string, permType entity.PermissionType) (*entity.PermissionRecord, error) {
3589+ ret := _mock.Called(ctx, origin, permType)
35553590
35563591 if len(ret) == 0 {
3557- panic("no return value specified for CanGoForward")
3592+ panic("no return value specified for Get")
35583593 }
35593594
3560- var r0 bool
3561- if returnFunc, ok := ret.Get(0).(func() bool); ok {
3562- r0 = returnFunc()
3595+ var r0 *entity.PermissionRecord
3596+ var r1 error
3597+ if returnFunc, ok := ret.Get(0).(func(context.Context, string, entity.PermissionType) (*entity.PermissionRecord, error)); ok {
3598+ return returnFunc(ctx, origin, permType)
3599+ }
3600+ if returnFunc, ok := ret.Get(0).(func(context.Context, string, entity.PermissionType) *entity.PermissionRecord); ok {
3601+ r0 = returnFunc(ctx, origin, permType)
35633602 } else {
3564- r0 = ret.Get(0).(bool)
3603+ if ret.Get(0) != nil {
3604+ r0 = ret.Get(0).(*entity.PermissionRecord)
3605+ }
3606+ }
3607+ if returnFunc, ok := ret.Get(1).(func(context.Context, string, entity.PermissionType) error); ok {
3608+ r1 = returnFunc(ctx, origin, permType)
3609+ } else {
3610+ r1 = ret.Error(1)
3611+ }
3612+ return r0, r1
3613+}
3614+
3615+// MockPermissionRepository_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'
3616+type MockPermissionRepository_Get_Call struct {
3617+ *mock.Call
3618+}
3619+
3620+// Get is a helper method to define mock.On call
3621+// - ctx context.Context
3622+// - origin string
3623+// - permType entity.PermissionType
3624+func (_e *MockPermissionRepository_Expecter) Get(ctx interface{}, origin interface{}, permType interface{}) *MockPermissionRepository_Get_Call {
3625+ return &MockPermissionRepository_Get_Call{Call: _e.mock.On("Get", ctx, origin, permType)}
3626+}
3627+
3628+func (_c *MockPermissionRepository_Get_Call) Run(run func(ctx context.Context, origin string, permType entity.PermissionType)) *MockPermissionRepository_Get_Call {
3629+ _c.Call.Run(func(args mock.Arguments) {
3630+ var arg0 context.Context
3631+ if args[0] != nil {
3632+ arg0 = args[0].(context.Context)
3633+ }
3634+ var arg1 string
3635+ if args[1] != nil {
3636+ arg1 = args[1].(string)
3637+ }
3638+ var arg2 entity.PermissionType
3639+ if args[2] != nil {
3640+ arg2 = args[2].(entity.PermissionType)
3641+ }
3642+ run(
3643+ arg0,
3644+ arg1,
3645+ arg2,
3646+ )
3647+ })
3648+ return _c
3649+}
3650+
3651+func (_c *MockPermissionRepository_Get_Call) Return(permissionRecord *entity.PermissionRecord, err error) *MockPermissionRepository_Get_Call {
3652+ _c.Call.Return(permissionRecord, err)
3653+ return _c
3654+}
3655+
3656+func (_c *MockPermissionRepository_Get_Call) RunAndReturn(run func(ctx context.Context, origin string, permType entity.PermissionType) (*entity.PermissionRecord, error)) *MockPermissionRepository_Get_Call {
3657+ _c.Call.Return(run)
3658+ return _c
3659+}
3660+
3661+// GetAll provides a mock function for the type MockPermissionRepository
3662+func (_mock *MockPermissionRepository) GetAll(ctx context.Context, origin string) ([]*entity.PermissionRecord, error) {
3663+ ret := _mock.Called(ctx, origin)
3664+
3665+ if len(ret) == 0 {
3666+ panic("no return value specified for GetAll")
3667+ }
3668+
3669+ var r0 []*entity.PermissionRecord
3670+ var r1 error
3671+ if returnFunc, ok := ret.Get(0).(func(context.Context, string) ([]*entity.PermissionRecord, error)); ok {
3672+ return returnFunc(ctx, origin)
3673+ }
3674+ if returnFunc, ok := ret.Get(0).(func(context.Context, string) []*entity.PermissionRecord); ok {
3675+ r0 = returnFunc(ctx, origin)
3676+ } else {
3677+ if ret.Get(0) != nil {
3678+ r0 = ret.Get(0).([]*entity.PermissionRecord)
3679+ }
3680+ }
3681+ if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
3682+ r1 = returnFunc(ctx, origin)
3683+ } else {
3684+ r1 = ret.Error(1)
3685+ }
3686+ return r0, r1
3687+}
3688+
3689+// MockPermissionRepository_GetAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAll'
3690+type MockPermissionRepository_GetAll_Call struct {
3691+ *mock.Call
3692+}
3693+
3694+// GetAll is a helper method to define mock.On call
3695+// - ctx context.Context
3696+// - origin string
3697+func (_e *MockPermissionRepository_Expecter) GetAll(ctx interface{}, origin interface{}) *MockPermissionRepository_GetAll_Call {
3698+ return &MockPermissionRepository_GetAll_Call{Call: _e.mock.On("GetAll", ctx, origin)}
3699+}
3700+
3701+func (_c *MockPermissionRepository_GetAll_Call) Run(run func(ctx context.Context, origin string)) *MockPermissionRepository_GetAll_Call {
3702+ _c.Call.Run(func(args mock.Arguments) {
3703+ var arg0 context.Context
3704+ if args[0] != nil {
3705+ arg0 = args[0].(context.Context)
3706+ }
3707+ var arg1 string
3708+ if args[1] != nil {
3709+ arg1 = args[1].(string)
3710+ }
3711+ run(
3712+ arg0,
3713+ arg1,
3714+ )
3715+ })
3716+ return _c
3717+}
3718+
3719+func (_c *MockPermissionRepository_GetAll_Call) Return(permissionRecords []*entity.PermissionRecord, err error) *MockPermissionRepository_GetAll_Call {
3720+ _c.Call.Return(permissionRecords, err)
3721+ return _c
3722+}
3723+
3724+func (_c *MockPermissionRepository_GetAll_Call) RunAndReturn(run func(ctx context.Context, origin string) ([]*entity.PermissionRecord, error)) *MockPermissionRepository_GetAll_Call {
3725+ _c.Call.Return(run)
3726+ return _c
3727+}
3728+
3729+// Set provides a mock function for the type MockPermissionRepository
3730+func (_mock *MockPermissionRepository) Set(ctx context.Context, record *entity.PermissionRecord) error {
3731+ ret := _mock.Called(ctx, record)
3732+
3733+ if len(ret) == 0 {
3734+ panic("no return value specified for Set")
3735+ }
3736+
3737+ var r0 error
3738+ if returnFunc, ok := ret.Get(0).(func(context.Context, *entity.PermissionRecord) error); ok {
3739+ r0 = returnFunc(ctx, record)
3740+ } else {
3741+ r0 = ret.Error(0)
3742+ }
3743+ return r0
3744+}
3745+
3746+// MockPermissionRepository_Set_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Set'
3747+type MockPermissionRepository_Set_Call struct {
3748+ *mock.Call
3749+}
3750+
3751+// Set is a helper method to define mock.On call
3752+// - ctx context.Context
3753+// - record *entity.PermissionRecord
3754+func (_e *MockPermissionRepository_Expecter) Set(ctx interface{}, record interface{}) *MockPermissionRepository_Set_Call {
3755+ return &MockPermissionRepository_Set_Call{Call: _e.mock.On("Set", ctx, record)}
3756+}
3757+
3758+func (_c *MockPermissionRepository_Set_Call) Run(run func(ctx context.Context, record *entity.PermissionRecord)) *MockPermissionRepository_Set_Call {
3759+ _c.Call.Run(func(args mock.Arguments) {
3760+ var arg0 context.Context
3761+ if args[0] != nil {
3762+ arg0 = args[0].(context.Context)
3763+ }
3764+ var arg1 *entity.PermissionRecord
3765+ if args[1] != nil {
3766+ arg1 = args[1].(*entity.PermissionRecord)
3767+ }
3768+ run(
3769+ arg0,
3770+ arg1,
3771+ )
3772+ })
3773+ return _c
3774+}
3775+
3776+func (_c *MockPermissionRepository_Set_Call) Return(err error) *MockPermissionRepository_Set_Call {
3777+ _c.Call.Return(err)
3778+ return _c
3779+}
3780+
3781+func (_c *MockPermissionRepository_Set_Call) RunAndReturn(run func(ctx context.Context, record *entity.PermissionRecord) error) *MockPermissionRepository_Set_Call {
3782+ _c.Call.Return(run)
3783+ return _c
3784+}
3785+
3786+// NewMockSessionLogger creates a new instance of MockSessionLogger. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
3787+// The first argument is typically a *testing.T value.
3788+func NewMockSessionLogger(t interface {
3789+ mock.TestingT
3790+ Cleanup(func())
3791+}) *MockSessionLogger {
3792+ mock := &MockSessionLogger{}
3793+ mock.Mock.Test(t)
3794+
3795+ t.Cleanup(func() { mock.AssertExpectations(t) })
3796+
3797+ return mock
3798+}
3799+
3800+// MockSessionLogger is an autogenerated mock type for the SessionLogger type
3801+type MockSessionLogger struct {
3802+ mock.Mock
3803+}
3804+
3805+type MockSessionLogger_Expecter struct {
3806+ mock *mock.Mock
3807+}
3808+
3809+func (_m *MockSessionLogger) EXPECT() *MockSessionLogger_Expecter {
3810+ return &MockSessionLogger_Expecter{mock: &_m.Mock}
3811+}
3812+
3813+// CreateLogger provides a mock function for the type MockSessionLogger
3814+func (_mock *MockSessionLogger) CreateLogger(ctx context.Context, sessionID entity.SessionID, cfg port.SessionLogConfig) (zerolog.Logger, func(), error) {
3815+ ret := _mock.Called(ctx, sessionID, cfg)
3816+
3817+ if len(ret) == 0 {
3818+ panic("no return value specified for CreateLogger")
3819+ }
3820+
3821+ var r0 zerolog.Logger
3822+ var r1 func()
3823+ var r2 error
3824+ if returnFunc, ok := ret.Get(0).(func(context.Context, entity.SessionID, port.SessionLogConfig) (zerolog.Logger, func(), error)); ok {
3825+ return returnFunc(ctx, sessionID, cfg)
3826+ }
3827+ if returnFunc, ok := ret.Get(0).(func(context.Context, entity.SessionID, port.SessionLogConfig) zerolog.Logger); ok {
3828+ r0 = returnFunc(ctx, sessionID, cfg)
3829+ } else {
3830+ r0 = ret.Get(0).(zerolog.Logger)
3831+ }
3832+ if returnFunc, ok := ret.Get(1).(func(context.Context, entity.SessionID, port.SessionLogConfig) func()); ok {
3833+ r1 = returnFunc(ctx, sessionID, cfg)
3834+ } else {
3835+ if ret.Get(1) != nil {
3836+ r1 = ret.Get(1).(func())
3837+ }
3838+ }
3839+ if returnFunc, ok := ret.Get(2).(func(context.Context, entity.SessionID, port.SessionLogConfig) error); ok {
3840+ r2 = returnFunc(ctx, sessionID, cfg)
3841+ } else {
3842+ r2 = ret.Error(2)
3843+ }
3844+ return r0, r1, r2
3845+}
3846+
3847+// MockSessionLogger_CreateLogger_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateLogger'
3848+type MockSessionLogger_CreateLogger_Call struct {
3849+ *mock.Call
3850+}
3851+
3852+// CreateLogger is a helper method to define mock.On call
3853+// - ctx context.Context
3854+// - sessionID entity.SessionID
3855+// - cfg port.SessionLogConfig
3856+func (_e *MockSessionLogger_Expecter) CreateLogger(ctx interface{}, sessionID interface{}, cfg interface{}) *MockSessionLogger_CreateLogger_Call {
3857+ return &MockSessionLogger_CreateLogger_Call{Call: _e.mock.On("CreateLogger", ctx, sessionID, cfg)}
3858+}
3859+
3860+func (_c *MockSessionLogger_CreateLogger_Call) Run(run func(ctx context.Context, sessionID entity.SessionID, cfg port.SessionLogConfig)) *MockSessionLogger_CreateLogger_Call {
3861+ _c.Call.Run(func(args mock.Arguments) {
3862+ var arg0 context.Context
3863+ if args[0] != nil {
3864+ arg0 = args[0].(context.Context)
3865+ }
3866+ var arg1 entity.SessionID
3867+ if args[1] != nil {
3868+ arg1 = args[1].(entity.SessionID)
3869+ }
3870+ var arg2 port.SessionLogConfig
3871+ if args[2] != nil {
3872+ arg2 = args[2].(port.SessionLogConfig)
3873+ }
3874+ run(
3875+ arg0,
3876+ arg1,
3877+ arg2,
3878+ )
3879+ })
3880+ return _c
3881+}
3882+
3883+func (_c *MockSessionLogger_CreateLogger_Call) Return(logger zerolog.Logger, fn func(), err error) *MockSessionLogger_CreateLogger_Call {
3884+ _c.Call.Return(logger, fn, err)
3885+ return _c
3886+}
3887+
3888+func (_c *MockSessionLogger_CreateLogger_Call) RunAndReturn(run func(ctx context.Context, sessionID entity.SessionID, cfg port.SessionLogConfig) (zerolog.Logger, func(), error)) *MockSessionLogger_CreateLogger_Call {
3889+ _c.Call.Return(run)
3890+ return _c
3891+}
3892+
3893+// NewMockTabListProvider creates a new instance of MockTabListProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
3894+// The first argument is typically a *testing.T value.
3895+func NewMockTabListProvider(t interface {
3896+ mock.TestingT
3897+ Cleanup(func())
3898+}) *MockTabListProvider {
3899+ mock := &MockTabListProvider{}
3900+ mock.Mock.Test(t)
3901+
3902+ t.Cleanup(func() { mock.AssertExpectations(t) })
3903+
3904+ return mock
3905+}
3906+
3907+// MockTabListProvider is an autogenerated mock type for the TabListProvider type
3908+type MockTabListProvider struct {
3909+ mock.Mock
3910+}
3911+
3912+type MockTabListProvider_Expecter struct {
3913+ mock *mock.Mock
3914+}
3915+
3916+func (_m *MockTabListProvider) EXPECT() *MockTabListProvider_Expecter {
3917+ return &MockTabListProvider_Expecter{mock: &_m.Mock}
3918+}
3919+
3920+// GetSessionID provides a mock function for the type MockTabListProvider
3921+func (_mock *MockTabListProvider) GetSessionID() entity.SessionID {
3922+ ret := _mock.Called()
3923+
3924+ if len(ret) == 0 {
3925+ panic("no return value specified for GetSessionID")
3926+ }
3927+
3928+ var r0 entity.SessionID
3929+ if returnFunc, ok := ret.Get(0).(func() entity.SessionID); ok {
3930+ r0 = returnFunc()
3931+ } else {
3932+ r0 = ret.Get(0).(entity.SessionID)
3933+ }
3934+ return r0
3935+}
3936+
3937+// MockTabListProvider_GetSessionID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSessionID'
3938+type MockTabListProvider_GetSessionID_Call struct {
3939+ *mock.Call
3940+}
3941+
3942+// GetSessionID is a helper method to define mock.On call
3943+func (_e *MockTabListProvider_Expecter) GetSessionID() *MockTabListProvider_GetSessionID_Call {
3944+ return &MockTabListProvider_GetSessionID_Call{Call: _e.mock.On("GetSessionID")}
3945+}
3946+
3947+func (_c *MockTabListProvider_GetSessionID_Call) Run(run func()) *MockTabListProvider_GetSessionID_Call {
3948+ _c.Call.Run(func(args mock.Arguments) {
3949+ run()
3950+ })
3951+ return _c
3952+}
3953+
3954+func (_c *MockTabListProvider_GetSessionID_Call) Return(sessionID entity.SessionID) *MockTabListProvider_GetSessionID_Call {
3955+ _c.Call.Return(sessionID)
3956+ return _c
3957+}
3958+
3959+func (_c *MockTabListProvider_GetSessionID_Call) RunAndReturn(run func() entity.SessionID) *MockTabListProvider_GetSessionID_Call {
3960+ _c.Call.Return(run)
3961+ return _c
3962+}
3963+
3964+// GetTabList provides a mock function for the type MockTabListProvider
3965+func (_mock *MockTabListProvider) GetTabList() *entity.TabList {
3966+ ret := _mock.Called()
3967+
3968+ if len(ret) == 0 {
3969+ panic("no return value specified for GetTabList")
3970+ }
3971+
3972+ var r0 *entity.TabList
3973+ if returnFunc, ok := ret.Get(0).(func() *entity.TabList); ok {
3974+ r0 = returnFunc()
3975+ } else {
3976+ if ret.Get(0) != nil {
3977+ r0 = ret.Get(0).(*entity.TabList)
3978+ }
3979+ }
3980+ return r0
3981+}
3982+
3983+// MockTabListProvider_GetTabList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTabList'
3984+type MockTabListProvider_GetTabList_Call struct {
3985+ *mock.Call
3986+}
3987+
3988+// GetTabList is a helper method to define mock.On call
3989+func (_e *MockTabListProvider_Expecter) GetTabList() *MockTabListProvider_GetTabList_Call {
3990+ return &MockTabListProvider_GetTabList_Call{Call: _e.mock.On("GetTabList")}
3991+}
3992+
3993+func (_c *MockTabListProvider_GetTabList_Call) Run(run func()) *MockTabListProvider_GetTabList_Call {
3994+ _c.Call.Run(func(args mock.Arguments) {
3995+ run()
3996+ })
3997+ return _c
3998+}
3999+
4000+func (_c *MockTabListProvider_GetTabList_Call) Return(tabList *entity.TabList) *MockTabListProvider_GetTabList_Call {
4001+ _c.Call.Return(tabList)
4002+ return _c
4003+}
4004+
4005+func (_c *MockTabListProvider_GetTabList_Call) RunAndReturn(run func() *entity.TabList) *MockTabListProvider_GetTabList_Call {
4006+ _c.Call.Return(run)
4007+ return _c
4008+}
4009+
4010+// NewMockSessionSpawner creates a new instance of MockSessionSpawner. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
4011+// The first argument is typically a *testing.T value.
4012+func NewMockSessionSpawner(t interface {
4013+ mock.TestingT
4014+ Cleanup(func())
4015+}) *MockSessionSpawner {
4016+ mock := &MockSessionSpawner{}
4017+ mock.Mock.Test(t)
4018+
4019+ t.Cleanup(func() { mock.AssertExpectations(t) })
4020+
4021+ return mock
4022+}
4023+
4024+// MockSessionSpawner is an autogenerated mock type for the SessionSpawner type
4025+type MockSessionSpawner struct {
4026+ mock.Mock
4027+}
4028+
4029+type MockSessionSpawner_Expecter struct {
4030+ mock *mock.Mock
4031+}
4032+
4033+func (_m *MockSessionSpawner) EXPECT() *MockSessionSpawner_Expecter {
4034+ return &MockSessionSpawner_Expecter{mock: &_m.Mock}
4035+}
4036+
4037+// SpawnWithSession provides a mock function for the type MockSessionSpawner
4038+func (_mock *MockSessionSpawner) SpawnWithSession(sessionID entity.SessionID) error {
4039+ ret := _mock.Called(sessionID)
4040+
4041+ if len(ret) == 0 {
4042+ panic("no return value specified for SpawnWithSession")
4043+ }
4044+
4045+ var r0 error
4046+ if returnFunc, ok := ret.Get(0).(func(entity.SessionID) error); ok {
4047+ r0 = returnFunc(sessionID)
4048+ } else {
4049+ r0 = ret.Error(0)
4050+ }
4051+ return r0
4052+}
4053+
4054+// MockSessionSpawner_SpawnWithSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SpawnWithSession'
4055+type MockSessionSpawner_SpawnWithSession_Call struct {
4056+ *mock.Call
4057+}
4058+
4059+// SpawnWithSession is a helper method to define mock.On call
4060+// - sessionID entity.SessionID
4061+func (_e *MockSessionSpawner_Expecter) SpawnWithSession(sessionID interface{}) *MockSessionSpawner_SpawnWithSession_Call {
4062+ return &MockSessionSpawner_SpawnWithSession_Call{Call: _e.mock.On("SpawnWithSession", sessionID)}
4063+}
4064+
4065+func (_c *MockSessionSpawner_SpawnWithSession_Call) Run(run func(sessionID entity.SessionID)) *MockSessionSpawner_SpawnWithSession_Call {
4066+ _c.Call.Run(func(args mock.Arguments) {
4067+ var arg0 entity.SessionID
4068+ if args[0] != nil {
4069+ arg0 = args[0].(entity.SessionID)
4070+ }
4071+ run(
4072+ arg0,
4073+ )
4074+ })
4075+ return _c
4076+}
4077+
4078+func (_c *MockSessionSpawner_SpawnWithSession_Call) Return(err error) *MockSessionSpawner_SpawnWithSession_Call {
4079+ _c.Call.Return(err)
4080+ return _c
4081+}
4082+
4083+func (_c *MockSessionSpawner_SpawnWithSession_Call) RunAndReturn(run func(sessionID entity.SessionID) error) *MockSessionSpawner_SpawnWithSession_Call {
4084+ _c.Call.Return(run)
4085+ return _c
4086+}
4087+
4088+// NewMockTextInputTarget creates a new instance of MockTextInputTarget. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
4089+// The first argument is typically a *testing.T value.
4090+func NewMockTextInputTarget(t interface {
4091+ mock.TestingT
4092+ Cleanup(func())
4093+}) *MockTextInputTarget {
4094+ mock := &MockTextInputTarget{}
4095+ mock.Mock.Test(t)
4096+
4097+ t.Cleanup(func() { mock.AssertExpectations(t) })
4098+
4099+ return mock
4100+}
4101+
4102+// MockTextInputTarget is an autogenerated mock type for the TextInputTarget type
4103+type MockTextInputTarget struct {
4104+ mock.Mock
4105+}
4106+
4107+type MockTextInputTarget_Expecter struct {
4108+ mock *mock.Mock
4109+}
4110+
4111+func (_m *MockTextInputTarget) EXPECT() *MockTextInputTarget_Expecter {
4112+ return &MockTextInputTarget_Expecter{mock: &_m.Mock}
4113+}
4114+
4115+// DeleteBeforeCursor provides a mock function for the type MockTextInputTarget
4116+func (_mock *MockTextInputTarget) DeleteBeforeCursor(ctx context.Context, n int) error {
4117+ ret := _mock.Called(ctx, n)
4118+
4119+ if len(ret) == 0 {
4120+ panic("no return value specified for DeleteBeforeCursor")
4121+ }
4122+
4123+ var r0 error
4124+ if returnFunc, ok := ret.Get(0).(func(context.Context, int) error); ok {
4125+ r0 = returnFunc(ctx, n)
4126+ } else {
4127+ r0 = ret.Error(0)
4128+ }
4129+ return r0
4130+}
4131+
4132+// MockTextInputTarget_DeleteBeforeCursor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteBeforeCursor'
4133+type MockTextInputTarget_DeleteBeforeCursor_Call struct {
4134+ *mock.Call
4135+}
4136+
4137+// DeleteBeforeCursor is a helper method to define mock.On call
4138+// - ctx context.Context
4139+// - n int
4140+func (_e *MockTextInputTarget_Expecter) DeleteBeforeCursor(ctx interface{}, n interface{}) *MockTextInputTarget_DeleteBeforeCursor_Call {
4141+ return &MockTextInputTarget_DeleteBeforeCursor_Call{Call: _e.mock.On("DeleteBeforeCursor", ctx, n)}
4142+}
4143+
4144+func (_c *MockTextInputTarget_DeleteBeforeCursor_Call) Run(run func(ctx context.Context, n int)) *MockTextInputTarget_DeleteBeforeCursor_Call {
4145+ _c.Call.Run(func(args mock.Arguments) {
4146+ var arg0 context.Context
4147+ if args[0] != nil {
4148+ arg0 = args[0].(context.Context)
4149+ }
4150+ var arg1 int
4151+ if args[1] != nil {
4152+ arg1 = args[1].(int)
4153+ }
4154+ run(
4155+ arg0,
4156+ arg1,
4157+ )
4158+ })
4159+ return _c
4160+}
4161+
4162+func (_c *MockTextInputTarget_DeleteBeforeCursor_Call) Return(err error) *MockTextInputTarget_DeleteBeforeCursor_Call {
4163+ _c.Call.Return(err)
4164+ return _c
4165+}
4166+
4167+func (_c *MockTextInputTarget_DeleteBeforeCursor_Call) RunAndReturn(run func(ctx context.Context, n int) error) *MockTextInputTarget_DeleteBeforeCursor_Call {
4168+ _c.Call.Return(run)
4169+ return _c
4170+}
4171+
4172+// InsertText provides a mock function for the type MockTextInputTarget
4173+func (_mock *MockTextInputTarget) InsertText(ctx context.Context, text string) error {
4174+ ret := _mock.Called(ctx, text)
4175+
4176+ if len(ret) == 0 {
4177+ panic("no return value specified for InsertText")
4178+ }
4179+
4180+ var r0 error
4181+ if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok {
4182+ r0 = returnFunc(ctx, text)
4183+ } else {
4184+ r0 = ret.Error(0)
4185+ }
4186+ return r0
4187+}
4188+
4189+// MockTextInputTarget_InsertText_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InsertText'
4190+type MockTextInputTarget_InsertText_Call struct {
4191+ *mock.Call
4192+}
4193+
4194+// InsertText is a helper method to define mock.On call
4195+// - ctx context.Context
4196+// - text string
4197+func (_e *MockTextInputTarget_Expecter) InsertText(ctx interface{}, text interface{}) *MockTextInputTarget_InsertText_Call {
4198+ return &MockTextInputTarget_InsertText_Call{Call: _e.mock.On("InsertText", ctx, text)}
4199+}
4200+
4201+func (_c *MockTextInputTarget_InsertText_Call) Run(run func(ctx context.Context, text string)) *MockTextInputTarget_InsertText_Call {
4202+ _c.Call.Run(func(args mock.Arguments) {
4203+ var arg0 context.Context
4204+ if args[0] != nil {
4205+ arg0 = args[0].(context.Context)
4206+ }
4207+ var arg1 string
4208+ if args[1] != nil {
4209+ arg1 = args[1].(string)
4210+ }
4211+ run(
4212+ arg0,
4213+ arg1,
4214+ )
4215+ })
4216+ return _c
4217+}
4218+
4219+func (_c *MockTextInputTarget_InsertText_Call) Return(err error) *MockTextInputTarget_InsertText_Call {
4220+ _c.Call.Return(err)
4221+ return _c
4222+}
4223+
4224+func (_c *MockTextInputTarget_InsertText_Call) RunAndReturn(run func(ctx context.Context, text string) error) *MockTextInputTarget_InsertText_Call {
4225+ _c.Call.Return(run)
4226+ return _c
4227+}
4228+
4229+// NewMockFocusedInputProvider creates a new instance of MockFocusedInputProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
4230+// The first argument is typically a *testing.T value.
4231+func NewMockFocusedInputProvider(t interface {
4232+ mock.TestingT
4233+ Cleanup(func())
4234+}) *MockFocusedInputProvider {
4235+ mock := &MockFocusedInputProvider{}
4236+ mock.Mock.Test(t)
4237+
4238+ t.Cleanup(func() { mock.AssertExpectations(t) })
4239+
4240+ return mock
4241+}
4242+
4243+// MockFocusedInputProvider is an autogenerated mock type for the FocusedInputProvider type
4244+type MockFocusedInputProvider struct {
4245+ mock.Mock
4246+}
4247+
4248+type MockFocusedInputProvider_Expecter struct {
4249+ mock *mock.Mock
4250+}
4251+
4252+func (_m *MockFocusedInputProvider) EXPECT() *MockFocusedInputProvider_Expecter {
4253+ return &MockFocusedInputProvider_Expecter{mock: &_m.Mock}
4254+}
4255+
4256+// GetFocusedInput provides a mock function for the type MockFocusedInputProvider
4257+func (_mock *MockFocusedInputProvider) GetFocusedInput() port.TextInputTarget {
4258+ ret := _mock.Called()
4259+
4260+ if len(ret) == 0 {
4261+ panic("no return value specified for GetFocusedInput")
4262+ }
4263+
4264+ var r0 port.TextInputTarget
4265+ if returnFunc, ok := ret.Get(0).(func() port.TextInputTarget); ok {
4266+ r0 = returnFunc()
4267+ } else {
4268+ if ret.Get(0) != nil {
4269+ r0 = ret.Get(0).(port.TextInputTarget)
4270+ }
4271+ }
4272+ return r0
4273+}
4274+
4275+// MockFocusedInputProvider_GetFocusedInput_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFocusedInput'
4276+type MockFocusedInputProvider_GetFocusedInput_Call struct {
4277+ *mock.Call
4278+}
4279+
4280+// GetFocusedInput is a helper method to define mock.On call
4281+func (_e *MockFocusedInputProvider_Expecter) GetFocusedInput() *MockFocusedInputProvider_GetFocusedInput_Call {
4282+ return &MockFocusedInputProvider_GetFocusedInput_Call{Call: _e.mock.On("GetFocusedInput")}
4283+}
4284+
4285+func (_c *MockFocusedInputProvider_GetFocusedInput_Call) Run(run func()) *MockFocusedInputProvider_GetFocusedInput_Call {
4286+ _c.Call.Run(func(args mock.Arguments) {
4287+ run()
4288+ })
4289+ return _c
4290+}
4291+
4292+func (_c *MockFocusedInputProvider_GetFocusedInput_Call) Return(textInputTarget port.TextInputTarget) *MockFocusedInputProvider_GetFocusedInput_Call {
4293+ _c.Call.Return(textInputTarget)
4294+ return _c
4295+}
4296+
4297+func (_c *MockFocusedInputProvider_GetFocusedInput_Call) RunAndReturn(run func() port.TextInputTarget) *MockFocusedInputProvider_GetFocusedInput_Call {
4298+ _c.Call.Return(run)
4299+ return _c
4300+}
4301+
4302+// SetFocusedInput provides a mock function for the type MockFocusedInputProvider
4303+func (_mock *MockFocusedInputProvider) SetFocusedInput(target port.TextInputTarget) {
4304+ _mock.Called(target)
4305+ return
4306+}
4307+
4308+// MockFocusedInputProvider_SetFocusedInput_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetFocusedInput'
4309+type MockFocusedInputProvider_SetFocusedInput_Call struct {
4310+ *mock.Call
4311+}
4312+
4313+// SetFocusedInput is a helper method to define mock.On call
4314+// - target port.TextInputTarget
4315+func (_e *MockFocusedInputProvider_Expecter) SetFocusedInput(target interface{}) *MockFocusedInputProvider_SetFocusedInput_Call {
4316+ return &MockFocusedInputProvider_SetFocusedInput_Call{Call: _e.mock.On("SetFocusedInput", target)}
4317+}
4318+
4319+func (_c *MockFocusedInputProvider_SetFocusedInput_Call) Run(run func(target port.TextInputTarget)) *MockFocusedInputProvider_SetFocusedInput_Call {
4320+ _c.Call.Run(func(args mock.Arguments) {
4321+ var arg0 port.TextInputTarget
4322+ if args[0] != nil {
4323+ arg0 = args[0].(port.TextInputTarget)
4324+ }
4325+ run(
4326+ arg0,
4327+ )
4328+ })
4329+ return _c
4330+}
4331+
4332+func (_c *MockFocusedInputProvider_SetFocusedInput_Call) Return() *MockFocusedInputProvider_SetFocusedInput_Call {
4333+ _c.Call.Return()
4334+ return _c
4335+}
4336+
4337+func (_c *MockFocusedInputProvider_SetFocusedInput_Call) RunAndReturn(run func(target port.TextInputTarget)) *MockFocusedInputProvider_SetFocusedInput_Call {
4338+ _c.Run(run)
4339+ return _c
4340+}
4341+
4342+// NewMockMemoryPressureApplier creates a new instance of MockMemoryPressureApplier. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
4343+// The first argument is typically a *testing.T value.
4344+func NewMockMemoryPressureApplier(t interface {
4345+ mock.TestingT
4346+ Cleanup(func())
4347+}) *MockMemoryPressureApplier {
4348+ mock := &MockMemoryPressureApplier{}
4349+ mock.Mock.Test(t)
4350+
4351+ t.Cleanup(func() { mock.AssertExpectations(t) })
4352+
4353+ return mock
4354+}
4355+
4356+// MockMemoryPressureApplier is an autogenerated mock type for the MemoryPressureApplier type
4357+type MockMemoryPressureApplier struct {
4358+ mock.Mock
4359+}
4360+
4361+type MockMemoryPressureApplier_Expecter struct {
4362+ mock *mock.Mock
4363+}
4364+
4365+func (_m *MockMemoryPressureApplier) EXPECT() *MockMemoryPressureApplier_Expecter {
4366+ return &MockMemoryPressureApplier_Expecter{mock: &_m.Mock}
4367+}
4368+
4369+// ApplyNetworkProcessSettings provides a mock function for the type MockMemoryPressureApplier
4370+func (_mock *MockMemoryPressureApplier) ApplyNetworkProcessSettings(ctx context.Context, cfg *port.MemoryPressureConfig) error {
4371+ ret := _mock.Called(ctx, cfg)
4372+
4373+ if len(ret) == 0 {
4374+ panic("no return value specified for ApplyNetworkProcessSettings")
4375+ }
4376+
4377+ var r0 error
4378+ if returnFunc, ok := ret.Get(0).(func(context.Context, *port.MemoryPressureConfig) error); ok {
4379+ r0 = returnFunc(ctx, cfg)
4380+ } else {
4381+ r0 = ret.Error(0)
4382+ }
4383+ return r0
4384+}
4385+
4386+// MockMemoryPressureApplier_ApplyNetworkProcessSettings_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ApplyNetworkProcessSettings'
4387+type MockMemoryPressureApplier_ApplyNetworkProcessSettings_Call struct {
4388+ *mock.Call
4389+}
4390+
4391+// ApplyNetworkProcessSettings is a helper method to define mock.On call
4392+// - ctx context.Context
4393+// - cfg *port.MemoryPressureConfig
4394+func (_e *MockMemoryPressureApplier_Expecter) ApplyNetworkProcessSettings(ctx interface{}, cfg interface{}) *MockMemoryPressureApplier_ApplyNetworkProcessSettings_Call {
4395+ return &MockMemoryPressureApplier_ApplyNetworkProcessSettings_Call{Call: _e.mock.On("ApplyNetworkProcessSettings", ctx, cfg)}
4396+}
4397+
4398+func (_c *MockMemoryPressureApplier_ApplyNetworkProcessSettings_Call) Run(run func(ctx context.Context, cfg *port.MemoryPressureConfig)) *MockMemoryPressureApplier_ApplyNetworkProcessSettings_Call {
4399+ _c.Call.Run(func(args mock.Arguments) {
4400+ var arg0 context.Context
4401+ if args[0] != nil {
4402+ arg0 = args[0].(context.Context)
4403+ }
4404+ var arg1 *port.MemoryPressureConfig
4405+ if args[1] != nil {
4406+ arg1 = args[1].(*port.MemoryPressureConfig)
4407+ }
4408+ run(
4409+ arg0,
4410+ arg1,
4411+ )
4412+ })
4413+ return _c
4414+}
4415+
4416+func (_c *MockMemoryPressureApplier_ApplyNetworkProcessSettings_Call) Return(err error) *MockMemoryPressureApplier_ApplyNetworkProcessSettings_Call {
4417+ _c.Call.Return(err)
4418+ return _c
4419+}
4420+
4421+func (_c *MockMemoryPressureApplier_ApplyNetworkProcessSettings_Call) RunAndReturn(run func(ctx context.Context, cfg *port.MemoryPressureConfig) error) *MockMemoryPressureApplier_ApplyNetworkProcessSettings_Call {
4422+ _c.Call.Return(run)
4423+ return _c
4424+}
4425+
4426+// ApplyWebProcessSettings provides a mock function for the type MockMemoryPressureApplier
4427+func (_mock *MockMemoryPressureApplier) ApplyWebProcessSettings(ctx context.Context, cfg *port.MemoryPressureConfig) (any, error) {
4428+ ret := _mock.Called(ctx, cfg)
4429+
4430+ if len(ret) == 0 {
4431+ panic("no return value specified for ApplyWebProcessSettings")
4432+ }
4433+
4434+ var r0 any
4435+ var r1 error
4436+ if returnFunc, ok := ret.Get(0).(func(context.Context, *port.MemoryPressureConfig) (any, error)); ok {
4437+ return returnFunc(ctx, cfg)
4438+ }
4439+ if returnFunc, ok := ret.Get(0).(func(context.Context, *port.MemoryPressureConfig) any); ok {
4440+ r0 = returnFunc(ctx, cfg)
4441+ } else {
4442+ if ret.Get(0) != nil {
4443+ r0 = ret.Get(0).(any)
4444+ }
4445+ }
4446+ if returnFunc, ok := ret.Get(1).(func(context.Context, *port.MemoryPressureConfig) error); ok {
4447+ r1 = returnFunc(ctx, cfg)
4448+ } else {
4449+ r1 = ret.Error(1)
4450+ }
4451+ return r0, r1
4452+}
4453+
4454+// MockMemoryPressureApplier_ApplyWebProcessSettings_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ApplyWebProcessSettings'
4455+type MockMemoryPressureApplier_ApplyWebProcessSettings_Call struct {
4456+ *mock.Call
4457+}
4458+
4459+// ApplyWebProcessSettings is a helper method to define mock.On call
4460+// - ctx context.Context
4461+// - cfg *port.MemoryPressureConfig
4462+func (_e *MockMemoryPressureApplier_Expecter) ApplyWebProcessSettings(ctx interface{}, cfg interface{}) *MockMemoryPressureApplier_ApplyWebProcessSettings_Call {
4463+ return &MockMemoryPressureApplier_ApplyWebProcessSettings_Call{Call: _e.mock.On("ApplyWebProcessSettings", ctx, cfg)}
4464+}
4465+
4466+func (_c *MockMemoryPressureApplier_ApplyWebProcessSettings_Call) Run(run func(ctx context.Context, cfg *port.MemoryPressureConfig)) *MockMemoryPressureApplier_ApplyWebProcessSettings_Call {
4467+ _c.Call.Run(func(args mock.Arguments) {
4468+ var arg0 context.Context
4469+ if args[0] != nil {
4470+ arg0 = args[0].(context.Context)
4471+ }
4472+ var arg1 *port.MemoryPressureConfig
4473+ if args[1] != nil {
4474+ arg1 = args[1].(*port.MemoryPressureConfig)
4475+ }
4476+ run(
4477+ arg0,
4478+ arg1,
4479+ )
4480+ })
4481+ return _c
4482+}
4483+
4484+func (_c *MockMemoryPressureApplier_ApplyWebProcessSettings_Call) Return(v any, err error) *MockMemoryPressureApplier_ApplyWebProcessSettings_Call {
4485+ _c.Call.Return(v, err)
4486+ return _c
4487+}
4488+
4489+func (_c *MockMemoryPressureApplier_ApplyWebProcessSettings_Call) RunAndReturn(run func(ctx context.Context, cfg *port.MemoryPressureConfig) (any, error)) *MockMemoryPressureApplier_ApplyWebProcessSettings_Call {
4490+ _c.Call.Return(run)
4491+ return _c
4492+}
4493+
4494+// NewMockWebKitContextProvider creates a new instance of MockWebKitContextProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
4495+// The first argument is typically a *testing.T value.
4496+func NewMockWebKitContextProvider(t interface {
4497+ mock.TestingT
4498+ Cleanup(func())
4499+}) *MockWebKitContextProvider {
4500+ mock := &MockWebKitContextProvider{}
4501+ mock.Mock.Test(t)
4502+
4503+ t.Cleanup(func() { mock.AssertExpectations(t) })
4504+
4505+ return mock
4506+}
4507+
4508+// MockWebKitContextProvider is an autogenerated mock type for the WebKitContextProvider type
4509+type MockWebKitContextProvider struct {
4510+ mock.Mock
4511+}
4512+
4513+type MockWebKitContextProvider_Expecter struct {
4514+ mock *mock.Mock
4515+}
4516+
4517+func (_m *MockWebKitContextProvider) EXPECT() *MockWebKitContextProvider_Expecter {
4518+ return &MockWebKitContextProvider_Expecter{mock: &_m.Mock}
4519+}
4520+
4521+// CacheDir provides a mock function for the type MockWebKitContextProvider
4522+func (_mock *MockWebKitContextProvider) CacheDir() string {
4523+ ret := _mock.Called()
4524+
4525+ if len(ret) == 0 {
4526+ panic("no return value specified for CacheDir")
4527+ }
4528+
4529+ var r0 string
4530+ if returnFunc, ok := ret.Get(0).(func() string); ok {
4531+ r0 = returnFunc()
4532+ } else {
4533+ r0 = ret.Get(0).(string)
4534+ }
4535+ return r0
4536+}
4537+
4538+// MockWebKitContextProvider_CacheDir_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CacheDir'
4539+type MockWebKitContextProvider_CacheDir_Call struct {
4540+ *mock.Call
4541+}
4542+
4543+// CacheDir is a helper method to define mock.On call
4544+func (_e *MockWebKitContextProvider_Expecter) CacheDir() *MockWebKitContextProvider_CacheDir_Call {
4545+ return &MockWebKitContextProvider_CacheDir_Call{Call: _e.mock.On("CacheDir")}
4546+}
4547+
4548+func (_c *MockWebKitContextProvider_CacheDir_Call) Run(run func()) *MockWebKitContextProvider_CacheDir_Call {
4549+ _c.Call.Run(func(args mock.Arguments) {
4550+ run()
4551+ })
4552+ return _c
4553+}
4554+
4555+func (_c *MockWebKitContextProvider_CacheDir_Call) Return(s string) *MockWebKitContextProvider_CacheDir_Call {
4556+ _c.Call.Return(s)
4557+ return _c
4558+}
4559+
4560+func (_c *MockWebKitContextProvider_CacheDir_Call) RunAndReturn(run func() string) *MockWebKitContextProvider_CacheDir_Call {
4561+ _c.Call.Return(run)
4562+ return _c
4563+}
4564+
4565+// Close provides a mock function for the type MockWebKitContextProvider
4566+func (_mock *MockWebKitContextProvider) Close() error {
4567+ ret := _mock.Called()
4568+
4569+ if len(ret) == 0 {
4570+ panic("no return value specified for Close")
4571+ }
4572+
4573+ var r0 error
4574+ if returnFunc, ok := ret.Get(0).(func() error); ok {
4575+ r0 = returnFunc()
4576+ } else {
4577+ r0 = ret.Error(0)
4578+ }
4579+ return r0
4580+}
4581+
4582+// MockWebKitContextProvider_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
4583+type MockWebKitContextProvider_Close_Call struct {
4584+ *mock.Call
4585+}
4586+
4587+// Close is a helper method to define mock.On call
4588+func (_e *MockWebKitContextProvider_Expecter) Close() *MockWebKitContextProvider_Close_Call {
4589+ return &MockWebKitContextProvider_Close_Call{Call: _e.mock.On("Close")}
4590+}
4591+
4592+func (_c *MockWebKitContextProvider_Close_Call) Run(run func()) *MockWebKitContextProvider_Close_Call {
4593+ _c.Call.Run(func(args mock.Arguments) {
4594+ run()
4595+ })
4596+ return _c
4597+}
4598+
4599+func (_c *MockWebKitContextProvider_Close_Call) Return(err error) *MockWebKitContextProvider_Close_Call {
4600+ _c.Call.Return(err)
4601+ return _c
4602+}
4603+
4604+func (_c *MockWebKitContextProvider_Close_Call) RunAndReturn(run func() error) *MockWebKitContextProvider_Close_Call {
4605+ _c.Call.Return(run)
4606+ return _c
4607+}
4608+
4609+// DataDir provides a mock function for the type MockWebKitContextProvider
4610+func (_mock *MockWebKitContextProvider) DataDir() string {
4611+ ret := _mock.Called()
4612+
4613+ if len(ret) == 0 {
4614+ panic("no return value specified for DataDir")
4615+ }
4616+
4617+ var r0 string
4618+ if returnFunc, ok := ret.Get(0).(func() string); ok {
4619+ r0 = returnFunc()
4620+ } else {
4621+ r0 = ret.Get(0).(string)
4622+ }
4623+ return r0
4624+}
4625+
4626+// MockWebKitContextProvider_DataDir_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DataDir'
4627+type MockWebKitContextProvider_DataDir_Call struct {
4628+ *mock.Call
4629+}
4630+
4631+// DataDir is a helper method to define mock.On call
4632+func (_e *MockWebKitContextProvider_Expecter) DataDir() *MockWebKitContextProvider_DataDir_Call {
4633+ return &MockWebKitContextProvider_DataDir_Call{Call: _e.mock.On("DataDir")}
4634+}
4635+
4636+func (_c *MockWebKitContextProvider_DataDir_Call) Run(run func()) *MockWebKitContextProvider_DataDir_Call {
4637+ _c.Call.Run(func(args mock.Arguments) {
4638+ run()
4639+ })
4640+ return _c
4641+}
4642+
4643+func (_c *MockWebKitContextProvider_DataDir_Call) Return(s string) *MockWebKitContextProvider_DataDir_Call {
4644+ _c.Call.Return(s)
4645+ return _c
4646+}
4647+
4648+func (_c *MockWebKitContextProvider_DataDir_Call) RunAndReturn(run func() string) *MockWebKitContextProvider_DataDir_Call {
4649+ _c.Call.Return(run)
4650+ return _c
4651+}
4652+
4653+// Initialize provides a mock function for the type MockWebKitContextProvider
4654+func (_mock *MockWebKitContextProvider) Initialize(ctx context.Context, opts port.WebKitContextOptions) error {
4655+ ret := _mock.Called(ctx, opts)
4656+
4657+ if len(ret) == 0 {
4658+ panic("no return value specified for Initialize")
4659+ }
4660+
4661+ var r0 error
4662+ if returnFunc, ok := ret.Get(0).(func(context.Context, port.WebKitContextOptions) error); ok {
4663+ r0 = returnFunc(ctx, opts)
4664+ } else {
4665+ r0 = ret.Error(0)
4666+ }
4667+ return r0
4668+}
4669+
4670+// MockWebKitContextProvider_Initialize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Initialize'
4671+type MockWebKitContextProvider_Initialize_Call struct {
4672+ *mock.Call
4673+}
4674+
4675+// Initialize is a helper method to define mock.On call
4676+// - ctx context.Context
4677+// - opts port.WebKitContextOptions
4678+func (_e *MockWebKitContextProvider_Expecter) Initialize(ctx interface{}, opts interface{}) *MockWebKitContextProvider_Initialize_Call {
4679+ return &MockWebKitContextProvider_Initialize_Call{Call: _e.mock.On("Initialize", ctx, opts)}
4680+}
4681+
4682+func (_c *MockWebKitContextProvider_Initialize_Call) Run(run func(ctx context.Context, opts port.WebKitContextOptions)) *MockWebKitContextProvider_Initialize_Call {
4683+ _c.Call.Run(func(args mock.Arguments) {
4684+ var arg0 context.Context
4685+ if args[0] != nil {
4686+ arg0 = args[0].(context.Context)
4687+ }
4688+ var arg1 port.WebKitContextOptions
4689+ if args[1] != nil {
4690+ arg1 = args[1].(port.WebKitContextOptions)
4691+ }
4692+ run(
4693+ arg0,
4694+ arg1,
4695+ )
4696+ })
4697+ return _c
4698+}
4699+
4700+func (_c *MockWebKitContextProvider_Initialize_Call) Return(err error) *MockWebKitContextProvider_Initialize_Call {
4701+ _c.Call.Return(err)
4702+ return _c
4703+}
4704+
4705+func (_c *MockWebKitContextProvider_Initialize_Call) RunAndReturn(run func(ctx context.Context, opts port.WebKitContextOptions) error) *MockWebKitContextProvider_Initialize_Call {
4706+ _c.Call.Return(run)
4707+ return _c
4708+}
4709+
4710+// PrefetchDNS provides a mock function for the type MockWebKitContextProvider
4711+func (_mock *MockWebKitContextProvider) PrefetchDNS(hostname string) {
4712+ _mock.Called(hostname)
4713+ return
4714+}
4715+
4716+// MockWebKitContextProvider_PrefetchDNS_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PrefetchDNS'
4717+type MockWebKitContextProvider_PrefetchDNS_Call struct {
4718+ *mock.Call
4719+}
4720+
4721+// PrefetchDNS is a helper method to define mock.On call
4722+// - hostname string
4723+func (_e *MockWebKitContextProvider_Expecter) PrefetchDNS(hostname interface{}) *MockWebKitContextProvider_PrefetchDNS_Call {
4724+ return &MockWebKitContextProvider_PrefetchDNS_Call{Call: _e.mock.On("PrefetchDNS", hostname)}
4725+}
4726+
4727+func (_c *MockWebKitContextProvider_PrefetchDNS_Call) Run(run func(hostname string)) *MockWebKitContextProvider_PrefetchDNS_Call {
4728+ _c.Call.Run(func(args mock.Arguments) {
4729+ var arg0 string
4730+ if args[0] != nil {
4731+ arg0 = args[0].(string)
4732+ }
4733+ run(
4734+ arg0,
4735+ )
4736+ })
4737+ return _c
4738+}
4739+
4740+func (_c *MockWebKitContextProvider_PrefetchDNS_Call) Return() *MockWebKitContextProvider_PrefetchDNS_Call {
4741+ _c.Call.Return()
4742+ return _c
4743+}
4744+
4745+func (_c *MockWebKitContextProvider_PrefetchDNS_Call) RunAndReturn(run func(hostname string)) *MockWebKitContextProvider_PrefetchDNS_Call {
4746+ _c.Run(run)
4747+ return _c
4748+}
4749+
4750+// NewMockWebView creates a new instance of MockWebView. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
4751+// The first argument is typically a *testing.T value.
4752+func NewMockWebView(t interface {
4753+ mock.TestingT
4754+ Cleanup(func())
4755+}) *MockWebView {
4756+ mock := &MockWebView{}
4757+ mock.Mock.Test(t)
4758+
4759+ t.Cleanup(func() { mock.AssertExpectations(t) })
4760+
4761+ return mock
4762+}
4763+
4764+// MockWebView is an autogenerated mock type for the WebView type
4765+type MockWebView struct {
4766+ mock.Mock
4767+}
4768+
4769+type MockWebView_Expecter struct {
4770+ mock *mock.Mock
4771+}
4772+
4773+func (_m *MockWebView) EXPECT() *MockWebView_Expecter {
4774+ return &MockWebView_Expecter{mock: &_m.Mock}
4775+}
4776+
4777+// CanGoBack provides a mock function for the type MockWebView
4778+func (_mock *MockWebView) CanGoBack() bool {
4779+ ret := _mock.Called()
4780+
4781+ if len(ret) == 0 {
4782+ panic("no return value specified for CanGoBack")
4783+ }
4784+
4785+ var r0 bool
4786+ if returnFunc, ok := ret.Get(0).(func() bool); ok {
4787+ r0 = returnFunc()
4788+ } else {
4789+ r0 = ret.Get(0).(bool)
4790+ }
4791+ return r0
4792+}
4793+
4794+// MockWebView_CanGoBack_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CanGoBack'
4795+type MockWebView_CanGoBack_Call struct {
4796+ *mock.Call
4797+}
4798+
4799+// CanGoBack is a helper method to define mock.On call
4800+func (_e *MockWebView_Expecter) CanGoBack() *MockWebView_CanGoBack_Call {
4801+ return &MockWebView_CanGoBack_Call{Call: _e.mock.On("CanGoBack")}
4802+}
4803+
4804+func (_c *MockWebView_CanGoBack_Call) Run(run func()) *MockWebView_CanGoBack_Call {
4805+ _c.Call.Run(func(args mock.Arguments) {
4806+ run()
4807+ })
4808+ return _c
4809+}
4810+
4811+func (_c *MockWebView_CanGoBack_Call) Return(b bool) *MockWebView_CanGoBack_Call {
4812+ _c.Call.Return(b)
4813+ return _c
4814+}
4815+
4816+func (_c *MockWebView_CanGoBack_Call) RunAndReturn(run func() bool) *MockWebView_CanGoBack_Call {
4817+ _c.Call.Return(run)
4818+ return _c
4819+}
4820+
4821+// CanGoForward provides a mock function for the type MockWebView
4822+func (_mock *MockWebView) CanGoForward() bool {
4823+ ret := _mock.Called()
4824+
4825+ if len(ret) == 0 {
4826+ panic("no return value specified for CanGoForward")
4827+ }
4828+
4829+ var r0 bool
4830+ if returnFunc, ok := ret.Get(0).(func() bool); ok {
4831+ r0 = returnFunc()
4832+ } else {
4833+ r0 = ret.Get(0).(bool)
4834+ }
4835+ return r0
4836+}
4837+
4838+// MockWebView_CanGoForward_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CanGoForward'
4839+type MockWebView_CanGoForward_Call struct {
4840+ *mock.Call
4841+}
4842+
4843+// CanGoForward is a helper method to define mock.On call
4844+func (_e *MockWebView_Expecter) CanGoForward() *MockWebView_CanGoForward_Call {
4845+ return &MockWebView_CanGoForward_Call{Call: _e.mock.On("CanGoForward")}
4846+}
4847+
4848+func (_c *MockWebView_CanGoForward_Call) Run(run func()) *MockWebView_CanGoForward_Call {
4849+ _c.Call.Run(func(args mock.Arguments) {
4850+ run()
4851+ })
4852+ return _c
4853+}
4854+
4855+func (_c *MockWebView_CanGoForward_Call) Return(b bool) *MockWebView_CanGoForward_Call {
4856+ _c.Call.Return(b)
4857+ return _c
4858+}
4859+
4860+func (_c *MockWebView_CanGoForward_Call) RunAndReturn(run func() bool) *MockWebView_CanGoForward_Call {
4861+ _c.Call.Return(run)
4862+ return _c
4863+}
4864+
4865+// Destroy provides a mock function for the type MockWebView
4866+func (_mock *MockWebView) Destroy() {
4867+ _mock.Called()
4868+ return
4869+}
4870+
4871+// MockWebView_Destroy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Destroy'
4872+type MockWebView_Destroy_Call struct {
4873+ *mock.Call
4874+}
4875+
4876+// Destroy is a helper method to define mock.On call
4877+func (_e *MockWebView_Expecter) Destroy() *MockWebView_Destroy_Call {
4878+ return &MockWebView_Destroy_Call{Call: _e.mock.On("Destroy")}
4879+}
4880+
4881+func (_c *MockWebView_Destroy_Call) Run(run func()) *MockWebView_Destroy_Call {
4882+ _c.Call.Run(func(args mock.Arguments) {
4883+ run()
4884+ })
4885+ return _c
4886+}
4887+
4888+func (_c *MockWebView_Destroy_Call) Return() *MockWebView_Destroy_Call {
4889+ _c.Call.Return()
4890+ return _c
4891+}
4892+
4893+func (_c *MockWebView_Destroy_Call) RunAndReturn(run func()) *MockWebView_Destroy_Call {
4894+ _c.Run(run)
4895+ return _c
4896+}
4897+
4898+// EstimatedProgress provides a mock function for the type MockWebView
4899+func (_mock *MockWebView) EstimatedProgress() float64 {
4900+ ret := _mock.Called()
4901+
4902+ if len(ret) == 0 {
4903+ panic("no return value specified for EstimatedProgress")
4904+ }
4905+
4906+ var r0 float64
4907+ if returnFunc, ok := ret.Get(0).(func() float64); ok {
4908+ r0 = returnFunc()
4909+ } else {
4910+ r0 = ret.Get(0).(float64)
4911+ }
4912+ return r0
4913+}
4914+
4915+// MockWebView_EstimatedProgress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EstimatedProgress'
4916+type MockWebView_EstimatedProgress_Call struct {
4917+ *mock.Call
4918+}
4919+
4920+// EstimatedProgress is a helper method to define mock.On call
4921+func (_e *MockWebView_Expecter) EstimatedProgress() *MockWebView_EstimatedProgress_Call {
4922+ return &MockWebView_EstimatedProgress_Call{Call: _e.mock.On("EstimatedProgress")}
4923+}
4924+
4925+func (_c *MockWebView_EstimatedProgress_Call) Run(run func()) *MockWebView_EstimatedProgress_Call {
4926+ _c.Call.Run(func(args mock.Arguments) {
4927+ run()
4928+ })
4929+ return _c
4930+}
4931+
4932+func (_c *MockWebView_EstimatedProgress_Call) Return(f float64) *MockWebView_EstimatedProgress_Call {
4933+ _c.Call.Return(f)
4934+ return _c
4935+}
4936+
4937+func (_c *MockWebView_EstimatedProgress_Call) RunAndReturn(run func() float64) *MockWebView_EstimatedProgress_Call {
4938+ _c.Call.Return(run)
4939+ return _c
4940+}
4941+
4942+// GetFindController provides a mock function for the type MockWebView
4943+func (_mock *MockWebView) GetFindController() port.FindController {
4944+ ret := _mock.Called()
4945+
4946+ if len(ret) == 0 {
4947+ panic("no return value specified for GetFindController")
4948+ }
4949+
4950+ var r0 port.FindController
4951+ if returnFunc, ok := ret.Get(0).(func() port.FindController); ok {
4952+ r0 = returnFunc()
4953+ } else {
4954+ if ret.Get(0) != nil {
4955+ r0 = ret.Get(0).(port.FindController)
4956+ }
4957+ }
4958+ return r0
4959+}
4960+
4961+// MockWebView_GetFindController_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFindController'
4962+type MockWebView_GetFindController_Call struct {
4963+ *mock.Call
4964+}
4965+
4966+// GetFindController is a helper method to define mock.On call
4967+func (_e *MockWebView_Expecter) GetFindController() *MockWebView_GetFindController_Call {
4968+ return &MockWebView_GetFindController_Call{Call: _e.mock.On("GetFindController")}
4969+}
4970+
4971+func (_c *MockWebView_GetFindController_Call) Run(run func()) *MockWebView_GetFindController_Call {
4972+ _c.Call.Run(func(args mock.Arguments) {
4973+ run()
4974+ })
4975+ return _c
4976+}
4977+
4978+func (_c *MockWebView_GetFindController_Call) Return(findController port.FindController) *MockWebView_GetFindController_Call {
4979+ _c.Call.Return(findController)
4980+ return _c
4981+}
4982+
4983+func (_c *MockWebView_GetFindController_Call) RunAndReturn(run func() port.FindController) *MockWebView_GetFindController_Call {
4984+ _c.Call.Return(run)
4985+ return _c
4986+}
4987+
4988+// GetZoomLevel provides a mock function for the type MockWebView
4989+func (_mock *MockWebView) GetZoomLevel() float64 {
4990+ ret := _mock.Called()
4991+
4992+ if len(ret) == 0 {
4993+ panic("no return value specified for GetZoomLevel")
4994+ }
4995+
4996+ var r0 float64
4997+ if returnFunc, ok := ret.Get(0).(func() float64); ok {
4998+ r0 = returnFunc()
4999+ } else {
5000+ r0 = ret.Get(0).(float64)
5001+ }
5002+ return r0
5003+}
5004+
5005+// MockWebView_GetZoomLevel_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetZoomLevel'
5006+type MockWebView_GetZoomLevel_Call struct {
5007+ *mock.Call
5008+}
5009+
5010+// GetZoomLevel is a helper method to define mock.On call
5011+func (_e *MockWebView_Expecter) GetZoomLevel() *MockWebView_GetZoomLevel_Call {
5012+ return &MockWebView_GetZoomLevel_Call{Call: _e.mock.On("GetZoomLevel")}
5013+}
5014+
5015+func (_c *MockWebView_GetZoomLevel_Call) Run(run func()) *MockWebView_GetZoomLevel_Call {
5016+ _c.Call.Run(func(args mock.Arguments) {
5017+ run()
5018+ })
5019+ return _c
5020+}
5021+
5022+func (_c *MockWebView_GetZoomLevel_Call) Return(f float64) *MockWebView_GetZoomLevel_Call {
5023+ _c.Call.Return(f)
5024+ return _c
5025+}
5026+
5027+func (_c *MockWebView_GetZoomLevel_Call) RunAndReturn(run func() float64) *MockWebView_GetZoomLevel_Call {
5028+ _c.Call.Return(run)
5029+ return _c
5030+}
5031+
5032+// GoBack provides a mock function for the type MockWebView
5033+func (_mock *MockWebView) GoBack(ctx context.Context) error {
5034+ ret := _mock.Called(ctx)
5035+
5036+ if len(ret) == 0 {
5037+ panic("no return value specified for GoBack")
5038+ }
5039+
5040+ var r0 error
5041+ if returnFunc, ok := ret.Get(0).(func(context.Context) error); ok {
5042+ r0 = returnFunc(ctx)
5043+ } else {
5044+ r0 = ret.Error(0)
5045+ }
5046+ return r0
5047+}
5048+
5049+// MockWebView_GoBack_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GoBack'
5050+type MockWebView_GoBack_Call struct {
5051+ *mock.Call
5052+}
5053+
5054+// GoBack is a helper method to define mock.On call
5055+// - ctx context.Context
5056+func (_e *MockWebView_Expecter) GoBack(ctx interface{}) *MockWebView_GoBack_Call {
5057+ return &MockWebView_GoBack_Call{Call: _e.mock.On("GoBack", ctx)}
5058+}
5059+
5060+func (_c *MockWebView_GoBack_Call) Run(run func(ctx context.Context)) *MockWebView_GoBack_Call {
5061+ _c.Call.Run(func(args mock.Arguments) {
5062+ var arg0 context.Context
5063+ if args[0] != nil {
5064+ arg0 = args[0].(context.Context)
5065+ }
5066+ run(
5067+ arg0,
5068+ )
5069+ })
5070+ return _c
5071+}
5072+
5073+func (_c *MockWebView_GoBack_Call) Return(err error) *MockWebView_GoBack_Call {
5074+ _c.Call.Return(err)
5075+ return _c
5076+}
5077+
5078+func (_c *MockWebView_GoBack_Call) RunAndReturn(run func(ctx context.Context) error) *MockWebView_GoBack_Call {
5079+ _c.Call.Return(run)
5080+ return _c
5081+}
5082+
5083+// GoForward provides a mock function for the type MockWebView
5084+func (_mock *MockWebView) GoForward(ctx context.Context) error {
5085+ ret := _mock.Called(ctx)
5086+
5087+ if len(ret) == 0 {
5088+ panic("no return value specified for GoForward")
5089+ }
5090+
5091+ var r0 error
5092+ if returnFunc, ok := ret.Get(0).(func(context.Context) error); ok {
5093+ r0 = returnFunc(ctx)
5094+ } else {
5095+ r0 = ret.Error(0)
5096+ }
5097+ return r0
5098+}
5099+
5100+// MockWebView_GoForward_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GoForward'
5101+type MockWebView_GoForward_Call struct {
5102+ *mock.Call
5103+}
5104+
5105+// GoForward is a helper method to define mock.On call
5106+// - ctx context.Context
5107+func (_e *MockWebView_Expecter) GoForward(ctx interface{}) *MockWebView_GoForward_Call {
5108+ return &MockWebView_GoForward_Call{Call: _e.mock.On("GoForward", ctx)}
5109+}
5110+
5111+func (_c *MockWebView_GoForward_Call) Run(run func(ctx context.Context)) *MockWebView_GoForward_Call {
5112+ _c.Call.Run(func(args mock.Arguments) {
5113+ var arg0 context.Context
5114+ if args[0] != nil {
5115+ arg0 = args[0].(context.Context)
5116+ }
5117+ run(
5118+ arg0,
5119+ )
5120+ })
5121+ return _c
5122+}
5123+
5124+func (_c *MockWebView_GoForward_Call) Return(err error) *MockWebView_GoForward_Call {
5125+ _c.Call.Return(err)
5126+ return _c
5127+}
5128+
5129+func (_c *MockWebView_GoForward_Call) RunAndReturn(run func(ctx context.Context) error) *MockWebView_GoForward_Call {
5130+ _c.Call.Return(run)
5131+ return _c
5132+}
5133+
5134+// ID provides a mock function for the type MockWebView
5135+func (_mock *MockWebView) ID() port.WebViewID {
5136+ ret := _mock.Called()
5137+
5138+ if len(ret) == 0 {
5139+ panic("no return value specified for ID")
35655140 }
3566- return r0
3567-}
35685141
3569-// MockWebView_CanGoForward_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CanGoForward'
3570-type MockWebView_CanGoForward_Call struct {
5142+ var r0 port.WebViewID
5143+ if returnFunc, ok := ret.Get(0).(func() port.WebViewID); ok {
5144+ r0 = returnFunc()
5145+ } else {
5146+ r0 = ret.Get(0).(port.WebViewID)
5147+ }
5148+ return r0
5149+}
5150+
5151+// MockWebView_ID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ID'
5152+type MockWebView_ID_Call struct {
35715153 *mock.Call
35725154 }
35735155
3574-// CanGoForward is a helper method to define mock.On call
3575-func (_e *MockWebView_Expecter) CanGoForward() *MockWebView_CanGoForward_Call {
3576- return &MockWebView_CanGoForward_Call{Call: _e.mock.On("CanGoForward")}
5156+// ID is a helper method to define mock.On call
5157+func (_e *MockWebView_Expecter) ID() *MockWebView_ID_Call {
5158+ return &MockWebView_ID_Call{Call: _e.mock.On("ID")}
35775159 }
35785160
3579-func (_c *MockWebView_CanGoForward_Call) Run(run func()) *MockWebView_CanGoForward_Call {
5161+func (_c *MockWebView_ID_Call) Run(run func()) *MockWebView_ID_Call {
35805162 _c.Call.Run(func(args mock.Arguments) {
35815163 run()
35825164 })
35835165 return _c
35845166 }
35855167
3586-func (_c *MockWebView_CanGoForward_Call) Return(b bool) *MockWebView_CanGoForward_Call {
3587- _c.Call.Return(b)
5168+func (_c *MockWebView_ID_Call) Return(webViewID port.WebViewID) *MockWebView_ID_Call {
5169+ _c.Call.Return(webViewID)
35885170 return _c
35895171 }
35905172
3591-func (_c *MockWebView_CanGoForward_Call) RunAndReturn(run func() bool) *MockWebView_CanGoForward_Call {
5173+func (_c *MockWebView_ID_Call) RunAndReturn(run func() port.WebViewID) *MockWebView_ID_Call {
35925174 _c.Call.Return(run)
35935175 return _c
35945176 }
35955177
3596-// Destroy provides a mock function for the type MockWebView
3597-func (_mock *MockWebView) Destroy() {
3598- _mock.Called()
3599- return
5178+// IsDestroyed provides a mock function for the type MockWebView
5179+func (_mock *MockWebView) IsDestroyed() bool {
5180+ ret := _mock.Called()
5181+
5182+ if len(ret) == 0 {
5183+ panic("no return value specified for IsDestroyed")
5184+ }
5185+
5186+ var r0 bool
5187+ if returnFunc, ok := ret.Get(0).(func() bool); ok {
5188+ r0 = returnFunc()
5189+ } else {
5190+ r0 = ret.Get(0).(bool)
5191+ }
5192+ return r0
36005193 }
36015194
3602-// MockWebView_Destroy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Destroy'
3603-type MockWebView_Destroy_Call struct {
5195+// MockWebView_IsDestroyed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsDestroyed'
5196+type MockWebView_IsDestroyed_Call struct {
36045197 *mock.Call
36055198 }
36065199
3607-// Destroy is a helper method to define mock.On call
3608-func (_e *MockWebView_Expecter) Destroy() *MockWebView_Destroy_Call {
3609- return &MockWebView_Destroy_Call{Call: _e.mock.On("Destroy")}
5200+// IsDestroyed is a helper method to define mock.On call
5201+func (_e *MockWebView_Expecter) IsDestroyed() *MockWebView_IsDestroyed_Call {
5202+ return &MockWebView_IsDestroyed_Call{Call: _e.mock.On("IsDestroyed")}
36105203 }
36115204
3612-func (_c *MockWebView_Destroy_Call) Run(run func()) *MockWebView_Destroy_Call {
5205+func (_c *MockWebView_IsDestroyed_Call) Run(run func()) *MockWebView_IsDestroyed_Call {
36135206 _c.Call.Run(func(args mock.Arguments) {
36145207 run()
36155208 })
36165209 return _c
36175210 }
36185211
3619-func (_c *MockWebView_Destroy_Call) Return() *MockWebView_Destroy_Call {
3620- _c.Call.Return()
5212+func (_c *MockWebView_IsDestroyed_Call) Return(b bool) *MockWebView_IsDestroyed_Call {
5213+ _c.Call.Return(b)
36215214 return _c
36225215 }
36235216
3624-func (_c *MockWebView_Destroy_Call) RunAndReturn(run func()) *MockWebView_Destroy_Call {
3625- _c.Run(run)
5217+func (_c *MockWebView_IsDestroyed_Call) RunAndReturn(run func() bool) *MockWebView_IsDestroyed_Call {
5218+ _c.Call.Return(run)
36265219 return _c
36275220 }
36285221
3629-// EstimatedProgress provides a mock function for the type MockWebView
3630-func (_mock *MockWebView) EstimatedProgress() float64 {
5222+// IsFullscreen provides a mock function for the type MockWebView
5223+func (_mock *MockWebView) IsFullscreen() bool {
36315224 ret := _mock.Called()
36325225
36335226 if len(ret) == 0 {
3634- panic("no return value specified for EstimatedProgress")
5227+ panic("no return value specified for IsFullscreen")
36355228 }
36365229
3637- var r0 float64
3638- if returnFunc, ok := ret.Get(0).(func() float64); ok {
5230+ var r0 bool
5231+ if returnFunc, ok := ret.Get(0).(func() bool); ok {
36395232 r0 = returnFunc()
36405233 } else {
3641- r0 = ret.Get(0).(float64)
5234+ r0 = ret.Get(0).(bool)
36425235 }
36435236 return r0
36445237 }
36455238
3646-// MockWebView_EstimatedProgress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EstimatedProgress'
3647-type MockWebView_EstimatedProgress_Call struct {
5239+// MockWebView_IsFullscreen_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsFullscreen'
5240+type MockWebView_IsFullscreen_Call struct {
36485241 *mock.Call
36495242 }
36505243
3651-// EstimatedProgress is a helper method to define mock.On call
3652-func (_e *MockWebView_Expecter) EstimatedProgress() *MockWebView_EstimatedProgress_Call {
3653- return &MockWebView_EstimatedProgress_Call{Call: _e.mock.On("EstimatedProgress")}
5244+// IsFullscreen is a helper method to define mock.On call
5245+func (_e *MockWebView_Expecter) IsFullscreen() *MockWebView_IsFullscreen_Call {
5246+ return &MockWebView_IsFullscreen_Call{Call: _e.mock.On("IsFullscreen")}
36545247 }
36555248
3656-func (_c *MockWebView_EstimatedProgress_Call) Run(run func()) *MockWebView_EstimatedProgress_Call {
5249+func (_c *MockWebView_IsFullscreen_Call) Run(run func()) *MockWebView_IsFullscreen_Call {
36575250 _c.Call.Run(func(args mock.Arguments) {
36585251 run()
36595252 })
36605253 return _c
36615254 }
36625255
3663-func (_c *MockWebView_EstimatedProgress_Call) Return(f float64) *MockWebView_EstimatedProgress_Call {
3664- _c.Call.Return(f)
5256+func (_c *MockWebView_IsFullscreen_Call) Return(b bool) *MockWebView_IsFullscreen_Call {
5257+ _c.Call.Return(b)
36655258 return _c
36665259 }
36675260
3668-func (_c *MockWebView_EstimatedProgress_Call) RunAndReturn(run func() float64) *MockWebView_EstimatedProgress_Call {
5261+func (_c *MockWebView_IsFullscreen_Call) RunAndReturn(run func() bool) *MockWebView_IsFullscreen_Call {
36695262 _c.Call.Return(run)
36705263 return _c
36715264 }
36725265
3673-// GetFindController provides a mock function for the type MockWebView
3674-func (_mock *MockWebView) GetFindController() port.FindController {
5266+// IsLoading provides a mock function for the type MockWebView
5267+func (_mock *MockWebView) IsLoading() bool {
36755268 ret := _mock.Called()
36765269
36775270 if len(ret) == 0 {
3678- panic("no return value specified for GetFindController")
5271+ panic("no return value specified for IsLoading")
36795272 }
36805273
3681- var r0 port.FindController
3682- if returnFunc, ok := ret.Get(0).(func() port.FindController); ok {
5274+ var r0 bool
5275+ if returnFunc, ok := ret.Get(0).(func() bool); ok {
36835276 r0 = returnFunc()
36845277 } else {
3685- if ret.Get(0) != nil {
3686- r0 = ret.Get(0).(port.FindController)
3687- }
5278+ r0 = ret.Get(0).(bool)
36885279 }
36895280 return r0
36905281 }
36915282
3692-// MockWebView_GetFindController_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFindController'
3693-type MockWebView_GetFindController_Call struct {
5283+// MockWebView_IsLoading_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsLoading'
5284+type MockWebView_IsLoading_Call struct {
36945285 *mock.Call
36955286 }
36965287
3697-// GetFindController is a helper method to define mock.On call
3698-func (_e *MockWebView_Expecter) GetFindController() *MockWebView_GetFindController_Call {
3699- return &MockWebView_GetFindController_Call{Call: _e.mock.On("GetFindController")}
5288+// IsLoading is a helper method to define mock.On call
5289+func (_e *MockWebView_Expecter) IsLoading() *MockWebView_IsLoading_Call {
5290+ return &MockWebView_IsLoading_Call{Call: _e.mock.On("IsLoading")}
37005291 }
37015292
3702-func (_c *MockWebView_GetFindController_Call) Run(run func()) *MockWebView_GetFindController_Call {
5293+func (_c *MockWebView_IsLoading_Call) Run(run func()) *MockWebView_IsLoading_Call {
37035294 _c.Call.Run(func(args mock.Arguments) {
37045295 run()
37055296 })
37065297 return _c
37075298 }
37085299
3709-func (_c *MockWebView_GetFindController_Call) Return(findController port.FindController) *MockWebView_GetFindController_Call {
3710- _c.Call.Return(findController)
5300+func (_c *MockWebView_IsLoading_Call) Return(b bool) *MockWebView_IsLoading_Call {
5301+ _c.Call.Return(b)
37115302 return _c
37125303 }
37135304
3714-func (_c *MockWebView_GetFindController_Call) RunAndReturn(run func() port.FindController) *MockWebView_GetFindController_Call {
5305+func (_c *MockWebView_IsLoading_Call) RunAndReturn(run func() bool) *MockWebView_IsLoading_Call {
37155306 _c.Call.Return(run)
37165307 return _c
37175308 }
37185309
3719-// GetZoomLevel provides a mock function for the type MockWebView
3720-func (_mock *MockWebView) GetZoomLevel() float64 {
5310+// IsPlayingAudio provides a mock function for the type MockWebView
5311+func (_mock *MockWebView) IsPlayingAudio() bool {
37215312 ret := _mock.Called()
37225313
37235314 if len(ret) == 0 {
3724- panic("no return value specified for GetZoomLevel")
5315+ panic("no return value specified for IsPlayingAudio")
37255316 }
37265317
3727- var r0 float64
3728- if returnFunc, ok := ret.Get(0).(func() float64); ok {
5318+ var r0 bool
5319+ if returnFunc, ok := ret.Get(0).(func() bool); ok {
37295320 r0 = returnFunc()
37305321 } else {
3731- r0 = ret.Get(0).(float64)
5322+ r0 = ret.Get(0).(bool)
37325323 }
37335324 return r0
37345325 }
37355326
3736-// MockWebView_GetZoomLevel_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetZoomLevel'
3737-type MockWebView_GetZoomLevel_Call struct {
5327+// MockWebView_IsPlayingAudio_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsPlayingAudio'
5328+type MockWebView_IsPlayingAudio_Call struct {
37385329 *mock.Call
37395330 }
37405331
3741-// GetZoomLevel is a helper method to define mock.On call
3742-func (_e *MockWebView_Expecter) GetZoomLevel() *MockWebView_GetZoomLevel_Call {
3743- return &MockWebView_GetZoomLevel_Call{Call: _e.mock.On("GetZoomLevel")}
5332+// IsPlayingAudio is a helper method to define mock.On call
5333+func (_e *MockWebView_Expecter) IsPlayingAudio() *MockWebView_IsPlayingAudio_Call {
5334+ return &MockWebView_IsPlayingAudio_Call{Call: _e.mock.On("IsPlayingAudio")}
37445335 }
37455336
3746-func (_c *MockWebView_GetZoomLevel_Call) Run(run func()) *MockWebView_GetZoomLevel_Call {
5337+func (_c *MockWebView_IsPlayingAudio_Call) Run(run func()) *MockWebView_IsPlayingAudio_Call {
37475338 _c.Call.Run(func(args mock.Arguments) {
37485339 run()
37495340 })
37505341 return _c
37515342 }
37525343
3753-func (_c *MockWebView_GetZoomLevel_Call) Return(f float64) *MockWebView_GetZoomLevel_Call {
3754- _c.Call.Return(f)
5344+func (_c *MockWebView_IsPlayingAudio_Call) Return(b bool) *MockWebView_IsPlayingAudio_Call {
5345+ _c.Call.Return(b)
37555346 return _c
37565347 }
37575348
3758-func (_c *MockWebView_GetZoomLevel_Call) RunAndReturn(run func() float64) *MockWebView_GetZoomLevel_Call {
5349+func (_c *MockWebView_IsPlayingAudio_Call) RunAndReturn(run func() bool) *MockWebView_IsPlayingAudio_Call {
37595350 _c.Call.Return(run)
37605351 return _c
37615352 }
37625353
3763-// GoBack provides a mock function for the type MockWebView
3764-func (_mock *MockWebView) GoBack(ctx context.Context) error {
3765- ret := _mock.Called(ctx)
5354+// LoadHTML provides a mock function for the type MockWebView
5355+func (_mock *MockWebView) LoadHTML(ctx context.Context, content string, baseURI string) error {
5356+ ret := _mock.Called(ctx, content, baseURI)
37665357
37675358 if len(ret) == 0 {
3768- panic("no return value specified for GoBack")
5359+ panic("no return value specified for LoadHTML")
37695360 }
37705361
37715362 var r0 error
3772- if returnFunc, ok := ret.Get(0).(func(context.Context) error); ok {
3773- r0 = returnFunc(ctx)
5363+ if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) error); ok {
5364+ r0 = returnFunc(ctx, content, baseURI)
37745365 } else {
37755366 r0 = ret.Error(0)
37765367 }
37775368 return r0
37785369 }
37795370
3780-// MockWebView_GoBack_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GoBack'
3781-type MockWebView_GoBack_Call struct {
5371+// MockWebView_LoadHTML_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadHTML'
5372+type MockWebView_LoadHTML_Call struct {
37825373 *mock.Call
37835374 }
37845375
3785-// GoBack is a helper method to define mock.On call
5376+// LoadHTML is a helper method to define mock.On call
37865377 // - ctx context.Context
3787-func (_e *MockWebView_Expecter) GoBack(ctx interface{}) *MockWebView_GoBack_Call {
3788- return &MockWebView_GoBack_Call{Call: _e.mock.On("GoBack", ctx)}
5378+// - content string
5379+// - baseURI string
5380+func (_e *MockWebView_Expecter) LoadHTML(ctx interface{}, content interface{}, baseURI interface{}) *MockWebView_LoadHTML_Call {
5381+ return &MockWebView_LoadHTML_Call{Call: _e.mock.On("LoadHTML", ctx, content, baseURI)}
37895382 }
37905383
3791-func (_c *MockWebView_GoBack_Call) Run(run func(ctx context.Context)) *MockWebView_GoBack_Call {
5384+func (_c *MockWebView_LoadHTML_Call) Run(run func(ctx context.Context, content string, baseURI string)) *MockWebView_LoadHTML_Call {
37925385 _c.Call.Run(func(args mock.Arguments) {
37935386 var arg0 context.Context
37945387 if args[0] != nil {
37955388 arg0 = args[0].(context.Context)
37965389 }
5390+ var arg1 string
5391+ if args[1] != nil {
5392+ arg1 = args[1].(string)
5393+ }
5394+ var arg2 string
5395+ if args[2] != nil {
5396+ arg2 = args[2].(string)
5397+ }
37975398 run(
37985399 arg0,
5400+ arg1,
5401+ arg2,
37995402 )
38005403 })
38015404 return _c
38025405 }
38035406
3804-func (_c *MockWebView_GoBack_Call) Return(err error) *MockWebView_GoBack_Call {
5407+func (_c *MockWebView_LoadHTML_Call) Return(err error) *MockWebView_LoadHTML_Call {
38055408 _c.Call.Return(err)
38065409 return _c
38075410 }
38085411
3809-func (_c *MockWebView_GoBack_Call) RunAndReturn(run func(ctx context.Context) error) *MockWebView_GoBack_Call {
5412+func (_c *MockWebView_LoadHTML_Call) RunAndReturn(run func(ctx context.Context, content string, baseURI string) error) *MockWebView_LoadHTML_Call {
38105413 _c.Call.Return(run)
38115414 return _c
38125415 }
38135416
3814-// GoForward provides a mock function for the type MockWebView
3815-func (_mock *MockWebView) GoForward(ctx context.Context) error {
3816- ret := _mock.Called(ctx)
5417+// LoadURI provides a mock function for the type MockWebView
5418+func (_mock *MockWebView) LoadURI(ctx context.Context, uri string) error {
5419+ ret := _mock.Called(ctx, uri)
38175420
38185421 if len(ret) == 0 {
3819- panic("no return value specified for GoForward")
5422+ panic("no return value specified for LoadURI")
38205423 }
38215424
38225425 var r0 error
3823- if returnFunc, ok := ret.Get(0).(func(context.Context) error); ok {
3824- r0 = returnFunc(ctx)
5426+ if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok {
5427+ r0 = returnFunc(ctx, uri)
38255428 } else {
38265429 r0 = ret.Error(0)
38275430 }
38285431 return r0
38295432 }
38305433
3831-// MockWebView_GoForward_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GoForward'
3832-type MockWebView_GoForward_Call struct {
5434+// MockWebView_LoadURI_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadURI'
5435+type MockWebView_LoadURI_Call struct {
38335436 *mock.Call
38345437 }
38355438
3836-// GoForward is a helper method to define mock.On call
5439+// LoadURI is a helper method to define mock.On call
38375440 // - ctx context.Context
3838-func (_e *MockWebView_Expecter) GoForward(ctx interface{}) *MockWebView_GoForward_Call {
3839- return &MockWebView_GoForward_Call{Call: _e.mock.On("GoForward", ctx)}
5441+// - uri string
5442+func (_e *MockWebView_Expecter) LoadURI(ctx interface{}, uri interface{}) *MockWebView_LoadURI_Call {
5443+ return &MockWebView_LoadURI_Call{Call: _e.mock.On("LoadURI", ctx, uri)}
38405444 }
38415445
3842-func (_c *MockWebView_GoForward_Call) Run(run func(ctx context.Context)) *MockWebView_GoForward_Call {
5446+func (_c *MockWebView_LoadURI_Call) Run(run func(ctx context.Context, uri string)) *MockWebView_LoadURI_Call {
38435447 _c.Call.Run(func(args mock.Arguments) {
38445448 var arg0 context.Context
38455449 if args[0] != nil {
38465450 arg0 = args[0].(context.Context)
38475451 }
5452+ var arg1 string
5453+ if args[1] != nil {
5454+ arg1 = args[1].(string)
5455+ }
38485456 run(
38495457 arg0,
5458+ arg1,
38505459 )
38515460 })
38525461 return _c
38535462 }
38545463
3855-func (_c *MockWebView_GoForward_Call) Return(err error) *MockWebView_GoForward_Call {
5464+func (_c *MockWebView_LoadURI_Call) Return(err error) *MockWebView_LoadURI_Call {
38565465 _c.Call.Return(err)
38575466 return _c
38585467 }
38595468
3860-func (_c *MockWebView_GoForward_Call) RunAndReturn(run func(ctx context.Context) error) *MockWebView_GoForward_Call {
5469+func (_c *MockWebView_LoadURI_Call) RunAndReturn(run func(ctx context.Context, uri string) error) *MockWebView_LoadURI_Call {
38615470 _c.Call.Return(run)
38625471 return _c
38635472 }
38645473
3865-// ID provides a mock function for the type MockWebView
3866-func (_mock *MockWebView) ID() port.WebViewID {
3867- ret := _mock.Called()
5474+// Reload provides a mock function for the type MockWebView
5475+func (_mock *MockWebView) Reload(ctx context.Context) error {
5476+ ret := _mock.Called(ctx)
38685477
38695478 if len(ret) == 0 {
3870- panic("no return value specified for ID")
5479+ panic("no return value specified for Reload")
38715480 }
38725481
3873- var r0 port.WebViewID
3874- if returnFunc, ok := ret.Get(0).(func() port.WebViewID); ok {
3875- r0 = returnFunc()
5482+ var r0 error
5483+ if returnFunc, ok := ret.Get(0).(func(context.Context) error); ok {
5484+ r0 = returnFunc(ctx)
38765485 } else {
3877- r0 = ret.Get(0).(port.WebViewID)
5486+ r0 = ret.Error(0)
38785487 }
38795488 return r0
38805489 }
38815490
3882-// MockWebView_ID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ID'
3883-type MockWebView_ID_Call struct {
5491+// MockWebView_Reload_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Reload'
5492+type MockWebView_Reload_Call struct {
38845493 *mock.Call
38855494 }
38865495
3887-// ID is a helper method to define mock.On call
3888-func (_e *MockWebView_Expecter) ID() *MockWebView_ID_Call {
3889- return &MockWebView_ID_Call{Call: _e.mock.On("ID")}
5496+// Reload is a helper method to define mock.On call
5497+// - ctx context.Context
5498+func (_e *MockWebView_Expecter) Reload(ctx interface{}) *MockWebView_Reload_Call {
5499+ return &MockWebView_Reload_Call{Call: _e.mock.On("Reload", ctx)}
38905500 }
38915501
3892-func (_c *MockWebView_ID_Call) Run(run func()) *MockWebView_ID_Call {
5502+func (_c *MockWebView_Reload_Call) Run(run func(ctx context.Context)) *MockWebView_Reload_Call {
38935503 _c.Call.Run(func(args mock.Arguments) {
3894- run()
5504+ var arg0 context.Context
5505+ if args[0] != nil {
5506+ arg0 = args[0].(context.Context)
5507+ }
5508+ run(
5509+ arg0,
5510+ )
38955511 })
38965512 return _c
38975513 }
38985514
3899-func (_c *MockWebView_ID_Call) Return(webViewID port.WebViewID) *MockWebView_ID_Call {
3900- _c.Call.Return(webViewID)
5515+func (_c *MockWebView_Reload_Call) Return(err error) *MockWebView_Reload_Call {
5516+ _c.Call.Return(err)
39015517 return _c
39025518 }
39035519
3904-func (_c *MockWebView_ID_Call) RunAndReturn(run func() port.WebViewID) *MockWebView_ID_Call {
5520+func (_c *MockWebView_Reload_Call) RunAndReturn(run func(ctx context.Context) error) *MockWebView_Reload_Call {
39055521 _c.Call.Return(run)
39065522 return _c
39075523 }
39085524
3909-// IsDestroyed provides a mock function for the type MockWebView
3910-func (_mock *MockWebView) IsDestroyed() bool {
3911- ret := _mock.Called()
5525+// ReloadBypassCache provides a mock function for the type MockWebView
5526+func (_mock *MockWebView) ReloadBypassCache(ctx context.Context) error {
5527+ ret := _mock.Called(ctx)
39125528
39135529 if len(ret) == 0 {
3914- panic("no return value specified for IsDestroyed")
5530+ panic("no return value specified for ReloadBypassCache")
39155531 }
39165532
3917- var r0 bool
3918- if returnFunc, ok := ret.Get(0).(func() bool); ok {
3919- r0 = returnFunc()
5533+ var r0 error
5534+ if returnFunc, ok := ret.Get(0).(func(context.Context) error); ok {
5535+ r0 = returnFunc(ctx)
39205536 } else {
3921- r0 = ret.Get(0).(bool)
5537+ r0 = ret.Error(0)
39225538 }
39235539 return r0
39245540 }
39255541
3926-// MockWebView_IsDestroyed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsDestroyed'
3927-type MockWebView_IsDestroyed_Call struct {
5542+// MockWebView_ReloadBypassCache_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReloadBypassCache'
5543+type MockWebView_ReloadBypassCache_Call struct {
39285544 *mock.Call
39295545 }
39305546
3931-// IsDestroyed is a helper method to define mock.On call
3932-func (_e *MockWebView_Expecter) IsDestroyed() *MockWebView_IsDestroyed_Call {
3933- return &MockWebView_IsDestroyed_Call{Call: _e.mock.On("IsDestroyed")}
5547+// ReloadBypassCache is a helper method to define mock.On call
5548+// - ctx context.Context
5549+func (_e *MockWebView_Expecter) ReloadBypassCache(ctx interface{}) *MockWebView_ReloadBypassCache_Call {
5550+ return &MockWebView_ReloadBypassCache_Call{Call: _e.mock.On("ReloadBypassCache", ctx)}
39345551 }
39355552
3936-func (_c *MockWebView_IsDestroyed_Call) Run(run func()) *MockWebView_IsDestroyed_Call {
5553+func (_c *MockWebView_ReloadBypassCache_Call) Run(run func(ctx context.Context)) *MockWebView_ReloadBypassCache_Call {
39375554 _c.Call.Run(func(args mock.Arguments) {
3938- run()
5555+ var arg0 context.Context
5556+ if args[0] != nil {
5557+ arg0 = args[0].(context.Context)
5558+ }
5559+ run(
5560+ arg0,
5561+ )
39395562 })
39405563 return _c
39415564 }
39425565
3943-func (_c *MockWebView_IsDestroyed_Call) Return(b bool) *MockWebView_IsDestroyed_Call {
3944- _c.Call.Return(b)
5566+func (_c *MockWebView_ReloadBypassCache_Call) Return(err error) *MockWebView_ReloadBypassCache_Call {
5567+ _c.Call.Return(err)
39455568 return _c
39465569 }
39475570
3948-func (_c *MockWebView_IsDestroyed_Call) RunAndReturn(run func() bool) *MockWebView_IsDestroyed_Call {
5571+func (_c *MockWebView_ReloadBypassCache_Call) RunAndReturn(run func(ctx context.Context) error) *MockWebView_ReloadBypassCache_Call {
39495572 _c.Call.Return(run)
39505573 return _c
39515574 }
39525575
3953-// IsFullscreen provides a mock function for the type MockWebView
3954-func (_mock *MockWebView) IsFullscreen() bool {
3955- ret := _mock.Called()
3956-
3957- if len(ret) == 0 {
3958- panic("no return value specified for IsFullscreen")
3959- }
3960-
3961- var r0 bool
3962- if returnFunc, ok := ret.Get(0).(func() bool); ok {
3963- r0 = returnFunc()
3964- } else {
3965- r0 = ret.Get(0).(bool)
3966- }
3967- return r0
5576+// SetCallbacks provides a mock function for the type MockWebView
5577+func (_mock *MockWebView) SetCallbacks(callbacks *port.WebViewCallbacks) {
5578+ _mock.Called(callbacks)
5579+ return
39685580 }
39695581
3970-// MockWebView_IsFullscreen_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsFullscreen'
3971-type MockWebView_IsFullscreen_Call struct {
5582+// MockWebView_SetCallbacks_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCallbacks'
5583+type MockWebView_SetCallbacks_Call struct {
39725584 *mock.Call
39735585 }
39745586
3975-// IsFullscreen is a helper method to define mock.On call
3976-func (_e *MockWebView_Expecter) IsFullscreen() *MockWebView_IsFullscreen_Call {
3977- return &MockWebView_IsFullscreen_Call{Call: _e.mock.On("IsFullscreen")}
5587+// SetCallbacks is a helper method to define mock.On call
5588+// - callbacks *port.WebViewCallbacks
5589+func (_e *MockWebView_Expecter) SetCallbacks(callbacks interface{}) *MockWebView_SetCallbacks_Call {
5590+ return &MockWebView_SetCallbacks_Call{Call: _e.mock.On("SetCallbacks", callbacks)}
39785591 }
39795592
3980-func (_c *MockWebView_IsFullscreen_Call) Run(run func()) *MockWebView_IsFullscreen_Call {
5593+func (_c *MockWebView_SetCallbacks_Call) Run(run func(callbacks *port.WebViewCallbacks)) *MockWebView_SetCallbacks_Call {
39815594 _c.Call.Run(func(args mock.Arguments) {
3982- run()
5595+ var arg0 *port.WebViewCallbacks
5596+ if args[0] != nil {
5597+ arg0 = args[0].(*port.WebViewCallbacks)
5598+ }
5599+ run(
5600+ arg0,
5601+ )
39835602 })
39845603 return _c
39855604 }
39865605
3987-func (_c *MockWebView_IsFullscreen_Call) Return(b bool) *MockWebView_IsFullscreen_Call {
3988- _c.Call.Return(b)
5606+func (_c *MockWebView_SetCallbacks_Call) Return() *MockWebView_SetCallbacks_Call {
5607+ _c.Call.Return()
39895608 return _c
39905609 }
39915610
3992-func (_c *MockWebView_IsFullscreen_Call) RunAndReturn(run func() bool) *MockWebView_IsFullscreen_Call {
3993- _c.Call.Return(run)
5611+func (_c *MockWebView_SetCallbacks_Call) RunAndReturn(run func(callbacks *port.WebViewCallbacks)) *MockWebView_SetCallbacks_Call {
5612+ _c.Run(run)
39945613 return _c
39955614 }
39965615
3997-// IsLoading provides a mock function for the type MockWebView
3998-func (_mock *MockWebView) IsLoading() bool {
3999- ret := _mock.Called()
5616+// SetZoomLevel provides a mock function for the type MockWebView
5617+func (_mock *MockWebView) SetZoomLevel(ctx context.Context, level float64) error {
5618+ ret := _mock.Called(ctx, level)
40005619
40015620 if len(ret) == 0 {
4002- panic("no return value specified for IsLoading")
5621+ panic("no return value specified for SetZoomLevel")
40035622 }
40045623
4005- var r0 bool
4006- if returnFunc, ok := ret.Get(0).(func() bool); ok {
4007- r0 = returnFunc()
5624+ var r0 error
5625+ if returnFunc, ok := ret.Get(0).(func(context.Context, float64) error); ok {
5626+ r0 = returnFunc(ctx, level)
40085627 } else {
4009- r0 = ret.Get(0).(bool)
5628+ r0 = ret.Error(0)
40105629 }
40115630 return r0
40125631 }
40135632
4014-// MockWebView_IsLoading_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsLoading'
4015-type MockWebView_IsLoading_Call struct {
5633+// MockWebView_SetZoomLevel_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetZoomLevel'
5634+type MockWebView_SetZoomLevel_Call struct {
40165635 *mock.Call
40175636 }
40185637
4019-// IsLoading is a helper method to define mock.On call
4020-func (_e *MockWebView_Expecter) IsLoading() *MockWebView_IsLoading_Call {
4021- return &MockWebView_IsLoading_Call{Call: _e.mock.On("IsLoading")}
5638+// SetZoomLevel is a helper method to define mock.On call
5639+// - ctx context.Context
5640+// - level float64
5641+func (_e *MockWebView_Expecter) SetZoomLevel(ctx interface{}, level interface{}) *MockWebView_SetZoomLevel_Call {
5642+ return &MockWebView_SetZoomLevel_Call{Call: _e.mock.On("SetZoomLevel", ctx, level)}
40225643 }
40235644
4024-func (_c *MockWebView_IsLoading_Call) Run(run func()) *MockWebView_IsLoading_Call {
5645+func (_c *MockWebView_SetZoomLevel_Call) Run(run func(ctx context.Context, level float64)) *MockWebView_SetZoomLevel_Call {
40255646 _c.Call.Run(func(args mock.Arguments) {
4026- run()
5647+ var arg0 context.Context
5648+ if args[0] != nil {
5649+ arg0 = args[0].(context.Context)
5650+ }
5651+ var arg1 float64
5652+ if args[1] != nil {
5653+ arg1 = args[1].(float64)
5654+ }
5655+ run(
5656+ arg0,
5657+ arg1,
5658+ )
40275659 })
40285660 return _c
40295661 }
40305662
4031-func (_c *MockWebView_IsLoading_Call) Return(b bool) *MockWebView_IsLoading_Call {
4032- _c.Call.Return(b)
5663+func (_c *MockWebView_SetZoomLevel_Call) Return(err error) *MockWebView_SetZoomLevel_Call {
5664+ _c.Call.Return(err)
40335665 return _c
40345666 }
40355667
4036-func (_c *MockWebView_IsLoading_Call) RunAndReturn(run func() bool) *MockWebView_IsLoading_Call {
5668+func (_c *MockWebView_SetZoomLevel_Call) RunAndReturn(run func(ctx context.Context, level float64) error) *MockWebView_SetZoomLevel_Call {
40375669 _c.Call.Return(run)
40385670 return _c
40395671 }
40405672
4041-// IsPlayingAudio provides a mock function for the type MockWebView
4042-func (_mock *MockWebView) IsPlayingAudio() bool {
5673+// State provides a mock function for the type MockWebView
5674+func (_mock *MockWebView) State() port.WebViewState {
40435675 ret := _mock.Called()
40445676
40455677 if len(ret) == 0 {
4046- panic("no return value specified for IsPlayingAudio")
5678+ panic("no return value specified for State")
40475679 }
40485680
4049- var r0 bool
4050- if returnFunc, ok := ret.Get(0).(func() bool); ok {
5681+ var r0 port.WebViewState
5682+ if returnFunc, ok := ret.Get(0).(func() port.WebViewState); ok {
40515683 r0 = returnFunc()
40525684 } else {
4053- r0 = ret.Get(0).(bool)
5685+ r0 = ret.Get(0).(port.WebViewState)
40545686 }
40555687 return r0
40565688 }
40575689
4058-// MockWebView_IsPlayingAudio_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsPlayingAudio'
4059-type MockWebView_IsPlayingAudio_Call struct {
5690+// MockWebView_State_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'State'
5691+type MockWebView_State_Call struct {
40605692 *mock.Call
40615693 }
40625694
4063-// IsPlayingAudio is a helper method to define mock.On call
4064-func (_e *MockWebView_Expecter) IsPlayingAudio() *MockWebView_IsPlayingAudio_Call {
4065- return &MockWebView_IsPlayingAudio_Call{Call: _e.mock.On("IsPlayingAudio")}
5695+// State is a helper method to define mock.On call
5696+func (_e *MockWebView_Expecter) State() *MockWebView_State_Call {
5697+ return &MockWebView_State_Call{Call: _e.mock.On("State")}
40665698 }
40675699
4068-func (_c *MockWebView_IsPlayingAudio_Call) Run(run func()) *MockWebView_IsPlayingAudio_Call {
5700+func (_c *MockWebView_State_Call) Run(run func()) *MockWebView_State_Call {
40695701 _c.Call.Run(func(args mock.Arguments) {
40705702 run()
40715703 })
40725704 return _c
40735705 }
40745706
4075-func (_c *MockWebView_IsPlayingAudio_Call) Return(b bool) *MockWebView_IsPlayingAudio_Call {
4076- _c.Call.Return(b)
5707+func (_c *MockWebView_State_Call) Return(webViewState port.WebViewState) *MockWebView_State_Call {
5708+ _c.Call.Return(webViewState)
40775709 return _c
40785710 }
40795711
4080-func (_c *MockWebView_IsPlayingAudio_Call) RunAndReturn(run func() bool) *MockWebView_IsPlayingAudio_Call {
5712+func (_c *MockWebView_State_Call) RunAndReturn(run func() port.WebViewState) *MockWebView_State_Call {
40815713 _c.Call.Return(run)
40825714 return _c
40835715 }
40845716
4085-// LoadHTML provides a mock function for the type MockWebView
4086-func (_mock *MockWebView) LoadHTML(ctx context.Context, content string, baseURI string) error {
4087- ret := _mock.Called(ctx, content, baseURI)
5717+// Stop provides a mock function for the type MockWebView
5718+func (_mock *MockWebView) Stop(ctx context.Context) error {
5719+ ret := _mock.Called(ctx)
40885720
40895721 if len(ret) == 0 {
4090- panic("no return value specified for LoadHTML")
5722+ panic("no return value specified for Stop")
40915723 }
40925724
40935725 var r0 error
4094- if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) error); ok {
4095- r0 = returnFunc(ctx, content, baseURI)
5726+ if returnFunc, ok := ret.Get(0).(func(context.Context) error); ok {
5727+ r0 = returnFunc(ctx)
40965728 } else {
40975729 r0 = ret.Error(0)
40985730 }
40995731 return r0
41005732 }
41015733
4102-// MockWebView_LoadHTML_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadHTML'
4103-type MockWebView_LoadHTML_Call struct {
5734+// MockWebView_Stop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Stop'
5735+type MockWebView_Stop_Call struct {
41045736 *mock.Call
41055737 }
41065738
4107-// LoadHTML is a helper method to define mock.On call
5739+// Stop is a helper method to define mock.On call
41085740 // - ctx context.Context
4109-// - content string
4110-// - baseURI string
4111-func (_e *MockWebView_Expecter) LoadHTML(ctx interface{}, content interface{}, baseURI interface{}) *MockWebView_LoadHTML_Call {
4112- return &MockWebView_LoadHTML_Call{Call: _e.mock.On("LoadHTML", ctx, content, baseURI)}
5741+func (_e *MockWebView_Expecter) Stop(ctx interface{}) *MockWebView_Stop_Call {
5742+ return &MockWebView_Stop_Call{Call: _e.mock.On("Stop", ctx)}
41135743 }
41145744
4115-func (_c *MockWebView_LoadHTML_Call) Run(run func(ctx context.Context, content string, baseURI string)) *MockWebView_LoadHTML_Call {
5745+func (_c *MockWebView_Stop_Call) Run(run func(ctx context.Context)) *MockWebView_Stop_Call {
41165746 _c.Call.Run(func(args mock.Arguments) {
41175747 var arg0 context.Context
41185748 if args[0] != nil {
41195749 arg0 = args[0].(context.Context)
41205750 }
4121- var arg1 string
4122- if args[1] != nil {
4123- arg1 = args[1].(string)
4124- }
4125- var arg2 string
4126- if args[2] != nil {
4127- arg2 = args[2].(string)
4128- }
41295751 run(
41305752 arg0,
4131- arg1,
4132- arg2,
41335753 )
41345754 })
41355755 return _c
41365756 }
41375757
4138-func (_c *MockWebView_LoadHTML_Call) Return(err error) *MockWebView_LoadHTML_Call {
4139- _c.Call.Return(err)
5758+func (_c *MockWebView_Stop_Call) Return(err error) *MockWebView_Stop_Call {
5759+ _c.Call.Return(err)
5760+ return _c
5761+}
5762+
5763+func (_c *MockWebView_Stop_Call) RunAndReturn(run func(ctx context.Context) error) *MockWebView_Stop_Call {
5764+ _c.Call.Return(run)
5765+ return _c
5766+}
5767+
5768+// Title provides a mock function for the type MockWebView
5769+func (_mock *MockWebView) Title() string {
5770+ ret := _mock.Called()
5771+
5772+ if len(ret) == 0 {
5773+ panic("no return value specified for Title")
5774+ }
5775+
5776+ var r0 string
5777+ if returnFunc, ok := ret.Get(0).(func() string); ok {
5778+ r0 = returnFunc()
5779+ } else {
5780+ r0 = ret.Get(0).(string)
5781+ }
5782+ return r0
5783+}
5784+
5785+// MockWebView_Title_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Title'
5786+type MockWebView_Title_Call struct {
5787+ *mock.Call
5788+}
5789+
5790+// Title is a helper method to define mock.On call
5791+func (_e *MockWebView_Expecter) Title() *MockWebView_Title_Call {
5792+ return &MockWebView_Title_Call{Call: _e.mock.On("Title")}
5793+}
5794+
5795+func (_c *MockWebView_Title_Call) Run(run func()) *MockWebView_Title_Call {
5796+ _c.Call.Run(func(args mock.Arguments) {
5797+ run()
5798+ })
5799+ return _c
5800+}
5801+
5802+func (_c *MockWebView_Title_Call) Return(s string) *MockWebView_Title_Call {
5803+ _c.Call.Return(s)
41405804 return _c
41415805 }
41425806
4143-func (_c *MockWebView_LoadHTML_Call) RunAndReturn(run func(ctx context.Context, content string, baseURI string) error) *MockWebView_LoadHTML_Call {
5807+func (_c *MockWebView_Title_Call) RunAndReturn(run func() string) *MockWebView_Title_Call {
41445808 _c.Call.Return(run)
41455809 return _c
41465810 }
41475811
4148-// LoadURI provides a mock function for the type MockWebView
4149-func (_mock *MockWebView) LoadURI(ctx context.Context, uri string) error {
4150- ret := _mock.Called(ctx, uri)
5812+// URI provides a mock function for the type MockWebView
5813+func (_mock *MockWebView) URI() string {
5814+ ret := _mock.Called()
41515815
41525816 if len(ret) == 0 {
4153- panic("no return value specified for LoadURI")
5817+ panic("no return value specified for URI")
41545818 }
41555819
4156- var r0 error
4157- if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok {
4158- r0 = returnFunc(ctx, uri)
5820+ var r0 string
5821+ if returnFunc, ok := ret.Get(0).(func() string); ok {
5822+ r0 = returnFunc()
41595823 } else {
4160- r0 = ret.Error(0)
5824+ r0 = ret.Get(0).(string)
41615825 }
41625826 return r0
41635827 }
41645828
4165-// MockWebView_LoadURI_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadURI'
4166-type MockWebView_LoadURI_Call struct {
5829+// MockWebView_URI_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'URI'
5830+type MockWebView_URI_Call struct {
41675831 *mock.Call
41685832 }
41695833
4170-// LoadURI is a helper method to define mock.On call
4171-// - ctx context.Context
4172-// - uri string
4173-func (_e *MockWebView_Expecter) LoadURI(ctx interface{}, uri interface{}) *MockWebView_LoadURI_Call {
4174- return &MockWebView_LoadURI_Call{Call: _e.mock.On("LoadURI", ctx, uri)}
5834+// URI is a helper method to define mock.On call
5835+func (_e *MockWebView_Expecter) URI() *MockWebView_URI_Call {
5836+ return &MockWebView_URI_Call{Call: _e.mock.On("URI")}
41755837 }
41765838
4177-func (_c *MockWebView_LoadURI_Call) Run(run func(ctx context.Context, uri string)) *MockWebView_LoadURI_Call {
5839+func (_c *MockWebView_URI_Call) Run(run func()) *MockWebView_URI_Call {
41785840 _c.Call.Run(func(args mock.Arguments) {
4179- var arg0 context.Context
4180- if args[0] != nil {
4181- arg0 = args[0].(context.Context)
4182- }
4183- var arg1 string
4184- if args[1] != nil {
4185- arg1 = args[1].(string)
4186- }
4187- run(
4188- arg0,
4189- arg1,
4190- )
5841+ run()
41915842 })
41925843 return _c
41935844 }
41945845
4195-func (_c *MockWebView_LoadURI_Call) Return(err error) *MockWebView_LoadURI_Call {
4196- _c.Call.Return(err)
5846+func (_c *MockWebView_URI_Call) Return(s string) *MockWebView_URI_Call {
5847+ _c.Call.Return(s)
41975848 return _c
41985849 }
41995850
4200-func (_c *MockWebView_LoadURI_Call) RunAndReturn(run func(ctx context.Context, uri string) error) *MockWebView_LoadURI_Call {
5851+func (_c *MockWebView_URI_Call) RunAndReturn(run func() string) *MockWebView_URI_Call {
42015852 _c.Call.Return(run)
42025853 return _c
42035854 }
42045855
4205-// Reload provides a mock function for the type MockWebView
4206-func (_mock *MockWebView) Reload(ctx context.Context) error {
5856+// NewMockWebViewPool creates a new instance of MockWebViewPool. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
5857+// The first argument is typically a *testing.T value.
5858+func NewMockWebViewPool(t interface {
5859+ mock.TestingT
5860+ Cleanup(func())
5861+}) *MockWebViewPool {
5862+ mock := &MockWebViewPool{}
5863+ mock.Mock.Test(t)
5864+
5865+ t.Cleanup(func() { mock.AssertExpectations(t) })
5866+
5867+ return mock
5868+}
5869+
5870+// MockWebViewPool is an autogenerated mock type for the WebViewPool type
5871+type MockWebViewPool struct {
5872+ mock.Mock
5873+}
5874+
5875+type MockWebViewPool_Expecter struct {
5876+ mock *mock.Mock
5877+}
5878+
5879+func (_m *MockWebViewPool) EXPECT() *MockWebViewPool_Expecter {
5880+ return &MockWebViewPool_Expecter{mock: &_m.Mock}
5881+}
5882+
5883+// Acquire provides a mock function for the type MockWebViewPool
5884+func (_mock *MockWebViewPool) Acquire(ctx context.Context) (port.WebView, error) {
42075885 ret := _mock.Called(ctx)
42085886
42095887 if len(ret) == 0 {
4210- panic("no return value specified for Reload")
5888+ panic("no return value specified for Acquire")
42115889 }
42125890
4213- var r0 error
4214- if returnFunc, ok := ret.Get(0).(func(context.Context) error); ok {
5891+ var r0 port.WebView
5892+ var r1 error
5893+ if returnFunc, ok := ret.Get(0).(func(context.Context) (port.WebView, error)); ok {
5894+ return returnFunc(ctx)
5895+ }
5896+ if returnFunc, ok := ret.Get(0).(func(context.Context) port.WebView); ok {
42155897 r0 = returnFunc(ctx)
42165898 } else {
4217- r0 = ret.Error(0)
5899+ if ret.Get(0) != nil {
5900+ r0 = ret.Get(0).(port.WebView)
5901+ }
42185902 }
4219- return r0
5903+ if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
5904+ r1 = returnFunc(ctx)
5905+ } else {
5906+ r1 = ret.Error(1)
5907+ }
5908+ return r0, r1
42205909 }
42215910
4222-// MockWebView_Reload_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Reload'
4223-type MockWebView_Reload_Call struct {
5911+// MockWebViewPool_Acquire_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Acquire'
5912+type MockWebViewPool_Acquire_Call struct {
42245913 *mock.Call
42255914 }
42265915
4227-// Reload is a helper method to define mock.On call
5916+// Acquire is a helper method to define mock.On call
42285917 // - ctx context.Context
4229-func (_e *MockWebView_Expecter) Reload(ctx interface{}) *MockWebView_Reload_Call {
4230- return &MockWebView_Reload_Call{Call: _e.mock.On("Reload", ctx)}
5918+func (_e *MockWebViewPool_Expecter) Acquire(ctx interface{}) *MockWebViewPool_Acquire_Call {
5919+ return &MockWebViewPool_Acquire_Call{Call: _e.mock.On("Acquire", ctx)}
42315920 }
42325921
4233-func (_c *MockWebView_Reload_Call) Run(run func(ctx context.Context)) *MockWebView_Reload_Call {
5922+func (_c *MockWebViewPool_Acquire_Call) Run(run func(ctx context.Context)) *MockWebViewPool_Acquire_Call {
42345923 _c.Call.Run(func(args mock.Arguments) {
42355924 var arg0 context.Context
42365925 if args[0] != nil {
@@ -4243,89 +5932,71 @@ func (_c *MockWebView_Reload_Call) Run(run func(ctx context.Context)) *MockWebVi
42435932 return _c
42445933 }
42455934
4246-func (_c *MockWebView_Reload_Call) Return(err error) *MockWebView_Reload_Call {
4247- _c.Call.Return(err)
5935+func (_c *MockWebViewPool_Acquire_Call) Return(webView port.WebView, err error) *MockWebViewPool_Acquire_Call {
5936+ _c.Call.Return(webView, err)
42485937 return _c
42495938 }
42505939
4251-func (_c *MockWebView_Reload_Call) RunAndReturn(run func(ctx context.Context) error) *MockWebView_Reload_Call {
5940+func (_c *MockWebViewPool_Acquire_Call) RunAndReturn(run func(ctx context.Context) (port.WebView, error)) *MockWebViewPool_Acquire_Call {
42525941 _c.Call.Return(run)
42535942 return _c
42545943 }
42555944
4256-// ReloadBypassCache provides a mock function for the type MockWebView
4257-func (_mock *MockWebView) ReloadBypassCache(ctx context.Context) error {
4258- ret := _mock.Called(ctx)
4259-
4260- if len(ret) == 0 {
4261- panic("no return value specified for ReloadBypassCache")
4262- }
4263-
4264- var r0 error
4265- if returnFunc, ok := ret.Get(0).(func(context.Context) error); ok {
4266- r0 = returnFunc(ctx)
4267- } else {
4268- r0 = ret.Error(0)
4269- }
4270- return r0
5945+// Close provides a mock function for the type MockWebViewPool
5946+func (_mock *MockWebViewPool) Close() {
5947+ _mock.Called()
5948+ return
42715949 }
42725950
4273-// MockWebView_ReloadBypassCache_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReloadBypassCache'
4274-type MockWebView_ReloadBypassCache_Call struct {
5951+// MockWebViewPool_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
5952+type MockWebViewPool_Close_Call struct {
42755953 *mock.Call
42765954 }
42775955
4278-// ReloadBypassCache is a helper method to define mock.On call
4279-// - ctx context.Context
4280-func (_e *MockWebView_Expecter) ReloadBypassCache(ctx interface{}) *MockWebView_ReloadBypassCache_Call {
4281- return &MockWebView_ReloadBypassCache_Call{Call: _e.mock.On("ReloadBypassCache", ctx)}
5956+// Close is a helper method to define mock.On call
5957+func (_e *MockWebViewPool_Expecter) Close() *MockWebViewPool_Close_Call {
5958+ return &MockWebViewPool_Close_Call{Call: _e.mock.On("Close")}
42825959 }
42835960
4284-func (_c *MockWebView_ReloadBypassCache_Call) Run(run func(ctx context.Context)) *MockWebView_ReloadBypassCache_Call {
5961+func (_c *MockWebViewPool_Close_Call) Run(run func()) *MockWebViewPool_Close_Call {
42855962 _c.Call.Run(func(args mock.Arguments) {
4286- var arg0 context.Context
4287- if args[0] != nil {
4288- arg0 = args[0].(context.Context)
4289- }
4290- run(
4291- arg0,
4292- )
5963+ run()
42935964 })
42945965 return _c
42955966 }
42965967
4297-func (_c *MockWebView_ReloadBypassCache_Call) Return(err error) *MockWebView_ReloadBypassCache_Call {
4298- _c.Call.Return(err)
5968+func (_c *MockWebViewPool_Close_Call) Return() *MockWebViewPool_Close_Call {
5969+ _c.Call.Return()
42995970 return _c
43005971 }
43015972
4302-func (_c *MockWebView_ReloadBypassCache_Call) RunAndReturn(run func(ctx context.Context) error) *MockWebView_ReloadBypassCache_Call {
4303- _c.Call.Return(run)
5973+func (_c *MockWebViewPool_Close_Call) RunAndReturn(run func()) *MockWebViewPool_Close_Call {
5974+ _c.Run(run)
43045975 return _c
43055976 }
43065977
4307-// SetCallbacks provides a mock function for the type MockWebView
4308-func (_mock *MockWebView) SetCallbacks(callbacks *port.WebViewCallbacks) {
4309- _mock.Called(callbacks)
5978+// Prewarm provides a mock function for the type MockWebViewPool
5979+func (_mock *MockWebViewPool) Prewarm(count int) {
5980+ _mock.Called(count)
43105981 return
43115982 }
43125983
4313-// MockWebView_SetCallbacks_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCallbacks'
4314-type MockWebView_SetCallbacks_Call struct {
5984+// MockWebViewPool_Prewarm_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Prewarm'
5985+type MockWebViewPool_Prewarm_Call struct {
43155986 *mock.Call
43165987 }
43175988
4318-// SetCallbacks is a helper method to define mock.On call
4319-// - callbacks *port.WebViewCallbacks
4320-func (_e *MockWebView_Expecter) SetCallbacks(callbacks interface{}) *MockWebView_SetCallbacks_Call {
4321- return &MockWebView_SetCallbacks_Call{Call: _e.mock.On("SetCallbacks", callbacks)}
5989+// Prewarm is a helper method to define mock.On call
5990+// - count int
5991+func (_e *MockWebViewPool_Expecter) Prewarm(count interface{}) *MockWebViewPool_Prewarm_Call {
5992+ return &MockWebViewPool_Prewarm_Call{Call: _e.mock.On("Prewarm", count)}
43225993 }
43235994
4324-func (_c *MockWebView_SetCallbacks_Call) Run(run func(callbacks *port.WebViewCallbacks)) *MockWebView_SetCallbacks_Call {
5995+func (_c *MockWebViewPool_Prewarm_Call) Run(run func(count int)) *MockWebViewPool_Prewarm_Call {
43255996 _c.Call.Run(func(args mock.Arguments) {
4326- var arg0 *port.WebViewCallbacks
5997+ var arg0 int
43275998 if args[0] != nil {
4328- arg0 = args[0].(*port.WebViewCallbacks)
5999+ arg0 = args[0].(int)
43296000 }
43306001 run(
43316002 arg0,
@@ -4334,146 +6005,167 @@ func (_c *MockWebView_SetCallbacks_Call) Run(run func(callbacks *port.WebViewCal
43346005 return _c
43356006 }
43366007
4337-func (_c *MockWebView_SetCallbacks_Call) Return() *MockWebView_SetCallbacks_Call {
6008+func (_c *MockWebViewPool_Prewarm_Call) Return() *MockWebViewPool_Prewarm_Call {
43386009 _c.Call.Return()
43396010 return _c
43406011 }
43416012
4342-func (_c *MockWebView_SetCallbacks_Call) RunAndReturn(run func(callbacks *port.WebViewCallbacks)) *MockWebView_SetCallbacks_Call {
6013+func (_c *MockWebViewPool_Prewarm_Call) RunAndReturn(run func(count int)) *MockWebViewPool_Prewarm_Call {
43436014 _c.Run(run)
43446015 return _c
43456016 }
43466017
4347-// SetZoomLevel provides a mock function for the type MockWebView
4348-func (_mock *MockWebView) SetZoomLevel(ctx context.Context, level float64) error {
4349- ret := _mock.Called(ctx, level)
4350-
4351- if len(ret) == 0 {
4352- panic("no return value specified for SetZoomLevel")
4353- }
4354-
4355- var r0 error
4356- if returnFunc, ok := ret.Get(0).(func(context.Context, float64) error); ok {
4357- r0 = returnFunc(ctx, level)
4358- } else {
4359- r0 = ret.Error(0)
4360- }
4361- return r0
6018+// Release provides a mock function for the type MockWebViewPool
6019+func (_mock *MockWebViewPool) Release(wv port.WebView) {
6020+ _mock.Called(wv)
6021+ return
43626022 }
43636023
4364-// MockWebView_SetZoomLevel_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetZoomLevel'
4365-type MockWebView_SetZoomLevel_Call struct {
6024+// MockWebViewPool_Release_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Release'
6025+type MockWebViewPool_Release_Call struct {
43666026 *mock.Call
43676027 }
43686028
4369-// SetZoomLevel is a helper method to define mock.On call
4370-// - ctx context.Context
4371-// - level float64
4372-func (_e *MockWebView_Expecter) SetZoomLevel(ctx interface{}, level interface{}) *MockWebView_SetZoomLevel_Call {
4373- return &MockWebView_SetZoomLevel_Call{Call: _e.mock.On("SetZoomLevel", ctx, level)}
6029+// Release is a helper method to define mock.On call
6030+// - wv port.WebView
6031+func (_e *MockWebViewPool_Expecter) Release(wv interface{}) *MockWebViewPool_Release_Call {
6032+ return &MockWebViewPool_Release_Call{Call: _e.mock.On("Release", wv)}
43746033 }
43756034
4376-func (_c *MockWebView_SetZoomLevel_Call) Run(run func(ctx context.Context, level float64)) *MockWebView_SetZoomLevel_Call {
4377- _c.Call.Run(func(args mock.Arguments) {
4378- var arg0 context.Context
4379- if args[0] != nil {
4380- arg0 = args[0].(context.Context)
4381- }
4382- var arg1 float64
4383- if args[1] != nil {
4384- arg1 = args[1].(float64)
6035+func (_c *MockWebViewPool_Release_Call) Run(run func(wv port.WebView)) *MockWebViewPool_Release_Call {
6036+ _c.Call.Run(func(args mock.Arguments) {
6037+ var arg0 port.WebView
6038+ if args[0] != nil {
6039+ arg0 = args[0].(port.WebView)
43856040 }
43866041 run(
43876042 arg0,
4388- arg1,
43896043 )
43906044 })
43916045 return _c
43926046 }
43936047
4394-func (_c *MockWebView_SetZoomLevel_Call) Return(err error) *MockWebView_SetZoomLevel_Call {
4395- _c.Call.Return(err)
6048+func (_c *MockWebViewPool_Release_Call) Return() *MockWebViewPool_Release_Call {
6049+ _c.Call.Return()
43966050 return _c
43976051 }
43986052
4399-func (_c *MockWebView_SetZoomLevel_Call) RunAndReturn(run func(ctx context.Context, level float64) error) *MockWebView_SetZoomLevel_Call {
4400- _c.Call.Return(run)
6053+func (_c *MockWebViewPool_Release_Call) RunAndReturn(run func(wv port.WebView)) *MockWebViewPool_Release_Call {
6054+ _c.Run(run)
44016055 return _c
44026056 }
44036057
4404-// State provides a mock function for the type MockWebView
4405-func (_mock *MockWebView) State() port.WebViewState {
6058+// Size provides a mock function for the type MockWebViewPool
6059+func (_mock *MockWebViewPool) Size() int {
44066060 ret := _mock.Called()
44076061
44086062 if len(ret) == 0 {
4409- panic("no return value specified for State")
6063+ panic("no return value specified for Size")
44106064 }
44116065
4412- var r0 port.WebViewState
4413- if returnFunc, ok := ret.Get(0).(func() port.WebViewState); ok {
6066+ var r0 int
6067+ if returnFunc, ok := ret.Get(0).(func() int); ok {
44146068 r0 = returnFunc()
44156069 } else {
4416- r0 = ret.Get(0).(port.WebViewState)
6070+ r0 = ret.Get(0).(int)
44176071 }
44186072 return r0
44196073 }
44206074
4421-// MockWebView_State_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'State'
4422-type MockWebView_State_Call struct {
6075+// MockWebViewPool_Size_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Size'
6076+type MockWebViewPool_Size_Call struct {
44236077 *mock.Call
44246078 }
44256079
4426-// State is a helper method to define mock.On call
4427-func (_e *MockWebView_Expecter) State() *MockWebView_State_Call {
4428- return &MockWebView_State_Call{Call: _e.mock.On("State")}
6080+// Size is a helper method to define mock.On call
6081+func (_e *MockWebViewPool_Expecter) Size() *MockWebViewPool_Size_Call {
6082+ return &MockWebViewPool_Size_Call{Call: _e.mock.On("Size")}
44296083 }
44306084
4431-func (_c *MockWebView_State_Call) Run(run func()) *MockWebView_State_Call {
6085+func (_c *MockWebViewPool_Size_Call) Run(run func()) *MockWebViewPool_Size_Call {
44326086 _c.Call.Run(func(args mock.Arguments) {
44336087 run()
44346088 })
44356089 return _c
44366090 }
44376091
4438-func (_c *MockWebView_State_Call) Return(webViewState port.WebViewState) *MockWebView_State_Call {
4439- _c.Call.Return(webViewState)
6092+func (_c *MockWebViewPool_Size_Call) Return(n int) *MockWebViewPool_Size_Call {
6093+ _c.Call.Return(n)
44406094 return _c
44416095 }
44426096
4443-func (_c *MockWebView_State_Call) RunAndReturn(run func() port.WebViewState) *MockWebView_State_Call {
6097+func (_c *MockWebViewPool_Size_Call) RunAndReturn(run func() int) *MockWebViewPool_Size_Call {
44446098 _c.Call.Return(run)
44456099 return _c
44466100 }
44476101
4448-// Stop provides a mock function for the type MockWebView
4449-func (_mock *MockWebView) Stop(ctx context.Context) error {
6102+// NewMockWebViewFactory creates a new instance of MockWebViewFactory. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
6103+// The first argument is typically a *testing.T value.
6104+func NewMockWebViewFactory(t interface {
6105+ mock.TestingT
6106+ Cleanup(func())
6107+}) *MockWebViewFactory {
6108+ mock := &MockWebViewFactory{}
6109+ mock.Mock.Test(t)
6110+
6111+ t.Cleanup(func() { mock.AssertExpectations(t) })
6112+
6113+ return mock
6114+}
6115+
6116+// MockWebViewFactory is an autogenerated mock type for the WebViewFactory type
6117+type MockWebViewFactory struct {
6118+ mock.Mock
6119+}
6120+
6121+type MockWebViewFactory_Expecter struct {
6122+ mock *mock.Mock
6123+}
6124+
6125+func (_m *MockWebViewFactory) EXPECT() *MockWebViewFactory_Expecter {
6126+ return &MockWebViewFactory_Expecter{mock: &_m.Mock}
6127+}
6128+
6129+// Create provides a mock function for the type MockWebViewFactory
6130+func (_mock *MockWebViewFactory) Create(ctx context.Context) (port.WebView, error) {
44506131 ret := _mock.Called(ctx)
44516132
44526133 if len(ret) == 0 {
4453- panic("no return value specified for Stop")
6134+ panic("no return value specified for Create")
44546135 }
44556136
4456- var r0 error
4457- if returnFunc, ok := ret.Get(0).(func(context.Context) error); ok {
6137+ var r0 port.WebView
6138+ var r1 error
6139+ if returnFunc, ok := ret.Get(0).(func(context.Context) (port.WebView, error)); ok {
6140+ return returnFunc(ctx)
6141+ }
6142+ if returnFunc, ok := ret.Get(0).(func(context.Context) port.WebView); ok {
44586143 r0 = returnFunc(ctx)
44596144 } else {
4460- r0 = ret.Error(0)
6145+ if ret.Get(0) != nil {
6146+ r0 = ret.Get(0).(port.WebView)
6147+ }
44616148 }
4462- return r0
6149+ if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
6150+ r1 = returnFunc(ctx)
6151+ } else {
6152+ r1 = ret.Error(1)
6153+ }
6154+ return r0, r1
44636155 }
44646156
4465-// MockWebView_Stop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Stop'
4466-type MockWebView_Stop_Call struct {
6157+// MockWebViewFactory_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create'
6158+type MockWebViewFactory_Create_Call struct {
44676159 *mock.Call
44686160 }
44696161
4470-// Stop is a helper method to define mock.On call
6162+// Create is a helper method to define mock.On call
44716163 // - ctx context.Context
4472-func (_e *MockWebView_Expecter) Stop(ctx interface{}) *MockWebView_Stop_Call {
4473- return &MockWebView_Stop_Call{Call: _e.mock.On("Stop", ctx)}
6164+func (_e *MockWebViewFactory_Expecter) Create(ctx interface{}) *MockWebViewFactory_Create_Call {
6165+ return &MockWebViewFactory_Create_Call{Call: _e.mock.On("Create", ctx)}
44746166 }
44756167
4476-func (_c *MockWebView_Stop_Call) Run(run func(ctx context.Context)) *MockWebView_Stop_Call {
6168+func (_c *MockWebViewFactory_Create_Call) Run(run func(ctx context.Context)) *MockWebViewFactory_Create_Call {
44776169 _c.Call.Run(func(args mock.Arguments) {
44786170 var arg0 context.Context
44796171 if args[0] != nil {
@@ -4486,111 +6178,91 @@ func (_c *MockWebView_Stop_Call) Run(run func(ctx context.Context)) *MockWebView
44866178 return _c
44876179 }
44886180
4489-func (_c *MockWebView_Stop_Call) Return(err error) *MockWebView_Stop_Call {
4490- _c.Call.Return(err)
6181+func (_c *MockWebViewFactory_Create_Call) Return(webView port.WebView, err error) *MockWebViewFactory_Create_Call {
6182+ _c.Call.Return(webView, err)
44916183 return _c
44926184 }
44936185
4494-func (_c *MockWebView_Stop_Call) RunAndReturn(run func(ctx context.Context) error) *MockWebView_Stop_Call {
6186+func (_c *MockWebViewFactory_Create_Call) RunAndReturn(run func(ctx context.Context) (port.WebView, error)) *MockWebViewFactory_Create_Call {
44956187 _c.Call.Return(run)
44966188 return _c
44976189 }
44986190
4499-// Title provides a mock function for the type MockWebView
4500-func (_mock *MockWebView) Title() string {
4501- ret := _mock.Called()
6191+// CreateRelated provides a mock function for the type MockWebViewFactory
6192+func (_mock *MockWebViewFactory) CreateRelated(ctx context.Context, parentID port.WebViewID) (port.WebView, error) {
6193+ ret := _mock.Called(ctx, parentID)
45026194
45036195 if len(ret) == 0 {
4504- panic("no return value specified for Title")
6196+ panic("no return value specified for CreateRelated")
45056197 }
45066198
4507- var r0 string
4508- if returnFunc, ok := ret.Get(0).(func() string); ok {
4509- r0 = returnFunc()
4510- } else {
4511- r0 = ret.Get(0).(string)
6199+ var r0 port.WebView
6200+ var r1 error
6201+ if returnFunc, ok := ret.Get(0).(func(context.Context, port.WebViewID) (port.WebView, error)); ok {
6202+ return returnFunc(ctx, parentID)
45126203 }
4513- return r0
4514-}
4515-
4516-// MockWebView_Title_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Title'
4517-type MockWebView_Title_Call struct {
4518- *mock.Call
4519-}
4520-
4521-// Title is a helper method to define mock.On call
4522-func (_e *MockWebView_Expecter) Title() *MockWebView_Title_Call {
4523- return &MockWebView_Title_Call{Call: _e.mock.On("Title")}
4524-}
4525-
4526-func (_c *MockWebView_Title_Call) Run(run func()) *MockWebView_Title_Call {
4527- _c.Call.Run(func(args mock.Arguments) {
4528- run()
4529- })
4530- return _c
4531-}
4532-
4533-func (_c *MockWebView_Title_Call) Return(s string) *MockWebView_Title_Call {
4534- _c.Call.Return(s)
4535- return _c
4536-}
4537-
4538-func (_c *MockWebView_Title_Call) RunAndReturn(run func() string) *MockWebView_Title_Call {
4539- _c.Call.Return(run)
4540- return _c
4541-}
4542-
4543-// URI provides a mock function for the type MockWebView
4544-func (_mock *MockWebView) URI() string {
4545- ret := _mock.Called()
4546-
4547- if len(ret) == 0 {
4548- panic("no return value specified for URI")
6204+ if returnFunc, ok := ret.Get(0).(func(context.Context, port.WebViewID) port.WebView); ok {
6205+ r0 = returnFunc(ctx, parentID)
6206+ } else {
6207+ if ret.Get(0) != nil {
6208+ r0 = ret.Get(0).(port.WebView)
6209+ }
45496210 }
4550-
4551- var r0 string
4552- if returnFunc, ok := ret.Get(0).(func() string); ok {
4553- r0 = returnFunc()
6211+ if returnFunc, ok := ret.Get(1).(func(context.Context, port.WebViewID) error); ok {
6212+ r1 = returnFunc(ctx, parentID)
45546213 } else {
4555- r0 = ret.Get(0).(string)
6214+ r1 = ret.Error(1)
45566215 }
4557- return r0
6216+ return r0, r1
45586217 }
45596218
4560-// MockWebView_URI_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'URI'
4561-type MockWebView_URI_Call struct {
6219+// MockWebViewFactory_CreateRelated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateRelated'
6220+type MockWebViewFactory_CreateRelated_Call struct {
45626221 *mock.Call
45636222 }
45646223
4565-// URI is a helper method to define mock.On call
4566-func (_e *MockWebView_Expecter) URI() *MockWebView_URI_Call {
4567- return &MockWebView_URI_Call{Call: _e.mock.On("URI")}
6224+// CreateRelated is a helper method to define mock.On call
6225+// - ctx context.Context
6226+// - parentID port.WebViewID
6227+func (_e *MockWebViewFactory_Expecter) CreateRelated(ctx interface{}, parentID interface{}) *MockWebViewFactory_CreateRelated_Call {
6228+ return &MockWebViewFactory_CreateRelated_Call{Call: _e.mock.On("CreateRelated", ctx, parentID)}
45686229 }
45696230
4570-func (_c *MockWebView_URI_Call) Run(run func()) *MockWebView_URI_Call {
6231+func (_c *MockWebViewFactory_CreateRelated_Call) Run(run func(ctx context.Context, parentID port.WebViewID)) *MockWebViewFactory_CreateRelated_Call {
45716232 _c.Call.Run(func(args mock.Arguments) {
4572- run()
6233+ var arg0 context.Context
6234+ if args[0] != nil {
6235+ arg0 = args[0].(context.Context)
6236+ }
6237+ var arg1 port.WebViewID
6238+ if args[1] != nil {
6239+ arg1 = args[1].(port.WebViewID)
6240+ }
6241+ run(
6242+ arg0,
6243+ arg1,
6244+ )
45736245 })
45746246 return _c
45756247 }
45766248
4577-func (_c *MockWebView_URI_Call) Return(s string) *MockWebView_URI_Call {
4578- _c.Call.Return(s)
6249+func (_c *MockWebViewFactory_CreateRelated_Call) Return(webView port.WebView, err error) *MockWebViewFactory_CreateRelated_Call {
6250+ _c.Call.Return(webView, err)
45796251 return _c
45806252 }
45816253
4582-func (_c *MockWebView_URI_Call) RunAndReturn(run func() string) *MockWebView_URI_Call {
6254+func (_c *MockWebViewFactory_CreateRelated_Call) RunAndReturn(run func(ctx context.Context, parentID port.WebViewID) (port.WebView, error)) *MockWebViewFactory_CreateRelated_Call {
45836255 _c.Call.Return(run)
45846256 return _c
45856257 }
45866258
4587-// NewMockWebViewPool creates a new instance of MockWebViewPool. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
6259+// NewMockDevToolsOpener creates a new instance of MockDevToolsOpener. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
45886260 // The first argument is typically a *testing.T value.
4589-func NewMockWebViewPool(t interface {
6261+func NewMockDevToolsOpener(t interface {
45906262 mock.TestingT
45916263 Cleanup(func())
4592-}) *MockWebViewPool {
4593- mock := &MockWebViewPool{}
6264+}) *MockDevToolsOpener {
6265+ mock := &MockDevToolsOpener{}
45946266 mock.Mock.Test(t)
45956267
45966268 t.Cleanup(func() { mock.AssertExpectations(t) })
@@ -4598,136 +6270,161 @@ func NewMockWebViewPool(t interface {
45986270 return mock
45996271 }
46006272
4601-// MockWebViewPool is an autogenerated mock type for the WebViewPool type
4602-type MockWebViewPool struct {
6273+// MockDevToolsOpener is an autogenerated mock type for the DevToolsOpener type
6274+type MockDevToolsOpener struct {
46036275 mock.Mock
46046276 }
4605-
4606-type MockWebViewPool_Expecter struct {
4607- mock *mock.Mock
4608-}
4609-
4610-func (_m *MockWebViewPool) EXPECT() *MockWebViewPool_Expecter {
4611- return &MockWebViewPool_Expecter{mock: &_m.Mock}
4612-}
4613-
4614-// Acquire provides a mock function for the type MockWebViewPool
4615-func (_mock *MockWebViewPool) Acquire(ctx context.Context) (port.WebView, error) {
4616- ret := _mock.Called(ctx)
4617-
4618- if len(ret) == 0 {
4619- panic("no return value specified for Acquire")
4620- }
4621-
4622- var r0 port.WebView
4623- var r1 error
4624- if returnFunc, ok := ret.Get(0).(func(context.Context) (port.WebView, error)); ok {
4625- return returnFunc(ctx)
4626- }
4627- if returnFunc, ok := ret.Get(0).(func(context.Context) port.WebView); ok {
4628- r0 = returnFunc(ctx)
4629- } else {
4630- if ret.Get(0) != nil {
4631- r0 = ret.Get(0).(port.WebView)
4632- }
4633- }
4634- if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
4635- r1 = returnFunc(ctx)
4636- } else {
4637- r1 = ret.Error(1)
4638- }
4639- return r0, r1
6277+
6278+type MockDevToolsOpener_Expecter struct {
6279+ mock *mock.Mock
46406280 }
46416281
4642-// MockWebViewPool_Acquire_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Acquire'
4643-type MockWebViewPool_Acquire_Call struct {
6282+func (_m *MockDevToolsOpener) EXPECT() *MockDevToolsOpener_Expecter {
6283+ return &MockDevToolsOpener_Expecter{mock: &_m.Mock}
6284+}
6285+
6286+// OpenDevTools provides a mock function for the type MockDevToolsOpener
6287+func (_mock *MockDevToolsOpener) OpenDevTools() {
6288+ _mock.Called()
6289+ return
6290+}
6291+
6292+// MockDevToolsOpener_OpenDevTools_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OpenDevTools'
6293+type MockDevToolsOpener_OpenDevTools_Call struct {
46446294 *mock.Call
46456295 }
46466296
4647-// Acquire is a helper method to define mock.On call
4648-// - ctx context.Context
4649-func (_e *MockWebViewPool_Expecter) Acquire(ctx interface{}) *MockWebViewPool_Acquire_Call {
4650- return &MockWebViewPool_Acquire_Call{Call: _e.mock.On("Acquire", ctx)}
6297+// OpenDevTools is a helper method to define mock.On call
6298+func (_e *MockDevToolsOpener_Expecter) OpenDevTools() *MockDevToolsOpener_OpenDevTools_Call {
6299+ return &MockDevToolsOpener_OpenDevTools_Call{Call: _e.mock.On("OpenDevTools")}
46516300 }
46526301
4653-func (_c *MockWebViewPool_Acquire_Call) Run(run func(ctx context.Context)) *MockWebViewPool_Acquire_Call {
6302+func (_c *MockDevToolsOpener_OpenDevTools_Call) Run(run func()) *MockDevToolsOpener_OpenDevTools_Call {
46546303 _c.Call.Run(func(args mock.Arguments) {
4655- var arg0 context.Context
4656- if args[0] != nil {
4657- arg0 = args[0].(context.Context)
4658- }
4659- run(
4660- arg0,
4661- )
6304+ run()
46626305 })
46636306 return _c
46646307 }
46656308
4666-func (_c *MockWebViewPool_Acquire_Call) Return(webView port.WebView, err error) *MockWebViewPool_Acquire_Call {
4667- _c.Call.Return(webView, err)
6309+func (_c *MockDevToolsOpener_OpenDevTools_Call) Return() *MockDevToolsOpener_OpenDevTools_Call {
6310+ _c.Call.Return()
46686311 return _c
46696312 }
46706313
4671-func (_c *MockWebViewPool_Acquire_Call) RunAndReturn(run func(ctx context.Context) (port.WebView, error)) *MockWebViewPool_Acquire_Call {
4672- _c.Call.Return(run)
6314+func (_c *MockDevToolsOpener_OpenDevTools_Call) RunAndReturn(run func()) *MockDevToolsOpener_OpenDevTools_Call {
6315+ _c.Run(run)
46736316 return _c
46746317 }
46756318
4676-// Close provides a mock function for the type MockWebViewPool
4677-func (_mock *MockWebViewPool) Close() {
6319+// NewMockPrinter creates a new instance of MockPrinter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
6320+// The first argument is typically a *testing.T value.
6321+func NewMockPrinter(t interface {
6322+ mock.TestingT
6323+ Cleanup(func())
6324+}) *MockPrinter {
6325+ mock := &MockPrinter{}
6326+ mock.Mock.Test(t)
6327+
6328+ t.Cleanup(func() { mock.AssertExpectations(t) })
6329+
6330+ return mock
6331+}
6332+
6333+// MockPrinter is an autogenerated mock type for the Printer type
6334+type MockPrinter struct {
6335+ mock.Mock
6336+}
6337+
6338+type MockPrinter_Expecter struct {
6339+ mock *mock.Mock
6340+}
6341+
6342+func (_m *MockPrinter) EXPECT() *MockPrinter_Expecter {
6343+ return &MockPrinter_Expecter{mock: &_m.Mock}
6344+}
6345+
6346+// PrintPage provides a mock function for the type MockPrinter
6347+func (_mock *MockPrinter) PrintPage() {
46786348 _mock.Called()
46796349 return
46806350 }
46816351
4682-// MockWebViewPool_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
4683-type MockWebViewPool_Close_Call struct {
6352+// MockPrinter_PrintPage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PrintPage'
6353+type MockPrinter_PrintPage_Call struct {
46846354 *mock.Call
46856355 }
46866356
4687-// Close is a helper method to define mock.On call
4688-func (_e *MockWebViewPool_Expecter) Close() *MockWebViewPool_Close_Call {
4689- return &MockWebViewPool_Close_Call{Call: _e.mock.On("Close")}
6357+// PrintPage is a helper method to define mock.On call
6358+func (_e *MockPrinter_Expecter) PrintPage() *MockPrinter_PrintPage_Call {
6359+ return &MockPrinter_PrintPage_Call{Call: _e.mock.On("PrintPage")}
46906360 }
46916361
4692-func (_c *MockWebViewPool_Close_Call) Run(run func()) *MockWebViewPool_Close_Call {
6362+func (_c *MockPrinter_PrintPage_Call) Run(run func()) *MockPrinter_PrintPage_Call {
46936363 _c.Call.Run(func(args mock.Arguments) {
46946364 run()
46956365 })
46966366 return _c
46976367 }
46986368
4699-func (_c *MockWebViewPool_Close_Call) Return() *MockWebViewPool_Close_Call {
6369+func (_c *MockPrinter_PrintPage_Call) Return() *MockPrinter_PrintPage_Call {
47006370 _c.Call.Return()
47016371 return _c
47026372 }
47036373
4704-func (_c *MockWebViewPool_Close_Call) RunAndReturn(run func()) *MockWebViewPool_Close_Call {
6374+func (_c *MockPrinter_PrintPage_Call) RunAndReturn(run func()) *MockPrinter_PrintPage_Call {
47056375 _c.Run(run)
47066376 return _c
47076377 }
47086378
4709-// Prewarm provides a mock function for the type MockWebViewPool
4710-func (_mock *MockWebViewPool) Prewarm(count int) {
4711- _mock.Called(count)
6379+// NewMockPopupCapable creates a new instance of MockPopupCapable. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
6380+// The first argument is typically a *testing.T value.
6381+func NewMockPopupCapable(t interface {
6382+ mock.TestingT
6383+ Cleanup(func())
6384+}) *MockPopupCapable {
6385+ mock := &MockPopupCapable{}
6386+ mock.Mock.Test(t)
6387+
6388+ t.Cleanup(func() { mock.AssertExpectations(t) })
6389+
6390+ return mock
6391+}
6392+
6393+// MockPopupCapable is an autogenerated mock type for the PopupCapable type
6394+type MockPopupCapable struct {
6395+ mock.Mock
6396+}
6397+
6398+type MockPopupCapable_Expecter struct {
6399+ mock *mock.Mock
6400+}
6401+
6402+func (_m *MockPopupCapable) EXPECT() *MockPopupCapable_Expecter {
6403+ return &MockPopupCapable_Expecter{mock: &_m.Mock}
6404+}
6405+
6406+// SetOnClose provides a mock function for the type MockPopupCapable
6407+func (_mock *MockPopupCapable) SetOnClose(fn func()) {
6408+ _mock.Called(fn)
47126409 return
47136410 }
47146411
4715-// MockWebViewPool_Prewarm_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Prewarm'
4716-type MockWebViewPool_Prewarm_Call struct {
6412+// MockPopupCapable_SetOnClose_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetOnClose'
6413+type MockPopupCapable_SetOnClose_Call struct {
47176414 *mock.Call
47186415 }
47196416
4720-// Prewarm is a helper method to define mock.On call
4721-// - count int
4722-func (_e *MockWebViewPool_Expecter) Prewarm(count interface{}) *MockWebViewPool_Prewarm_Call {
4723- return &MockWebViewPool_Prewarm_Call{Call: _e.mock.On("Prewarm", count)}
6417+// SetOnClose is a helper method to define mock.On call
6418+// - fn func()
6419+func (_e *MockPopupCapable_Expecter) SetOnClose(fn interface{}) *MockPopupCapable_SetOnClose_Call {
6420+ return &MockPopupCapable_SetOnClose_Call{Call: _e.mock.On("SetOnClose", fn)}
47246421 }
47256422
4726-func (_c *MockWebViewPool_Prewarm_Call) Run(run func(count int)) *MockWebViewPool_Prewarm_Call {
6423+func (_c *MockPopupCapable_SetOnClose_Call) Run(run func(fn func())) *MockPopupCapable_SetOnClose_Call {
47276424 _c.Call.Run(func(args mock.Arguments) {
4728- var arg0 int
6425+ var arg0 func()
47296426 if args[0] != nil {
4730- arg0 = args[0].(int)
6427+ arg0 = args[0].(func())
47316428 }
47326429 run(
47336430 arg0,
@@ -4736,38 +6433,38 @@ func (_c *MockWebViewPool_Prewarm_Call) Run(run func(count int)) *MockWebViewPoo
47366433 return _c
47376434 }
47386435
4739-func (_c *MockWebViewPool_Prewarm_Call) Return() *MockWebViewPool_Prewarm_Call {
6436+func (_c *MockPopupCapable_SetOnClose_Call) Return() *MockPopupCapable_SetOnClose_Call {
47406437 _c.Call.Return()
47416438 return _c
47426439 }
47436440
4744-func (_c *MockWebViewPool_Prewarm_Call) RunAndReturn(run func(count int)) *MockWebViewPool_Prewarm_Call {
6441+func (_c *MockPopupCapable_SetOnClose_Call) RunAndReturn(run func(fn func())) *MockPopupCapable_SetOnClose_Call {
47456442 _c.Run(run)
47466443 return _c
47476444 }
47486445
4749-// Release provides a mock function for the type MockWebViewPool
4750-func (_mock *MockWebViewPool) Release(wv port.WebView) {
4751- _mock.Called(wv)
6446+// SetOnReadyToShow provides a mock function for the type MockPopupCapable
6447+func (_mock *MockPopupCapable) SetOnReadyToShow(fn func()) {
6448+ _mock.Called(fn)
47526449 return
47536450 }
47546451
4755-// MockWebViewPool_Release_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Release'
4756-type MockWebViewPool_Release_Call struct {
6452+// MockPopupCapable_SetOnReadyToShow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetOnReadyToShow'
6453+type MockPopupCapable_SetOnReadyToShow_Call struct {
47576454 *mock.Call
47586455 }
47596456
4760-// Release is a helper method to define mock.On call
4761-// - wv port.WebView
4762-func (_e *MockWebViewPool_Expecter) Release(wv interface{}) *MockWebViewPool_Release_Call {
4763- return &MockWebViewPool_Release_Call{Call: _e.mock.On("Release", wv)}
6457+// SetOnReadyToShow is a helper method to define mock.On call
6458+// - fn func()
6459+func (_e *MockPopupCapable_Expecter) SetOnReadyToShow(fn interface{}) *MockPopupCapable_SetOnReadyToShow_Call {
6460+ return &MockPopupCapable_SetOnReadyToShow_Call{Call: _e.mock.On("SetOnReadyToShow", fn)}
47646461 }
47656462
4766-func (_c *MockWebViewPool_Release_Call) Run(run func(wv port.WebView)) *MockWebViewPool_Release_Call {
6463+func (_c *MockPopupCapable_SetOnReadyToShow_Call) Run(run func(fn func())) *MockPopupCapable_SetOnReadyToShow_Call {
47676464 _c.Call.Run(func(args mock.Arguments) {
4768- var arg0 port.WebView
6465+ var arg0 func()
47696466 if args[0] != nil {
4770- arg0 = args[0].(port.WebView)
6467+ arg0 = args[0].(func())
47716468 }
47726469 run(
47736470 arg0,
@@ -4776,67 +6473,56 @@ func (_c *MockWebViewPool_Release_Call) Run(run func(wv port.WebView)) *MockWebV
47766473 return _c
47776474 }
47786475
4779-func (_c *MockWebViewPool_Release_Call) Return() *MockWebViewPool_Release_Call {
6476+func (_c *MockPopupCapable_SetOnReadyToShow_Call) Return() *MockPopupCapable_SetOnReadyToShow_Call {
47806477 _c.Call.Return()
47816478 return _c
47826479 }
47836480
4784-func (_c *MockWebViewPool_Release_Call) RunAndReturn(run func(wv port.WebView)) *MockWebViewPool_Release_Call {
6481+func (_c *MockPopupCapable_SetOnReadyToShow_Call) RunAndReturn(run func(fn func())) *MockPopupCapable_SetOnReadyToShow_Call {
47856482 _c.Run(run)
47866483 return _c
47876484 }
47886485
4789-// Size provides a mock function for the type MockWebViewPool
4790-func (_mock *MockWebViewPool) Size() int {
4791- ret := _mock.Called()
4792-
4793- if len(ret) == 0 {
4794- panic("no return value specified for Size")
4795- }
4796-
4797- var r0 int
4798- if returnFunc, ok := ret.Get(0).(func() int); ok {
4799- r0 = returnFunc()
4800- } else {
4801- r0 = ret.Get(0).(int)
4802- }
4803- return r0
6486+// Show provides a mock function for the type MockPopupCapable
6487+func (_mock *MockPopupCapable) Show() {
6488+ _mock.Called()
6489+ return
48046490 }
48056491
4806-// MockWebViewPool_Size_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Size'
4807-type MockWebViewPool_Size_Call struct {
6492+// MockPopupCapable_Show_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Show'
6493+type MockPopupCapable_Show_Call struct {
48086494 *mock.Call
48096495 }
48106496
4811-// Size is a helper method to define mock.On call
4812-func (_e *MockWebViewPool_Expecter) Size() *MockWebViewPool_Size_Call {
4813- return &MockWebViewPool_Size_Call{Call: _e.mock.On("Size")}
6497+// Show is a helper method to define mock.On call
6498+func (_e *MockPopupCapable_Expecter) Show() *MockPopupCapable_Show_Call {
6499+ return &MockPopupCapable_Show_Call{Call: _e.mock.On("Show")}
48146500 }
48156501
4816-func (_c *MockWebViewPool_Size_Call) Run(run func()) *MockWebViewPool_Size_Call {
6502+func (_c *MockPopupCapable_Show_Call) Run(run func()) *MockPopupCapable_Show_Call {
48176503 _c.Call.Run(func(args mock.Arguments) {
48186504 run()
48196505 })
48206506 return _c
48216507 }
48226508
4823-func (_c *MockWebViewPool_Size_Call) Return(n int) *MockWebViewPool_Size_Call {
4824- _c.Call.Return(n)
6509+func (_c *MockPopupCapable_Show_Call) Return() *MockPopupCapable_Show_Call {
6510+ _c.Call.Return()
48256511 return _c
48266512 }
48276513
4828-func (_c *MockWebViewPool_Size_Call) RunAndReturn(run func() int) *MockWebViewPool_Size_Call {
4829- _c.Call.Return(run)
6514+func (_c *MockPopupCapable_Show_Call) RunAndReturn(run func()) *MockPopupCapable_Show_Call {
6515+ _c.Run(run)
48306516 return _c
48316517 }
48326518
4833-// NewMockWebViewFactory creates a new instance of MockWebViewFactory. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
6519+// NewMockOAuthCallbackCapable creates a new instance of MockOAuthCallbackCapable. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
48346520 // The first argument is typically a *testing.T value.
4835-func NewMockWebViewFactory(t interface {
6521+func NewMockOAuthCallbackCapable(t interface {
48366522 mock.TestingT
48376523 Cleanup(func())
4838-}) *MockWebViewFactory {
4839- mock := &MockWebViewFactory{}
6524+}) *MockOAuthCallbackCapable {
6525+ mock := &MockOAuthCallbackCapable{}
48406526 mock.Mock.Test(t)
48416527
48426528 t.Cleanup(func() { mock.AssertExpectations(t) })
@@ -4844,63 +6530,41 @@ func NewMockWebViewFactory(t interface {
48446530 return mock
48456531 }
48466532
4847-// MockWebViewFactory is an autogenerated mock type for the WebViewFactory type
4848-type MockWebViewFactory struct {
6533+// MockOAuthCallbackCapable is an autogenerated mock type for the OAuthCallbackCapable type
6534+type MockOAuthCallbackCapable struct {
48496535 mock.Mock
48506536 }
48516537
4852-type MockWebViewFactory_Expecter struct {
6538+type MockOAuthCallbackCapable_Expecter struct {
48536539 mock *mock.Mock
48546540 }
48556541
4856-func (_m *MockWebViewFactory) EXPECT() *MockWebViewFactory_Expecter {
4857- return &MockWebViewFactory_Expecter{mock: &_m.Mock}
6542+func (_m *MockOAuthCallbackCapable) EXPECT() *MockOAuthCallbackCapable_Expecter {
6543+ return &MockOAuthCallbackCapable_Expecter{mock: &_m.Mock}
48586544 }
48596545
4860-// Create provides a mock function for the type MockWebViewFactory
4861-func (_mock *MockWebViewFactory) Create(ctx context.Context) (port.WebView, error) {
4862- ret := _mock.Called(ctx)
4863-
4864- if len(ret) == 0 {
4865- panic("no return value specified for Create")
4866- }
4867-
4868- var r0 port.WebView
4869- var r1 error
4870- if returnFunc, ok := ret.Get(0).(func(context.Context) (port.WebView, error)); ok {
4871- return returnFunc(ctx)
4872- }
4873- if returnFunc, ok := ret.Get(0).(func(context.Context) port.WebView); ok {
4874- r0 = returnFunc(ctx)
4875- } else {
4876- if ret.Get(0) != nil {
4877- r0 = ret.Get(0).(port.WebView)
4878- }
4879- }
4880- if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
4881- r1 = returnFunc(ctx)
4882- } else {
4883- r1 = ret.Error(1)
4884- }
4885- return r0, r1
6546+// AddCloseCallback provides a mock function for the type MockOAuthCallbackCapable
6547+func (_mock *MockOAuthCallbackCapable) AddCloseCallback(fn func()) {
6548+ _mock.Called(fn)
6549+ return
48866550 }
48876551
4888-// MockWebViewFactory_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create'
4889-type MockWebViewFactory_Create_Call struct {
6552+// MockOAuthCallbackCapable_AddCloseCallback_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddCloseCallback'
6553+type MockOAuthCallbackCapable_AddCloseCallback_Call struct {
48906554 *mock.Call
48916555 }
48926556
4893-// Create is a helper method to define mock.On call
4894-// - ctx context.Context
4895-func (_e *MockWebViewFactory_Expecter) Create(ctx interface{}) *MockWebViewFactory_Create_Call {
4896- return &MockWebViewFactory_Create_Call{Call: _e.mock.On("Create", ctx)}
6557+// AddCloseCallback is a helper method to define mock.On call
6558+// - fn func()
6559+func (_e *MockOAuthCallbackCapable_Expecter) AddCloseCallback(fn interface{}) *MockOAuthCallbackCapable_AddCloseCallback_Call {
6560+ return &MockOAuthCallbackCapable_AddCloseCallback_Call{Call: _e.mock.On("AddCloseCallback", fn)}
48976561 }
48986562
4899-func (_c *MockWebViewFactory_Create_Call) Run(run func(ctx context.Context)) *MockWebViewFactory_Create_Call {
6563+func (_c *MockOAuthCallbackCapable_AddCloseCallback_Call) Run(run func(fn func())) *MockOAuthCallbackCapable_AddCloseCallback_Call {
49006564 _c.Call.Run(func(args mock.Arguments) {
4901- var arg0 context.Context
6565+ var arg0 func()
49026566 if args[0] != nil {
4903- arg0 = args[0].(context.Context)
6567+ arg0 = args[0].(func())
49046568 }
49056569 run(
49066570 arg0,
@@ -4909,80 +6573,85 @@ func (_c *MockWebViewFactory_Create_Call) Run(run func(ctx context.Context)) *Mo
49096573 return _c
49106574 }
49116575
4912-func (_c *MockWebViewFactory_Create_Call) Return(webView port.WebView, err error) *MockWebViewFactory_Create_Call {
4913- _c.Call.Return(webView, err)
6576+func (_c *MockOAuthCallbackCapable_AddCloseCallback_Call) Return() *MockOAuthCallbackCapable_AddCloseCallback_Call {
6577+ _c.Call.Return()
49146578 return _c
49156579 }
49166580
4917-func (_c *MockWebViewFactory_Create_Call) RunAndReturn(run func(ctx context.Context) (port.WebView, error)) *MockWebViewFactory_Create_Call {
4918- _c.Call.Return(run)
6581+func (_c *MockOAuthCallbackCapable_AddCloseCallback_Call) RunAndReturn(run func(fn func())) *MockOAuthCallbackCapable_AddCloseCallback_Call {
6582+ _c.Run(run)
49196583 return _c
49206584 }
49216585
4922-// CreateRelated provides a mock function for the type MockWebViewFactory
4923-func (_mock *MockWebViewFactory) CreateRelated(ctx context.Context, parentID port.WebViewID) (port.WebView, error) {
4924- ret := _mock.Called(ctx, parentID)
4925-
4926- if len(ret) == 0 {
4927- panic("no return value specified for CreateRelated")
4928- }
4929-
4930- var r0 port.WebView
4931- var r1 error
4932- if returnFunc, ok := ret.Get(0).(func(context.Context, port.WebViewID) (port.WebView, error)); ok {
4933- return returnFunc(ctx, parentID)
4934- }
4935- if returnFunc, ok := ret.Get(0).(func(context.Context, port.WebViewID) port.WebView); ok {
4936- r0 = returnFunc(ctx, parentID)
4937- } else {
4938- if ret.Get(0) != nil {
4939- r0 = ret.Get(0).(port.WebView)
4940- }
4941- }
4942- if returnFunc, ok := ret.Get(1).(func(context.Context, port.WebViewID) error); ok {
4943- r1 = returnFunc(ctx, parentID)
4944- } else {
4945- r1 = ret.Error(1)
4946- }
4947- return r0, r1
6586+// AddNavigationCallback provides a mock function for the type MockOAuthCallbackCapable
6587+func (_mock *MockOAuthCallbackCapable) AddNavigationCallback(fn func(uri string)) {
6588+ _mock.Called(fn)
6589+ return
49486590 }
49496591
4950-// MockWebViewFactory_CreateRelated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateRelated'
4951-type MockWebViewFactory_CreateRelated_Call struct {
6592+// MockOAuthCallbackCapable_AddNavigationCallback_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddNavigationCallback'
6593+type MockOAuthCallbackCapable_AddNavigationCallback_Call struct {
49526594 *mock.Call
49536595 }
49546596
4955-// CreateRelated is a helper method to define mock.On call
4956-// - ctx context.Context
4957-// - parentID port.WebViewID
4958-func (_e *MockWebViewFactory_Expecter) CreateRelated(ctx interface{}, parentID interface{}) *MockWebViewFactory_CreateRelated_Call {
4959- return &MockWebViewFactory_CreateRelated_Call{Call: _e.mock.On("CreateRelated", ctx, parentID)}
6597+// AddNavigationCallback is a helper method to define mock.On call
6598+// - fn func(uri string)
6599+func (_e *MockOAuthCallbackCapable_Expecter) AddNavigationCallback(fn interface{}) *MockOAuthCallbackCapable_AddNavigationCallback_Call {
6600+ return &MockOAuthCallbackCapable_AddNavigationCallback_Call{Call: _e.mock.On("AddNavigationCallback", fn)}
49606601 }
49616602
4962-func (_c *MockWebViewFactory_CreateRelated_Call) Run(run func(ctx context.Context, parentID port.WebViewID)) *MockWebViewFactory_CreateRelated_Call {
6603+func (_c *MockOAuthCallbackCapable_AddNavigationCallback_Call) Run(run func(fn func(uri string))) *MockOAuthCallbackCapable_AddNavigationCallback_Call {
49636604 _c.Call.Run(func(args mock.Arguments) {
4964- var arg0 context.Context
6605+ var arg0 func(uri string)
49656606 if args[0] != nil {
4966- arg0 = args[0].(context.Context)
4967- }
4968- var arg1 port.WebViewID
4969- if args[1] != nil {
4970- arg1 = args[1].(port.WebViewID)
6607+ arg0 = args[0].(func(uri string))
49716608 }
49726609 run(
49736610 arg0,
4974- arg1,
49756611 )
49766612 })
49776613 return _c
49786614 }
49796615
4980-func (_c *MockWebViewFactory_CreateRelated_Call) Return(webView port.WebView, err error) *MockWebViewFactory_CreateRelated_Call {
4981- _c.Call.Return(webView, err)
6616+func (_c *MockOAuthCallbackCapable_AddNavigationCallback_Call) Return() *MockOAuthCallbackCapable_AddNavigationCallback_Call {
6617+ _c.Call.Return()
49826618 return _c
49836619 }
49846620
4985-func (_c *MockWebViewFactory_CreateRelated_Call) RunAndReturn(run func(ctx context.Context, parentID port.WebViewID) (port.WebView, error)) *MockWebViewFactory_CreateRelated_Call {
4986- _c.Call.Return(run)
6621+func (_c *MockOAuthCallbackCapable_AddNavigationCallback_Call) RunAndReturn(run func(fn func(uri string))) *MockOAuthCallbackCapable_AddNavigationCallback_Call {
6622+ _c.Run(run)
6623+ return _c
6624+}
6625+
6626+// Close provides a mock function for the type MockOAuthCallbackCapable
6627+func (_mock *MockOAuthCallbackCapable) Close() {
6628+ _mock.Called()
6629+ return
6630+}
6631+
6632+// MockOAuthCallbackCapable_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
6633+type MockOAuthCallbackCapable_Close_Call struct {
6634+ *mock.Call
6635+}
6636+
6637+// Close is a helper method to define mock.On call
6638+func (_e *MockOAuthCallbackCapable_Expecter) Close() *MockOAuthCallbackCapable_Close_Call {
6639+ return &MockOAuthCallbackCapable_Close_Call{Call: _e.mock.On("Close")}
6640+}
6641+
6642+func (_c *MockOAuthCallbackCapable_Close_Call) Run(run func()) *MockOAuthCallbackCapable_Close_Call {
6643+ _c.Call.Run(func(args mock.Arguments) {
6644+ run()
6645+ })
6646+ return _c
6647+}
6648+
6649+func (_c *MockOAuthCallbackCapable_Close_Call) Return() *MockOAuthCallbackCapable_Close_Call {
6650+ _c.Call.Return()
6651+ return _c
6652+}
6653+
6654+func (_c *MockOAuthCallbackCapable_Close_Call) RunAndReturn(run func()) *MockOAuthCallbackCapable_Close_Call {
6655+ _c.Run(run)
49876656 return _c
49886657 }
A internal/ui/coordinator/content/lifecycle_test.go +255 -0
@@ -0,0 +1,255 @@
1+package content
2+
3+import (
4+ "context"
5+ "errors"
6+ "testing"
7+
8+ "github.com/stretchr/testify/assert"
9+ "github.com/stretchr/testify/mock"
10+ "github.com/stretchr/testify/require"
11+
12+ "github.com/bnema/dumber/internal/application/port"
13+ "github.com/bnema/dumber/internal/application/port/mocks"
14+ "github.com/bnema/dumber/internal/domain/entity"
15+)
16+
17+// newMinimalCoordinator returns a Coordinator with the maps required by
18+// ReleaseWebView initialized so that calls to clearPendingAppearance,
19+// titleMu / navOriginMu locks do not panic.
20+func newMinimalCoordinator() *Coordinator {
21+ return &Coordinator{
22+ webViews: make(map[entity.PaneID]port.WebView),
23+ paneTitles: make(map[entity.PaneID]string),
24+ navOrigins: make(map[entity.PaneID]string),
25+ }
26+}
27+
28+// ---------------------------------------------------------------------------
29+// EnsureWebView
30+// ---------------------------------------------------------------------------
31+
32+func TestLifecycle_EnsureWebView_ReusesExistingNonDestroyed(t *testing.T) {
33+ t.Parallel()
34+
35+ wv := mocks.NewMockWebView(t)
36+ wv.EXPECT().IsDestroyed().Return(false)
37+
38+ pool := mocks.NewMockWebViewPool(t)
39+ // pool.Acquire must NOT be called
40+
41+ c := newMinimalCoordinator()
42+ c.pool = pool
43+ c.webViews[entity.PaneID("pane-1")] = wv
44+
45+ got, err := c.EnsureWebView(context.Background(), "pane-1")
46+
47+ require.NoError(t, err)
48+ assert.Equal(t, wv, got)
49+}
50+
51+func TestLifecycle_EnsureWebView_AcquiresFromPoolWhenNoneExists(t *testing.T) {
52+ t.Parallel()
53+
54+ newWV := mocks.NewMockWebView(t)
55+ newWV.EXPECT().SetCallbacks(mock.Anything).Maybe()
56+
57+ pool := mocks.NewMockWebViewPool(t)
58+ pool.EXPECT().Acquire(mock.Anything).Return(newWV, nil)
59+
60+ c := newMinimalCoordinator()
61+ c.pool = pool
62+
63+ got, err := c.EnsureWebView(context.Background(), "pane-1")
64+
65+ require.NoError(t, err)
66+ assert.Equal(t, newWV, got)
67+ assert.Equal(t, newWV, c.webViews[entity.PaneID("pane-1")])
68+}
69+
70+func TestLifecycle_EnsureWebView_AcquiresFromPoolWhenExistingIsDestroyed(t *testing.T) {
71+ t.Parallel()
72+
73+ oldWV := mocks.NewMockWebView(t)
74+ oldWV.EXPECT().IsDestroyed().Return(true)
75+
76+ newWV := mocks.NewMockWebView(t)
77+ newWV.EXPECT().SetCallbacks(mock.Anything).Maybe()
78+
79+ pool := mocks.NewMockWebViewPool(t)
80+ pool.EXPECT().Acquire(mock.Anything).Return(newWV, nil)
81+
82+ c := newMinimalCoordinator()
83+ c.pool = pool
84+ c.webViews[entity.PaneID("pane-1")] = oldWV
85+
86+ got, err := c.EnsureWebView(context.Background(), "pane-1")
87+
88+ require.NoError(t, err)
89+ assert.Equal(t, newWV, got)
90+}
91+
92+func TestLifecycle_EnsureWebView_ErrorWhenPoolIsNil(t *testing.T) {
93+ t.Parallel()
94+
95+ c := newMinimalCoordinator()
96+ // pool remains nil
97+
98+ _, err := c.EnsureWebView(context.Background(), "pane-1")
99+
100+ require.Error(t, err)
101+ assert.Contains(t, err.Error(), "webview pool not configured")
102+}
103+
104+func TestLifecycle_EnsureWebView_ErrorWhenAcquireFails(t *testing.T) {
105+ t.Parallel()
106+
107+ acquireErr := errors.New("pool exhausted")
108+
109+ pool := mocks.NewMockWebViewPool(t)
110+ pool.EXPECT().Acquire(mock.Anything).Return(nil, acquireErr)
111+
112+ c := newMinimalCoordinator()
113+ c.pool = pool
114+
115+ _, err := c.EnsureWebView(context.Background(), "pane-1")
116+
117+ require.Error(t, err)
118+ assert.Equal(t, acquireErr, err)
119+}
120+
121+// ---------------------------------------------------------------------------
122+// ReleaseWebView
123+// ---------------------------------------------------------------------------
124+
125+func TestLifecycle_ReleaseWebView_ReleasesToPool(t *testing.T) {
126+ t.Parallel()
127+
128+ wv := mocks.NewMockWebView(t)
129+ // idleInhibitor is nil so these won't be called
130+ wv.EXPECT().IsFullscreen().Return(false).Maybe()
131+ wv.EXPECT().IsPlayingAudio().Return(false).Maybe()
132+
133+ pool := mocks.NewMockWebViewPool(t)
134+ pool.EXPECT().Release(wv)
135+
136+ c := newMinimalCoordinator()
137+ c.pool = pool
138+ c.webViews[entity.PaneID("pane-1")] = wv
139+
140+ c.ReleaseWebView(context.Background(), "pane-1")
141+
142+ _, exists := c.webViews[entity.PaneID("pane-1")]
143+ assert.False(t, exists, "webview should be removed from map after release")
144+}
145+
146+func TestLifecycle_ReleaseWebView_NoopForUnknownPane(t *testing.T) {
147+ t.Parallel()
148+
149+ pool := mocks.NewMockWebViewPool(t)
150+ // pool.Release must NOT be called
151+
152+ c := newMinimalCoordinator()
153+ c.pool = pool
154+
155+ // Should not panic
156+ c.ReleaseWebView(context.Background(), "unknown-pane")
157+}
158+
159+func TestLifecycle_ReleaseWebView_UninhibitsIdleIfFullscreen(t *testing.T) {
160+ t.Parallel()
161+
162+ wv := mocks.NewMockWebView(t)
163+ wv.EXPECT().IsFullscreen().Return(true)
164+ wv.EXPECT().IsPlayingAudio().Return(false)
165+
166+ inhibitor := mocks.NewMockIdleInhibitor(t)
167+ inhibitor.EXPECT().Uninhibit(mock.Anything).Return(nil)
168+
169+ pool := mocks.NewMockWebViewPool(t)
170+ pool.EXPECT().Release(wv)
171+
172+ c := newMinimalCoordinator()
173+ c.pool = pool
174+ c.idleInhibitor = inhibitor
175+ c.webViews[entity.PaneID("pane-1")] = wv
176+
177+ c.ReleaseWebView(context.Background(), "pane-1")
178+}
179+
180+func TestLifecycle_ReleaseWebView_UninhibitsIdleIfPlayingAudio(t *testing.T) {
181+ t.Parallel()
182+
183+ wv := mocks.NewMockWebView(t)
184+ wv.EXPECT().IsFullscreen().Return(false)
185+ wv.EXPECT().IsPlayingAudio().Return(true)
186+
187+ inhibitor := mocks.NewMockIdleInhibitor(t)
188+ inhibitor.EXPECT().Uninhibit(mock.Anything).Return(nil)
189+
190+ pool := mocks.NewMockWebViewPool(t)
191+ pool.EXPECT().Release(wv)
192+
193+ c := newMinimalCoordinator()
194+ c.pool = pool
195+ c.idleInhibitor = inhibitor
196+ c.webViews[entity.PaneID("pane-1")] = wv
197+
198+ c.ReleaseWebView(context.Background(), "pane-1")
199+}
200+
201+func TestLifecycle_ReleaseWebView_DestroysWebViewWhenPoolIsNil(t *testing.T) {
202+ t.Parallel()
203+
204+ wv := mocks.NewMockWebView(t)
205+ // idleInhibitor is nil so these won't be called
206+ wv.EXPECT().IsFullscreen().Return(false).Maybe()
207+ wv.EXPECT().IsPlayingAudio().Return(false).Maybe()
208+ wv.EXPECT().Destroy()
209+
210+ c := newMinimalCoordinator()
211+ // pool remains nil
212+ c.webViews[entity.PaneID("pane-1")] = wv
213+
214+ c.ReleaseWebView(context.Background(), "pane-1")
215+}
216+
217+// ---------------------------------------------------------------------------
218+// GetWebView / RegisterPopupWebView
219+// ---------------------------------------------------------------------------
220+
221+func TestLifecycle_GetWebView_ReturnsRegisteredWebView(t *testing.T) {
222+ t.Parallel()
223+
224+ wv := mocks.NewMockWebView(t)
225+
226+ c := newMinimalCoordinator()
227+ c.webViews[entity.PaneID("pane-1")] = wv
228+
229+ got := c.GetWebView("pane-1")
230+
231+ assert.Equal(t, wv, got)
232+}
233+
234+func TestLifecycle_RegisterPopupWebView_StoresWebView(t *testing.T) {
235+ t.Parallel()
236+
237+ wv := mocks.NewMockWebView(t)
238+
239+ c := newMinimalCoordinator()
240+
241+ c.RegisterPopupWebView("popup-1", wv)
242+
243+ assert.Equal(t, wv, c.GetWebView("popup-1"))
244+}
245+
246+func TestLifecycle_RegisterPopupWebView_IgnoresNil(t *testing.T) {
247+ t.Parallel()
248+
249+ c := newMinimalCoordinator()
250+
251+ // Should not panic
252+ c.RegisterPopupWebView("popup-1", nil)
253+
254+ assert.Nil(t, c.GetWebView("popup-1"))
255+}
A internal/ui/coordinator/content/popup_test.go +341 -0
@@ -0,0 +1,341 @@
1+package content
2+
3+import (
4+ "context"
5+ "sync"
6+ "testing"
7+
8+ "github.com/stretchr/testify/assert"
9+
10+ "github.com/bnema/dumber/internal/application/port"
11+ "github.com/bnema/dumber/internal/domain/entity"
12+ "github.com/bnema/dumber/internal/infrastructure/config"
13+)
14+
15+// ---------------------------------------------------------------------------
16+// DetectPopupType
17+// ---------------------------------------------------------------------------
18+
19+func TestDetectPopupType_BlankIsTab(t *testing.T) {
20+ t.Parallel()
21+
22+ assert.Equal(t, PopupTypeTab, DetectPopupType("_blank"))
23+}
24+
25+func TestDetectPopupType_EmptyIsPopup(t *testing.T) {
26+ t.Parallel()
27+
28+ assert.Equal(t, PopupTypePopup, DetectPopupType(""))
29+}
30+
31+func TestDetectPopupType_NamedFrameIsPopup(t *testing.T) {
32+ t.Parallel()
33+
34+ assert.Equal(t, PopupTypePopup, DetectPopupType("myFrame"))
35+}
36+
37+// ---------------------------------------------------------------------------
38+// PopupType.String()
39+// ---------------------------------------------------------------------------
40+
41+func TestPopupTypeString_Tab(t *testing.T) {
42+ t.Parallel()
43+
44+ assert.Equal(t, "tab", PopupTypeTab.String())
45+}
46+
47+func TestPopupTypeString_Popup(t *testing.T) {
48+ t.Parallel()
49+
50+ assert.Equal(t, "popup", PopupTypePopup.String())
51+}
52+
53+func TestPopupTypeString_Unknown(t *testing.T) {
54+ t.Parallel()
55+
56+ assert.Equal(t, "unknown", PopupType(99).String())
57+}
58+
59+// ---------------------------------------------------------------------------
60+// GetBehavior
61+// ---------------------------------------------------------------------------
62+
63+func TestGetBehavior_NilConfigReturnsSplit(t *testing.T) {
64+ t.Parallel()
65+
66+ assert.Equal(t, config.PopupBehaviorSplit, GetBehavior(PopupTypeTab, nil))
67+ assert.Equal(t, config.PopupBehaviorSplit, GetBehavior(PopupTypePopup, nil))
68+}
69+
70+func TestGetBehavior_TabPopup_DefaultConfig(t *testing.T) {
71+ t.Parallel()
72+
73+ // BlankTargetBehavior is empty → falls through to default "stacked"
74+ cfg := &config.PopupBehaviorConfig{}
75+ assert.Equal(t, config.PopupBehaviorStacked, GetBehavior(PopupTypeTab, cfg))
76+}
77+
78+func TestGetBehavior_TabPopup_SplitConfig(t *testing.T) {
79+ t.Parallel()
80+
81+ cfg := &config.PopupBehaviorConfig{BlankTargetBehavior: "split"}
82+ assert.Equal(t, config.PopupBehaviorSplit, GetBehavior(PopupTypeTab, cfg))
83+}
84+
85+func TestGetBehavior_TabPopup_StackedConfig(t *testing.T) {
86+ t.Parallel()
87+
88+ cfg := &config.PopupBehaviorConfig{BlankTargetBehavior: "stacked"}
89+ assert.Equal(t, config.PopupBehaviorStacked, GetBehavior(PopupTypeTab, cfg))
90+}
91+
92+func TestGetBehavior_TabPopup_TabbedConfig(t *testing.T) {
93+ t.Parallel()
94+
95+ cfg := &config.PopupBehaviorConfig{BlankTargetBehavior: "tabbed"}
96+ assert.Equal(t, config.PopupBehaviorTabbed, GetBehavior(PopupTypeTab, cfg))
97+}
98+
99+func TestGetBehavior_JSPopup_UsesBehaviorField(t *testing.T) {
100+ t.Parallel()
101+
102+ cfg := &config.PopupBehaviorConfig{Behavior: config.PopupBehaviorWindowed}
103+ assert.Equal(t, config.PopupBehaviorWindowed, GetBehavior(PopupTypePopup, cfg))
104+}
105+
106+func TestGetBehavior_JSPopup_DefaultConfig(t *testing.T) {
107+ t.Parallel()
108+
109+ // Behavior zero-value is empty string; GetBehavior returns it as-is.
110+ cfg := &config.PopupBehaviorConfig{}
111+ assert.Equal(t, config.PopupBehavior(""), GetBehavior(PopupTypePopup, cfg))
112+}
113+
114+func TestGetBehavior_TabPopup_BlocksWhenOpenInNewPaneFalse(t *testing.T) {
115+ t.Parallel()
116+
117+ // GetBehavior itself does not honor OpenInNewPane — that is enforced by
118+ // handlePopupCreate. GetBehavior still returns the configured value.
119+ cfg := &config.PopupBehaviorConfig{
120+ OpenInNewPane: false,
121+ BlankTargetBehavior: "split",
122+ }
123+ assert.Equal(t, config.PopupBehaviorSplit, GetBehavior(PopupTypeTab, cfg))
124+}
125+
126+// ---------------------------------------------------------------------------
127+// trackOAuthPopup / capturePopupOAuthState
128+// ---------------------------------------------------------------------------
129+
130+func TestTrackOAuthPopup_StoresState(t *testing.T) {
131+ t.Parallel()
132+
133+ c := &Coordinator{
134+ webViews: make(map[entity.PaneID]port.WebView),
135+ popupOAuth: make(map[port.WebViewID]*popupOAuthState),
136+ }
137+
138+ popupID := port.WebViewID(1)
139+ parentPaneID := entity.PaneID("parent-pane")
140+
141+ c.trackOAuthPopup(popupID, parentPaneID)
142+
143+ c.popupMu.RLock()
144+ state, ok := c.popupOAuth[popupID]
145+ c.popupMu.RUnlock()
146+
147+ assert.True(t, ok, "oauth state should be tracked after trackOAuthPopup")
148+ assert.Equal(t, parentPaneID, state.ParentPaneID)
149+ assert.False(t, state.Seen, "Seen should be false before capturing callback URI")
150+}
151+
152+func TestCapturePopupOAuthState_SuccessCallback(t *testing.T) {
153+ t.Parallel()
154+
155+ c := &Coordinator{
156+ webViews: make(map[entity.PaneID]port.WebView),
157+ popupOAuth: make(map[port.WebViewID]*popupOAuthState),
158+ }
159+
160+ popupID := port.WebViewID(2)
161+ c.trackOAuthPopup(popupID, entity.PaneID("parent"))
162+ c.capturePopupOAuthState(popupID, "https://app.example.com/callback?code=abc123")
163+
164+ c.popupMu.RLock()
165+ state := c.popupOAuth[popupID]
166+ c.popupMu.RUnlock()
167+
168+ assert.True(t, state.Seen)
169+ assert.True(t, state.Success)
170+ assert.False(t, state.Error)
171+ assert.Equal(t, "https://app.example.com/callback?code=abc123", state.CallbackURI)
172+}
173+
174+func TestCapturePopupOAuthState_ErrorCallback(t *testing.T) {
175+ t.Parallel()
176+
177+ c := &Coordinator{
178+ webViews: make(map[entity.PaneID]port.WebView),
179+ popupOAuth: make(map[port.WebViewID]*popupOAuthState),
180+ }
181+
182+ popupID := port.WebViewID(3)
183+ c.trackOAuthPopup(popupID, entity.PaneID("parent"))
184+ c.capturePopupOAuthState(popupID, "https://app.example.com/callback?error=access_denied")
185+
186+ c.popupMu.RLock()
187+ state := c.popupOAuth[popupID]
188+ c.popupMu.RUnlock()
189+
190+ assert.True(t, state.Seen)
191+ assert.False(t, state.Success)
192+ assert.True(t, state.Error)
193+}
194+
195+func TestCapturePopupOAuthState_UnknownPopupIsNoop(t *testing.T) {
196+ t.Parallel()
197+
198+ c := &Coordinator{
199+ webViews: make(map[entity.PaneID]port.WebView),
200+ popupOAuth: make(map[port.WebViewID]*popupOAuthState),
201+ }
202+
203+ // Should not panic when no tracking entry exists.
204+ c.capturePopupOAuthState(port.WebViewID(999), "https://example.com/callback?code=x")
205+
206+ c.popupMu.RLock()
207+ _, ok := c.popupOAuth[port.WebViewID(999)]
208+ c.popupMu.RUnlock()
209+
210+ assert.False(t, ok)
211+}
212+
213+// ---------------------------------------------------------------------------
214+// SetPopupConfig
215+// ---------------------------------------------------------------------------
216+
217+func TestSetPopupConfig_SetsFields(t *testing.T) {
218+ t.Parallel()
219+
220+ c := &Coordinator{}
221+
222+ factory := &stubFactory{}
223+ cfg := &config.PopupBehaviorConfig{Behavior: config.PopupBehaviorSplit}
224+ genID := func() string { return "test-id" }
225+
226+ c.SetPopupConfig(factory, cfg, genID)
227+
228+ assert.Equal(t, factory, c.factory)
229+ assert.Equal(t, cfg, c.popupConfig)
230+ assert.NotNil(t, c.generateID)
231+ assert.Equal(t, "test-id", c.generateID())
232+}
233+
234+func TestSetPopupConfig_NilConfigAllowed(t *testing.T) {
235+ t.Parallel()
236+
237+ c := &Coordinator{}
238+ c.SetPopupConfig(nil, nil, nil)
239+
240+ assert.Nil(t, c.factory)
241+ assert.Nil(t, c.popupConfig)
242+ assert.Nil(t, c.generateID)
243+}
244+
245+// stubFactory satisfies port.WebViewFactory without importing the mocks package.
246+type stubFactory struct{}
247+
248+func (s *stubFactory) Create(_ context.Context) (port.WebView, error) {
249+ return nil, nil
250+}
251+
252+func (s *stubFactory) CreateRelated(_ context.Context, _ port.WebViewID) (port.WebView, error) {
253+ return nil, nil
254+}
255+
256+// ---------------------------------------------------------------------------
257+// Concurrent access to pendingPopups
258+// ---------------------------------------------------------------------------
259+
260+func TestPendingPopups_ConcurrentAccess(t *testing.T) {
261+ t.Parallel()
262+
263+ c := &Coordinator{
264+ pendingPopups: make(map[port.WebViewID]*PendingPopup),
265+ }
266+
267+ const workers = 20
268+ var wg sync.WaitGroup
269+ wg.Add(workers * 2)
270+
271+ // Writers
272+ for i := 0; i < workers; i++ {
273+ go func(id int) {
274+ defer wg.Done()
275+ popupID := port.WebViewID(id)
276+ c.popupMu.Lock()
277+ c.pendingPopups[popupID] = &PendingPopup{
278+ FrameName: "_blank",
279+ PopupType: PopupTypeTab,
280+ }
281+ c.popupMu.Unlock()
282+ }(i)
283+ }
284+
285+ // Readers
286+ for i := 0; i < workers; i++ {
287+ go func(id int) {
288+ defer wg.Done()
289+ popupID := port.WebViewID(id)
290+ c.popupMu.RLock()
291+ _ = c.pendingPopups[popupID]
292+ c.popupMu.RUnlock()
293+ }(i)
294+ }
295+
296+ wg.Wait()
297+
298+ c.popupMu.RLock()
299+ count := len(c.pendingPopups)
300+ c.popupMu.RUnlock()
301+
302+ assert.LessOrEqual(t, count, workers, "pending popups should not exceed number of writers")
303+}
304+
305+func TestPendingPopups_ConcurrentDeleteAndRead(t *testing.T) {
306+ t.Parallel()
307+
308+ c := &Coordinator{
309+ pendingPopups: make(map[port.WebViewID]*PendingPopup),
310+ }
311+
312+ // Pre-populate
313+ for i := 0; i < 10; i++ {
314+ c.pendingPopups[port.WebViewID(i)] = &PendingPopup{PopupType: PopupTypePopup}
315+ }
316+
317+ var wg sync.WaitGroup
318+ wg.Add(20)
319+
320+ // Deleters
321+ for i := 0; i < 10; i++ {
322+ go func(id int) {
323+ defer wg.Done()
324+ c.popupMu.Lock()
325+ delete(c.pendingPopups, port.WebViewID(id))
326+ c.popupMu.Unlock()
327+ }(i)
328+ }
329+
330+ // Readers
331+ for i := 0; i < 10; i++ {
332+ go func(id int) {
333+ defer wg.Done()
334+ c.popupMu.RLock()
335+ _ = c.pendingPopups[port.WebViewID(id)]
336+ c.popupMu.RUnlock()
337+ }(i)
338+ }
339+
340+ wg.Wait()
341+}
A internal/ui/coordinator/content/title_test.go +440 -0
@@ -0,0 +1,440 @@
1+package content
2+
3+import (
4+ "context"
5+ "sync"
6+ "testing"
7+
8+ "github.com/stretchr/testify/assert"
9+
10+ "github.com/bnema/dumber/internal/domain/entity"
11+)
12+
13+// TestGetTitle tests the GetTitle method for title state retrieval.
14+
15+func TestGetTitle_ReturnsEmptyForUnknownPane(t *testing.T) {
16+ t.Parallel()
17+
18+ c := &Coordinator{
19+ paneTitles: make(map[entity.PaneID]string),
20+ }
21+
22+ title := c.GetTitle("unknown-pane")
23+ assert.Empty(t, title)
24+}
25+
26+func TestGetTitle_ReturnsTrackedTitle(t *testing.T) {
27+ t.Parallel()
28+
29+ paneID := entity.PaneID("pane-1")
30+ c := &Coordinator{
31+ paneTitles: map[entity.PaneID]string{
32+ paneID: "My Page Title",
33+ },
34+ }
35+
36+ title := c.GetTitle(paneID)
37+ assert.Equal(t, "My Page Title", title)
38+}
39+
40+func TestGetTitle_DirectMapUpdate(t *testing.T) {
41+ t.Parallel()
42+
43+ paneID := entity.PaneID("pane-1")
44+ c := &Coordinator{
45+ paneTitles: make(map[entity.PaneID]string),
46+ }
47+
48+ // Simulate the write that onTitleChanged performs
49+ c.titleMu.Lock()
50+ c.paneTitles[paneID] = "Updated Title"
51+ c.titleMu.Unlock()
52+
53+ title := c.GetTitle(paneID)
54+ assert.Equal(t, "Updated Title", title)
55+}
56+
57+func TestGetTitle_EmptyStringAfterZeroValue(t *testing.T) {
58+ t.Parallel()
59+
60+ paneID := entity.PaneID("pane-1")
61+ c := &Coordinator{
62+ paneTitles: map[entity.PaneID]string{
63+ paneID: "",
64+ },
65+ }
66+
67+ title := c.GetTitle(paneID)
68+ assert.Empty(t, title)
69+}
70+
71+// TestPaneTitles_ConcurrentAccess verifies that concurrent reads and writes to
72+// paneTitles do not race.
73+func TestPaneTitles_ConcurrentAccess(t *testing.T) {
74+ t.Parallel()
75+
76+ c := &Coordinator{
77+ paneTitles: make(map[entity.PaneID]string),
78+ }
79+
80+ paneIDs := []entity.PaneID{"pane-1", "pane-2", "pane-3"}
81+
82+ var wg sync.WaitGroup
83+ for i := 0; i < 50; i++ {
84+ for _, paneID := range paneIDs {
85+ wg.Add(2)
86+
87+ go func(id entity.PaneID) {
88+ defer wg.Done()
89+ c.titleMu.Lock()
90+ c.paneTitles[id] = "title for " + string(id)
91+ c.titleMu.Unlock()
92+ }(paneID)
93+
94+ go func(id entity.PaneID) {
95+ defer wg.Done()
96+ _ = c.GetTitle(id)
97+ }(paneID)
98+ }
99+ }
100+
101+ wg.Wait()
102+ // Test passes if no race conditions occur
103+}
104+
105+func TestPaneTitles_MultiplepanesTrackedIndependently(t *testing.T) {
106+ t.Parallel()
107+
108+ pane1 := entity.PaneID("pane-1")
109+ pane2 := entity.PaneID("pane-2")
110+
111+ c := &Coordinator{
112+ paneTitles: map[entity.PaneID]string{
113+ pane1: "Title One",
114+ pane2: "Title Two",
115+ },
116+ }
117+
118+ assert.Equal(t, "Title One", c.GetTitle(pane1))
119+ assert.Equal(t, "Title Two", c.GetTitle(pane2))
120+}
121+
122+// TestSetNavigationOrigin tests navigation origin storage and retrieval.
123+
124+func TestSetNavigationOrigin_StoresOriginURL(t *testing.T) {
125+ t.Parallel()
126+
127+ paneID := entity.PaneID("pane-1")
128+ c := &Coordinator{
129+ navOrigins: make(map[entity.PaneID]string),
130+ }
131+
132+ c.SetNavigationOrigin(paneID, "https://google.fr/search?q=test")
133+
134+ c.navOriginMu.RLock()
135+ origin := c.navOrigins[paneID]
136+ c.navOriginMu.RUnlock()
137+
138+ assert.Equal(t, "https://google.fr/search?q=test", origin)
139+}
140+
141+func TestSetNavigationOrigin_OverwritesPreviousOrigin(t *testing.T) {
142+ t.Parallel()
143+
144+ paneID := entity.PaneID("pane-1")
145+ c := &Coordinator{
146+ navOrigins: make(map[entity.PaneID]string),
147+ }
148+
149+ c.SetNavigationOrigin(paneID, "https://google.fr/")
150+ c.SetNavigationOrigin(paneID, "https://example.com/new")
151+
152+ c.navOriginMu.RLock()
153+ origin := c.navOrigins[paneID]
154+ c.navOriginMu.RUnlock()
155+
156+ assert.Equal(t, "https://example.com/new", origin)
157+}
158+
159+func TestSetNavigationOrigin_IndependentPerPane(t *testing.T) {
160+ t.Parallel()
161+
162+ pane1 := entity.PaneID("pane-1")
163+ pane2 := entity.PaneID("pane-2")
164+ c := &Coordinator{
165+ navOrigins: make(map[entity.PaneID]string),
166+ }
167+
168+ c.SetNavigationOrigin(pane1, "https://pane1.example.com/")
169+ c.SetNavigationOrigin(pane2, "https://pane2.example.com/")
170+
171+ c.navOriginMu.RLock()
172+ origin1 := c.navOrigins[pane1]
173+ origin2 := c.navOrigins[pane2]
174+ c.navOriginMu.RUnlock()
175+
176+ assert.Equal(t, "https://pane1.example.com/", origin1)
177+ assert.Equal(t, "https://pane2.example.com/", origin2)
178+}
179+
180+func TestSetNavigationOrigin_EmptyOrigin(t *testing.T) {
181+ t.Parallel()
182+
183+ paneID := entity.PaneID("pane-1")
184+ c := &Coordinator{
185+ navOrigins: map[entity.PaneID]string{
186+ paneID: "https://old-origin.example.com/",
187+ },
188+ }
189+
190+ c.SetNavigationOrigin(paneID, "")
191+
192+ c.navOriginMu.RLock()
193+ origin := c.navOrigins[paneID]
194+ c.navOriginMu.RUnlock()
195+
196+ assert.Empty(t, origin)
197+}
198+
199+// TestNavOrigins_ConcurrentAccess verifies that concurrent reads and writes to
200+// navOrigins do not race.
201+func TestNavOrigins_ConcurrentAccess(t *testing.T) {
202+ t.Parallel()
203+
204+ c := &Coordinator{
205+ navOrigins: make(map[entity.PaneID]string),
206+ }
207+
208+ paneIDs := []entity.PaneID{"pane-1", "pane-2", "pane-3"}
209+
210+ var wg sync.WaitGroup
211+ for i := 0; i < 50; i++ {
212+ for _, paneID := range paneIDs {
213+ wg.Add(2)
214+
215+ go func(id entity.PaneID) {
216+ defer wg.Done()
217+ c.SetNavigationOrigin(id, "https://origin-for-"+string(id)+".example.com/")
218+ }(paneID)
219+
220+ go func(id entity.PaneID) {
221+ defer wg.Done()
222+ c.navOriginMu.RLock()
223+ _ = c.navOrigins[id]
224+ c.navOriginMu.RUnlock()
225+ }(paneID)
226+ }
227+ }
228+
229+ wg.Wait()
230+ // Test passes if no race conditions occur
231+}
232+
233+// TestQueueThemeApply tests the appearance queue management for theme applies.
234+
235+func TestQueueThemeApply_TakeReturnsTrue(t *testing.T) {
236+ t.Parallel()
237+
238+ paneID := entity.PaneID("pane-1")
239+ c := &Coordinator{}
240+
241+ c.queueThemeApply(paneID, true, "body { color: white; }")
242+
243+ update, ok := c.takePendingThemeApply(paneID)
244+ assert.True(t, ok)
245+ assert.True(t, update.prefersDark)
246+ assert.Equal(t, "body { color: white; }", update.cssText)
247+}
248+
249+func TestQueueThemeApply_SecondTakeReturnsFalse(t *testing.T) {
250+ t.Parallel()
251+
252+ paneID := entity.PaneID("pane-1")
253+ c := &Coordinator{}
254+
255+ c.queueThemeApply(paneID, false, "body { color: black; }")
256+
257+ _, firstOk := c.takePendingThemeApply(paneID)
258+ assert.True(t, firstOk)
259+
260+ _, secondOk := c.takePendingThemeApply(paneID)
261+ assert.False(t, secondOk)
262+}
263+
264+func TestQueueThemeApply_TakeWithoutQueue_ReturnsFalse(t *testing.T) {
265+ t.Parallel()
266+
267+ paneID := entity.PaneID("pane-1")
268+ c := &Coordinator{}
269+
270+ _, ok := c.takePendingThemeApply(paneID)
271+ assert.False(t, ok)
272+}
273+
274+func TestQueueThemeApply_MultiplePanesQueued_Independently(t *testing.T) {
275+ t.Parallel()
276+
277+ pane1 := entity.PaneID("pane-1")
278+ pane2 := entity.PaneID("pane-2")
279+ c := &Coordinator{}
280+
281+ // pendingThemeUpdate is a single shared payload; queueThemeApply always
282+ // overwrites it with the latest call. Both panes are marked as pending,
283+ // but they share the last-written update.
284+ c.queueThemeApply(pane1, true, "shared-css")
285+ c.queueThemeApply(pane2, true, "shared-css")
286+
287+ // Both panes should be independently takeable
288+ update1, ok1 := c.takePendingThemeApply(pane1)
289+ assert.True(t, ok1)
290+ assert.Equal(t, "shared-css", update1.cssText)
291+
292+ // pane2 should still be queued after taking pane1
293+ update2, ok2 := c.takePendingThemeApply(pane2)
294+ assert.True(t, ok2)
295+ assert.Equal(t, "shared-css", update2.cssText)
296+
297+ // Neither should be available after both are taken
298+ _, ok3 := c.takePendingThemeApply(pane1)
299+ assert.False(t, ok3)
300+ _, ok4 := c.takePendingThemeApply(pane2)
301+ assert.False(t, ok4)
302+}
303+
304+func TestQueueThemeApply_LastWriteWins(t *testing.T) {
305+ t.Parallel()
306+
307+ paneID := entity.PaneID("pane-1")
308+ c := &Coordinator{}
309+
310+ // Queue twice; the second call overwrites pendingThemeUpdate
311+ c.queueThemeApply(paneID, true, "first-css")
312+ c.queueThemeApply(paneID, false, "second-css")
313+
314+ update, ok := c.takePendingThemeApply(paneID)
315+ assert.True(t, ok)
316+ assert.False(t, update.prefersDark)
317+ assert.Equal(t, "second-css", update.cssText)
318+}
319+
320+func TestQueueThemeApply_HasPendingFlagClearedWhenAllTaken(t *testing.T) {
321+ t.Parallel()
322+
323+ pane1 := entity.PaneID("pane-1")
324+ pane2 := entity.PaneID("pane-2")
325+ c := &Coordinator{}
326+
327+ c.queueThemeApply(pane1, true, "css")
328+ c.queueThemeApply(pane2, true, "css")
329+
330+ _, _ = c.takePendingThemeApply(pane1)
331+
332+ // hasPendingThemeUpdate should still be true since pane2 is pending
333+ c.appearanceMu.Lock()
334+ assert.True(t, c.hasPendingThemeUpdate)
335+ c.appearanceMu.Unlock()
336+
337+ _, _ = c.takePendingThemeApply(pane2)
338+
339+ // Now hasPendingThemeUpdate should be false
340+ c.appearanceMu.Lock()
341+ assert.False(t, c.hasPendingThemeUpdate)
342+ c.appearanceMu.Unlock()
343+}
344+
345+// TestQueueScriptRefresh tests the appearance queue management for script refreshes.
346+
347+func TestQueueScriptRefresh_TakeReturnsTrue(t *testing.T) {
348+ t.Parallel()
349+
350+ paneID := entity.PaneID("pane-1")
351+ c := &Coordinator{}
352+
353+ c.queueScriptRefresh(paneID)
354+
355+ ok := c.takePendingScriptRefresh(paneID)
356+ assert.True(t, ok)
357+}
358+
359+func TestQueueScriptRefresh_SecondTakeReturnsFalse(t *testing.T) {
360+ t.Parallel()
361+
362+ paneID := entity.PaneID("pane-1")
363+ c := &Coordinator{}
364+
365+ c.queueScriptRefresh(paneID)
366+
367+ firstOk := c.takePendingScriptRefresh(paneID)
368+ assert.True(t, firstOk)
369+
370+ secondOk := c.takePendingScriptRefresh(paneID)
371+ assert.False(t, secondOk)
372+}
373+
374+func TestQueueScriptRefresh_TakeWithoutQueue_ReturnsFalse(t *testing.T) {
375+ t.Parallel()
376+
377+ paneID := entity.PaneID("pane-1")
378+ c := &Coordinator{}
379+
380+ ok := c.takePendingScriptRefresh(paneID)
381+ assert.False(t, ok)
382+}
383+
384+func TestQueueScriptRefresh_MultiplePanesQueuedIndependently(t *testing.T) {
385+ t.Parallel()
386+
387+ pane1 := entity.PaneID("pane-1")
388+ pane2 := entity.PaneID("pane-2")
389+ pane3 := entity.PaneID("pane-3")
390+ c := &Coordinator{}
391+
392+ c.queueScriptRefresh(pane1)
393+ c.queueScriptRefresh(pane2)
394+
395+ // pane3 was never queued
396+ assert.True(t, c.takePendingScriptRefresh(pane1))
397+ assert.True(t, c.takePendingScriptRefresh(pane2))
398+ assert.False(t, c.takePendingScriptRefresh(pane3))
399+}
400+
401+// TestApplyPendingThemeUpdate tests the state management aspect of applyPendingThemeUpdate.
402+
403+func TestApplyPendingThemeUpdate_ReturnsFalseWhenNothingQueued(t *testing.T) {
404+ t.Parallel()
405+
406+ paneID := entity.PaneID("pane-1")
407+ c := &Coordinator{}
408+
409+ // applyPendingThemeUpdate calls takePendingThemeApply; with nothing queued it
410+ // returns false immediately without touching the WebView.
411+ result := c.applyPendingThemeUpdate(context.TODO(), paneID, nil)
412+ assert.False(t, result)
413+}
414+
415+// TestClearPendingAppearance tests that clearPendingAppearance removes both
416+// theme and script queues for the targeted pane only.
417+func TestClearPendingAppearance_ClearsBothQueuesForPane(t *testing.T) {
418+ t.Parallel()
419+
420+ pane1 := entity.PaneID("pane-1")
421+ pane2 := entity.PaneID("pane-2")
422+ c := &Coordinator{}
423+
424+ c.queueThemeApply(pane1, true, "css")
425+ c.queueScriptRefresh(pane1)
426+ c.queueThemeApply(pane2, true, "css")
427+ c.queueScriptRefresh(pane2)
428+
429+ c.clearPendingAppearance(pane1)
430+
431+ // pane1 queues should be gone
432+ assert.False(t, c.takePendingScriptRefresh(pane1))
433+ _, themeOk1 := c.takePendingThemeApply(pane1)
434+ assert.False(t, themeOk1)
435+
436+ // pane2 queues should still be present
437+ assert.True(t, c.takePendingScriptRefresh(pane2))
438+ _, themeOk2 := c.takePendingThemeApply(pane2)
439+ assert.True(t, themeOk2)
440+}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close