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 Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
5 files · +4439 -1722
M .mockery.yaml +12 -0
| @@ -33,6 +33,18 @@ packages: | |||
| 33 | 33 | DownloadResponse: {} | |
| 34 | 34 | PermissionDialogPresenter: {} | |
| 35 | 35 | 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: {} | |
| 36 | 48 | github.com/bnema/dumber/internal/domain/repository: | |
| 37 | 49 | config: | |
| 38 | 50 | dir: '{{.InterfaceDir}}/mocks' | |
M internal/application/port/mocks/mocks.go +3391 -1722
| @@ -1104,6 +1104,90 @@ func (_c *MockConfigTransformer_TransformLegacyActions_Call) RunAndReturn(run fu | |||
| 1104 | 1104 | return _c | |
| 1105 | 1105 | } | |
| 1106 | 1106 | ||
| 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 | + | ||
| 1107 | 1191 | // 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. | |
| 1108 | 1192 | // The first argument is typically a *testing.T value. | |
| 1109 | 1193 | func NewMockDatabaseProvider(t interface { | |
| @@ -1440,13 +1524,13 @@ func (_c *MockDownloadResponse_GetUri_Call) RunAndReturn(run func() string) *Moc | |||
| 1440 | 1524 | return _c | |
| 1441 | 1525 | } | |
| 1442 | 1526 | ||
| 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. | |
| 1444 | 1528 | // The first argument is typically a *testing.T value. | |
| 1445 | - | func NewMockFontDetector(t interface { | |
| 1529 | + | func NewMockEngine(t interface { | |
| 1446 | 1530 | mock.TestingT | |
| 1447 | 1531 | Cleanup(func()) | |
| 1448 | - | }) *MockFontDetector { | |
| 1449 | - | mock := &MockFontDetector{} | |
| 1532 | + | }) *MockEngine { | |
| 1533 | + | mock := &MockEngine{} | |
| 1450 | 1534 | mock.Mock.Test(t) | |
| 1451 | 1535 | ||
| 1452 | 1536 | t.Cleanup(func() { mock.AssertExpectations(t) }) | |
| @@ -1454,699 +1538,539 @@ func NewMockFontDetector(t interface { | |||
| 1454 | 1538 | return mock | |
| 1455 | 1539 | } | |
| 1456 | 1540 | ||
| 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 { | |
| 1459 | 1543 | mock.Mock | |
| 1460 | 1544 | } | |
| 1461 | 1545 | ||
| 1462 | - | type MockFontDetector_Expecter struct { | |
| 1546 | + | type MockEngine_Expecter struct { | |
| 1463 | 1547 | mock *mock.Mock | |
| 1464 | 1548 | } | |
| 1465 | 1549 | ||
| 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} | |
| 1468 | 1552 | } | |
| 1469 | 1553 | ||
| 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() | |
| 1473 | 1557 | ||
| 1474 | 1558 | if len(ret) == 0 { | |
| 1475 | - | panic("no return value specified for GetAvailableFonts") | |
| 1559 | + | panic("no return value specified for Close") | |
| 1476 | 1560 | } | |
| 1477 | 1561 | ||
| 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() | |
| 1492 | 1565 | } else { | |
| 1493 | - | r1 = ret.Error(1) | |
| 1566 | + | r0 = ret.Error(0) | |
| 1494 | 1567 | } | |
| 1495 | - | return r0, r1 | |
| 1568 | + | return r0 | |
| 1496 | 1569 | } | |
| 1497 | 1570 | ||
| 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 { | |
| 1500 | 1573 | *mock.Call | |
| 1501 | 1574 | } | |
| 1502 | 1575 | ||
| 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")} | |
| 1507 | 1579 | } | |
| 1508 | 1580 | ||
| 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 { | |
| 1510 | 1582 | _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() | |
| 1518 | 1584 | }) | |
| 1519 | 1585 | return _c | |
| 1520 | 1586 | } | |
| 1521 | 1587 | ||
| 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) | |
| 1524 | 1590 | return _c | |
| 1525 | 1591 | } | |
| 1526 | 1592 | ||
| 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 { | |
| 1528 | 1594 | _c.Call.Return(run) | |
| 1529 | 1595 | return _c | |
| 1530 | 1596 | } | |
| 1531 | 1597 | ||
| 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() | |
| 1535 | 1601 | ||
| 1536 | 1602 | if len(ret) == 0 { | |
| 1537 | - | panic("no return value specified for IsAvailable") | |
| 1603 | + | panic("no return value specified for ContentInjector") | |
| 1538 | 1604 | } | |
| 1539 | 1605 | ||
| 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() | |
| 1543 | 1609 | } else { | |
| 1544 | - | r0 = ret.Get(0).(bool) | |
| 1610 | + | if ret.Get(0) != nil { | |
| 1611 | + | r0 = ret.Get(0).(port.ContentInjector) | |
| 1612 | + | } | |
| 1545 | 1613 | } | |
| 1546 | 1614 | return r0 | |
| 1547 | 1615 | } | |
| 1548 | 1616 | ||
| 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 { | |
| 1551 | 1619 | *mock.Call | |
| 1552 | 1620 | } | |
| 1553 | 1621 | ||
| 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")} | |
| 1558 | 1625 | } | |
| 1559 | 1626 | ||
| 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 { | |
| 1561 | 1628 | _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() | |
| 1569 | 1630 | }) | |
| 1570 | 1631 | return _c | |
| 1571 | 1632 | } | |
| 1572 | 1633 | ||
| 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) | |
| 1575 | 1636 | return _c | |
| 1576 | 1637 | } | |
| 1577 | 1638 | ||
| 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 { | |
| 1579 | 1640 | _c.Call.Return(run) | |
| 1580 | 1641 | return _c | |
| 1581 | 1642 | } | |
| 1582 | 1643 | ||
| 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() | |
| 1586 | 1647 | ||
| 1587 | 1648 | if len(ret) == 0 { | |
| 1588 | - | panic("no return value specified for SelectBestFont") | |
| 1649 | + | panic("no return value specified for Factory") | |
| 1589 | 1650 | } | |
| 1590 | 1651 | ||
| 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() | |
| 1594 | 1655 | } else { | |
| 1595 | - | r0 = ret.Get(0).(string) | |
| 1656 | + | if ret.Get(0) != nil { | |
| 1657 | + | r0 = ret.Get(0).(port.WebViewFactory) | |
| 1658 | + | } | |
| 1596 | 1659 | } | |
| 1597 | 1660 | return r0 | |
| 1598 | 1661 | } | |
| 1599 | 1662 | ||
| 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 { | |
| 1602 | 1665 | *mock.Call | |
| 1603 | 1666 | } | |
| 1604 | 1667 | ||
| 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")} | |
| 1611 | 1671 | } | |
| 1612 | 1672 | ||
| 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 { | |
| 1614 | 1674 | _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() | |
| 1632 | 1676 | }) | |
| 1633 | 1677 | return _c | |
| 1634 | 1678 | } | |
| 1635 | 1679 | ||
| 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) | |
| 1638 | 1682 | return _c | |
| 1639 | 1683 | } | |
| 1640 | 1684 | ||
| 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 { | |
| 1642 | 1686 | _c.Call.Return(run) | |
| 1643 | 1687 | return _c | |
| 1644 | 1688 | } | |
| 1645 | 1689 | ||
| 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() | |
| 1654 | 1693 | ||
| 1655 | - | t.Cleanup(func() { mock.AssertExpectations(t) }) | |
| 1694 | + | if len(ret) == 0 { | |
| 1695 | + | panic("no return value specified for FaviconDatabase") | |
| 1696 | + | } | |
| 1656 | 1697 | ||
| 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 | |
| 1658 | 1707 | } | |
| 1659 | 1708 | ||
| 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 | |
| 1663 | 1712 | } | |
| 1664 | 1713 | ||
| 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")} | |
| 1667 | 1717 | } | |
| 1668 | 1718 | ||
| 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 | |
| 1671 | 1724 | } | |
| 1672 | 1725 | ||
| 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() | |
| 1676 | 1739 | ||
| 1677 | 1740 | if len(ret) == 0 { | |
| 1678 | - | panic("no return value specified for Survey") | |
| 1741 | + | panic("no return value specified for FilterApplier") | |
| 1679 | 1742 | } | |
| 1680 | 1743 | ||
| 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() | |
| 1684 | 1747 | } else { | |
| 1685 | - | r0 = ret.Get(0).(port.HardwareInfo) | |
| 1748 | + | if ret.Get(0) != nil { | |
| 1749 | + | r0 = ret.Get(0).(port.FilterApplier) | |
| 1750 | + | } | |
| 1686 | 1751 | } | |
| 1687 | 1752 | return r0 | |
| 1688 | 1753 | } | |
| 1689 | 1754 | ||
| 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 { | |
| 1692 | 1757 | *mock.Call | |
| 1693 | 1758 | } | |
| 1694 | 1759 | ||
| 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")} | |
| 1699 | 1763 | } | |
| 1700 | 1764 | ||
| 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 { | |
| 1702 | 1766 | _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() | |
| 1710 | 1768 | }) | |
| 1711 | 1769 | return _c | |
| 1712 | 1770 | } | |
| 1713 | 1771 | ||
| 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) | |
| 1716 | 1774 | return _c | |
| 1717 | 1775 | } | |
| 1718 | 1776 | ||
| 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 { | |
| 1720 | 1778 | _c.Call.Return(run) | |
| 1721 | 1779 | return _c | |
| 1722 | 1780 | } | |
| 1723 | 1781 | ||
| 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) | |
| 1754 | 1785 | ||
| 1755 | 1786 | if len(ret) == 0 { | |
| 1756 | - | panic("no return value specified for CheckConflicts") | |
| 1787 | + | panic("no return value specified for Init") | |
| 1757 | 1788 | } | |
| 1758 | 1789 | ||
| 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) | |
| 1773 | 1793 | } else { | |
| 1774 | - | r1 = ret.Error(1) | |
| 1794 | + | r0 = ret.Error(0) | |
| 1775 | 1795 | } | |
| 1776 | - | return r0, r1 | |
| 1796 | + | return r0 | |
| 1777 | 1797 | } | |
| 1778 | 1798 | ||
| 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 { | |
| 1781 | 1801 | *mock.Call | |
| 1782 | 1802 | } | |
| 1783 | 1803 | ||
| 1784 | - | // CheckConflicts is a helper method to define mock.On call | |
| 1804 | + | // Init is a helper method to define mock.On call | |
| 1785 | 1805 | // - 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)} | |
| 1791 | 1809 | } | |
| 1792 | 1810 | ||
| 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 { | |
| 1794 | 1812 | _c.Call.Run(func(args mock.Arguments) { | |
| 1795 | 1813 | var arg0 context.Context | |
| 1796 | 1814 | if args[0] != nil { | |
| 1797 | 1815 | arg0 = args[0].(context.Context) | |
| 1798 | 1816 | } | |
| 1799 | - | var arg1 string | |
| 1817 | + | var arg1 port.EngineOptions | |
| 1800 | 1818 | 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) | |
| 1810 | 1820 | } | |
| 1811 | 1821 | run( | |
| 1812 | 1822 | arg0, | |
| 1813 | 1823 | arg1, | |
| 1814 | - | arg2, | |
| 1815 | - | arg3, | |
| 1816 | 1824 | ) | |
| 1817 | 1825 | }) | |
| 1818 | 1826 | return _c | |
| 1819 | 1827 | } | |
| 1820 | 1828 | ||
| 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) | |
| 1823 | 1831 | return _c | |
| 1824 | 1832 | } | |
| 1825 | 1833 | ||
| 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 { | |
| 1827 | 1835 | _c.Call.Return(run) | |
| 1828 | 1836 | return _c | |
| 1829 | 1837 | } | |
| 1830 | 1838 | ||
| 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() | |
| 1834 | 1842 | ||
| 1835 | 1843 | if len(ret) == 0 { | |
| 1836 | - | panic("no return value specified for GetDefaultKeybindings") | |
| 1844 | + | panic("no return value specified for InternalSchemePath") | |
| 1837 | 1845 | } | |
| 1838 | 1846 | ||
| 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() | |
| 1851 | 1850 | } else { | |
| 1852 | - | r1 = ret.Error(1) | |
| 1851 | + | r0 = ret.Get(0).(string) | |
| 1853 | 1852 | } | |
| 1854 | - | return r0, r1 | |
| 1853 | + | return r0 | |
| 1855 | 1854 | } | |
| 1856 | 1855 | ||
| 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 { | |
| 1859 | 1858 | *mock.Call | |
| 1860 | 1859 | } | |
| 1861 | 1860 | ||
| 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")} | |
| 1866 | 1864 | } | |
| 1867 | 1865 | ||
| 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 { | |
| 1869 | 1867 | _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() | |
| 1877 | 1869 | }) | |
| 1878 | 1870 | return _c | |
| 1879 | 1871 | } | |
| 1880 | 1872 | ||
| 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) | |
| 1883 | 1875 | return _c | |
| 1884 | 1876 | } | |
| 1885 | 1877 | ||
| 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 { | |
| 1887 | 1879 | _c.Call.Return(run) | |
| 1888 | 1880 | return _c | |
| 1889 | 1881 | } | |
| 1890 | 1882 | ||
| 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() | |
| 1894 | 1886 | ||
| 1895 | 1887 | if len(ret) == 0 { | |
| 1896 | - | panic("no return value specified for GetKeybindings") | |
| 1888 | + | panic("no return value specified for MessageRouter") | |
| 1897 | 1889 | } | |
| 1898 | 1890 | ||
| 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() | |
| 1911 | 1894 | } else { | |
| 1912 | - | r1 = ret.Error(1) | |
| 1895 | + | if ret.Get(0) != nil { | |
| 1896 | + | r0 = ret.Get(0).(port.MessageRouter) | |
| 1897 | + | } | |
| 1913 | 1898 | } | |
| 1914 | - | return r0, r1 | |
| 1899 | + | return r0 | |
| 1915 | 1900 | } | |
| 1916 | 1901 | ||
| 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 { | |
| 1919 | 1904 | *mock.Call | |
| 1920 | 1905 | } | |
| 1921 | 1906 | ||
| 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")} | |
| 1926 | 1910 | } | |
| 1927 | 1911 | ||
| 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 { | |
| 1929 | 1913 | _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() | |
| 1937 | 1915 | }) | |
| 1938 | 1916 | return _c | |
| 1939 | 1917 | } | |
| 1940 | 1918 | ||
| 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) | |
| 1943 | 1921 | return _c | |
| 1944 | 1922 | } | |
| 1945 | 1923 | ||
| 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 { | |
| 1947 | 1925 | _c.Call.Return(run) | |
| 1948 | 1926 | return _c | |
| 1949 | 1927 | } | |
| 1950 | 1928 | ||
| 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() | |
| 1981 | 1932 | ||
| 1982 | 1933 | if len(ret) == 0 { | |
| 1983 | - | panic("no return value specified for ResetAllKeybindings") | |
| 1934 | + | panic("no return value specified for Pool") | |
| 1984 | 1935 | } | |
| 1985 | 1936 | ||
| 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() | |
| 1989 | 1940 | } else { | |
| 1990 | - | r0 = ret.Error(0) | |
| 1941 | + | if ret.Get(0) != nil { | |
| 1942 | + | r0 = ret.Get(0).(port.WebViewPool) | |
| 1943 | + | } | |
| 1991 | 1944 | } | |
| 1992 | 1945 | return r0 | |
| 1993 | 1946 | } | |
| 1994 | 1947 | ||
| 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 { | |
| 1997 | 1950 | *mock.Call | |
| 1998 | 1951 | } | |
| 1999 | 1952 | ||
| 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")} | |
| 2004 | 1956 | } | |
| 2005 | 1957 | ||
| 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 { | |
| 2007 | 1959 | _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() | |
| 2015 | 1961 | }) | |
| 2016 | 1962 | return _c | |
| 2017 | 1963 | } | |
| 2018 | 1964 | ||
| 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) | |
| 2021 | 1967 | return _c | |
| 2022 | 1968 | } | |
| 2023 | 1969 | ||
| 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 { | |
| 2025 | 1971 | _c.Call.Return(run) | |
| 2026 | 1972 | return _c | |
| 2027 | 1973 | } | |
| 2028 | 1974 | ||
| 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() | |
| 2032 | 1978 | ||
| 2033 | 1979 | if len(ret) == 0 { | |
| 2034 | - | panic("no return value specified for ResetKeybinding") | |
| 1980 | + | panic("no return value specified for SchemeHandler") | |
| 2035 | 1981 | } | |
| 2036 | 1982 | ||
| 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() | |
| 2040 | 1986 | } else { | |
| 2041 | - | r0 = ret.Error(0) | |
| 1987 | + | if ret.Get(0) != nil { | |
| 1988 | + | r0 = ret.Get(0).(port.SchemeHandler) | |
| 1989 | + | } | |
| 2042 | 1990 | } | |
| 2043 | 1991 | return r0 | |
| 2044 | 1992 | } | |
| 2045 | 1993 | ||
| 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 { | |
| 2048 | 1996 | *mock.Call | |
| 2049 | 1997 | } | |
| 2050 | 1998 | ||
| 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")} | |
| 2056 | 2002 | } | |
| 2057 | 2003 | ||
| 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 { | |
| 2059 | 2005 | _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() | |
| 2072 | 2007 | }) | |
| 2073 | 2008 | return _c | |
| 2074 | 2009 | } | |
| 2075 | 2010 | ||
| 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) | |
| 2078 | 2013 | return _c | |
| 2079 | 2014 | } | |
| 2080 | 2015 | ||
| 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 { | |
| 2082 | 2017 | _c.Call.Return(run) | |
| 2083 | 2018 | return _c | |
| 2084 | 2019 | } | |
| 2085 | 2020 | ||
| 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() | |
| 2089 | 2024 | ||
| 2090 | 2025 | if len(ret) == 0 { | |
| 2091 | - | panic("no return value specified for SetKeybinding") | |
| 2026 | + | panic("no return value specified for SettingsApplier") | |
| 2092 | 2027 | } | |
| 2093 | 2028 | ||
| 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() | |
| 2097 | 2032 | } else { | |
| 2098 | - | r0 = ret.Error(0) | |
| 2033 | + | if ret.Get(0) != nil { | |
| 2034 | + | r0 = ret.Get(0).(port.SettingsApplier) | |
| 2035 | + | } | |
| 2099 | 2036 | } | |
| 2100 | 2037 | return r0 | |
| 2101 | 2038 | } | |
| 2102 | 2039 | ||
| 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 { | |
| 2105 | 2042 | *mock.Call | |
| 2106 | 2043 | } | |
| 2107 | 2044 | ||
| 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")} | |
| 2113 | 2048 | } | |
| 2114 | 2049 | ||
| 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 { | |
| 2116 | 2051 | _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() | |
| 2129 | 2053 | }) | |
| 2130 | 2054 | return _c | |
| 2131 | 2055 | } | |
| 2132 | 2056 | ||
| 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) | |
| 2135 | 2059 | return _c | |
| 2136 | 2060 | } | |
| 2137 | 2061 | ||
| 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 { | |
| 2139 | 2063 | _c.Call.Return(run) | |
| 2140 | 2064 | return _c | |
| 2141 | 2065 | } | |
| 2142 | 2066 | ||
| 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. | |
| 2144 | 2068 | // The first argument is typically a *testing.T value. | |
| 2145 | - | func NewMockPermissionDialogPresenter(t interface { | |
| 2069 | + | func NewMockSchemeHandler(t interface { | |
| 2146 | 2070 | mock.TestingT | |
| 2147 | 2071 | Cleanup(func()) | |
| 2148 | - | }) *MockPermissionDialogPresenter { | |
| 2149 | - | mock := &MockPermissionDialogPresenter{} | |
| 2072 | + | }) *MockSchemeHandler { | |
| 2073 | + | mock := &MockSchemeHandler{} | |
| 2150 | 2074 | mock.Mock.Test(t) | |
| 2151 | 2075 | ||
| 2152 | 2076 | t.Cleanup(func() { mock.AssertExpectations(t) }) | |
| @@ -2154,84 +2078,72 @@ func NewMockPermissionDialogPresenter(t interface { | |||
| 2154 | 2078 | return mock | |
| 2155 | 2079 | } | |
| 2156 | 2080 | ||
| 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 { | |
| 2159 | 2083 | mock.Mock | |
| 2160 | 2084 | } | |
| 2161 | 2085 | ||
| 2162 | - | type MockPermissionDialogPresenter_Expecter struct { | |
| 2086 | + | type MockSchemeHandler_Expecter struct { | |
| 2163 | 2087 | mock *mock.Mock | |
| 2164 | 2088 | } | |
| 2165 | 2089 | ||
| 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} | |
| 2168 | 2092 | } | |
| 2169 | 2093 | ||
| 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) | |
| 2173 | 2097 | return | |
| 2174 | 2098 | } | |
| 2175 | 2099 | ||
| 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 { | |
| 2178 | 2102 | *mock.Call | |
| 2179 | 2103 | } | |
| 2180 | 2104 | ||
| 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)} | |
| 2188 | 2110 | } | |
| 2189 | 2111 | ||
| 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 { | |
| 2191 | 2113 | _c.Call.Run(func(args mock.Arguments) { | |
| 2192 | - | var arg0 context.Context | |
| 2114 | + | var arg0 string | |
| 2193 | 2115 | if args[0] != nil { | |
| 2194 | - | arg0 = args[0].(context.Context) | |
| 2116 | + | arg0 = args[0].(string) | |
| 2195 | 2117 | } | |
| 2196 | - | var arg1 string | |
| 2118 | + | var arg1 func(uri string) ([]byte, string, error) | |
| 2197 | 2119 | 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)) | |
| 2207 | 2121 | } | |
| 2208 | 2122 | run( | |
| 2209 | 2123 | arg0, | |
| 2210 | 2124 | arg1, | |
| 2211 | - | arg2, | |
| 2212 | - | arg3, | |
| 2213 | 2125 | ) | |
| 2214 | 2126 | }) | |
| 2215 | 2127 | return _c | |
| 2216 | 2128 | } | |
| 2217 | 2129 | ||
| 2218 | - | func (_c *MockPermissionDialogPresenter_ShowPermissionDialog_Call) Return() *MockPermissionDialogPresenter_ShowPermissionDialog_Call { | |
| 2130 | + | func (_c *MockSchemeHandler_RegisterScheme_Call) Return() *MockSchemeHandler_RegisterScheme_Call { | |
| 2219 | 2131 | _c.Call.Return() | |
| 2220 | 2132 | return _c | |
| 2221 | 2133 | } | |
| 2222 | 2134 | ||
| 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 { | |
| 2224 | 2136 | _c.Run(run) | |
| 2225 | 2137 | return _c | |
| 2226 | 2138 | } | |
| 2227 | 2139 | ||
| 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. | |
| 2229 | 2141 | // The first argument is typically a *testing.T value. | |
| 2230 | - | func NewMockPermissionRepository(t interface { | |
| 2142 | + | func NewMockMessageRouter(t interface { | |
| 2231 | 2143 | mock.TestingT | |
| 2232 | 2144 | Cleanup(func()) | |
| 2233 | - | }) *MockPermissionRepository { | |
| 2234 | - | mock := &MockPermissionRepository{} | |
| 2145 | + | }) *MockMessageRouter { | |
| 2146 | + | mock := &MockMessageRouter{} | |
| 2235 | 2147 | mock.Mock.Test(t) | |
| 2236 | 2148 | ||
| 2237 | 2149 | t.Cleanup(func() { mock.AssertExpectations(t) }) | |
| @@ -2239,205 +2151,176 @@ func NewMockPermissionRepository(t interface { | |||
| 2239 | 2151 | return mock | |
| 2240 | 2152 | } | |
| 2241 | 2153 | ||
| 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 { | |
| 2244 | 2156 | mock.Mock | |
| 2245 | 2157 | } | |
| 2246 | 2158 | ||
| 2247 | - | type MockPermissionRepository_Expecter struct { | |
| 2159 | + | type MockMessageRouter_Expecter struct { | |
| 2248 | 2160 | mock *mock.Mock | |
| 2249 | 2161 | } | |
| 2250 | 2162 | ||
| 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} | |
| 2253 | 2165 | } | |
| 2254 | 2166 | ||
| 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) | |
| 2258 | 2170 | ||
| 2259 | 2171 | if len(ret) == 0 { | |
| 2260 | - | panic("no return value specified for Delete") | |
| 2172 | + | panic("no return value specified for PostMessage") | |
| 2261 | 2173 | } | |
| 2262 | 2174 | ||
| 2263 | 2175 | 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) | |
| 2266 | 2178 | } else { | |
| 2267 | 2179 | r0 = ret.Error(0) | |
| 2268 | 2180 | } | |
| 2269 | 2181 | return r0 | |
| 2270 | 2182 | } | |
| 2271 | 2183 | ||
| 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 { | |
| 2274 | 2186 | *mock.Call | |
| 2275 | 2187 | } | |
| 2276 | 2188 | ||
| 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)} | |
| 2283 | 2194 | } | |
| 2284 | 2195 | ||
| 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 { | |
| 2286 | 2197 | _c.Call.Run(func(args mock.Arguments) { | |
| 2287 | - | var arg0 context.Context | |
| 2198 | + | var arg0 port.WebViewID | |
| 2288 | 2199 | if args[0] != nil { | |
| 2289 | - | arg0 = args[0].(context.Context) | |
| 2200 | + | arg0 = args[0].(port.WebViewID) | |
| 2290 | 2201 | } | |
| 2291 | 2202 | var arg1 string | |
| 2292 | 2203 | if args[1] != nil { | |
| 2293 | 2204 | arg1 = args[1].(string) | |
| 2294 | 2205 | } | |
| 2295 | - | var arg2 entity.PermissionType | |
| 2296 | - | if args[2] != nil { | |
| 2297 | - | arg2 = args[2].(entity.PermissionType) | |
| 2298 | - | } | |
| 2299 | 2206 | run( | |
| 2300 | 2207 | arg0, | |
| 2301 | 2208 | arg1, | |
| 2302 | - | arg2, | |
| 2303 | 2209 | ) | |
| 2304 | 2210 | }) | |
| 2305 | 2211 | return _c | |
| 2306 | 2212 | } | |
| 2307 | 2213 | ||
| 2308 | - | func (_c *MockPermissionRepository_Delete_Call) Return(err error) *MockPermissionRepository_Delete_Call { | |
| 2214 | + | func (_c *MockMessageRouter_PostMessage_Call) Return(err error) *MockMessageRouter_PostMessage_Call { | |
| 2309 | 2215 | _c.Call.Return(err) | |
| 2310 | 2216 | return _c | |
| 2311 | 2217 | } | |
| 2312 | 2218 | ||
| 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 { | |
| 2314 | 2220 | _c.Call.Return(run) | |
| 2315 | 2221 | return _c | |
| 2316 | 2222 | } | |
| 2317 | 2223 | ||
| 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 | |
| 2344 | 2228 | } | |
| 2345 | 2229 | ||
| 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 { | |
| 2348 | 2232 | *mock.Call | |
| 2349 | 2233 | } | |
| 2350 | 2234 | ||
| 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)} | |
| 2357 | 2240 | } | |
| 2358 | 2241 | ||
| 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 { | |
| 2360 | 2243 | _c.Call.Run(func(args mock.Arguments) { | |
| 2361 | - | var arg0 context.Context | |
| 2244 | + | var arg0 string | |
| 2362 | 2245 | if args[0] != nil { | |
| 2363 | - | arg0 = args[0].(context.Context) | |
| 2246 | + | arg0 = args[0].(string) | |
| 2364 | 2247 | } | |
| 2365 | - | var arg1 string | |
| 2248 | + | var arg1 func(message string) (string, error) | |
| 2366 | 2249 | 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)) | |
| 2372 | 2251 | } | |
| 2373 | 2252 | run( | |
| 2374 | 2253 | arg0, | |
| 2375 | 2254 | arg1, | |
| 2376 | - | arg2, | |
| 2377 | 2255 | ) | |
| 2378 | 2256 | }) | |
| 2379 | 2257 | return _c | |
| 2380 | 2258 | } | |
| 2381 | 2259 | ||
| 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() | |
| 2384 | 2262 | return _c | |
| 2385 | 2263 | } | |
| 2386 | 2264 | ||
| 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) | |
| 2389 | 2267 | return _c | |
| 2390 | 2268 | } | |
| 2391 | 2269 | ||
| 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) | |
| 2395 | 2278 | ||
| 2396 | - | if len(ret) == 0 { | |
| 2397 | - | panic("no return value specified for GetAll") | |
| 2398 | - | } | |
| 2279 | + | t.Cleanup(func() { mock.AssertExpectations(t) }) | |
| 2399 | 2280 | ||
| 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 | |
| 2418 | 2282 | } | |
| 2419 | 2283 | ||
| 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 { | |
| 2422 | 2305 | *mock.Call | |
| 2423 | 2306 | } | |
| 2424 | 2307 | ||
| 2425 | - | // GetAll is a helper method to define mock.On call | |
| 2308 | + | // ApplyToAll is a helper method to define mock.On call | |
| 2426 | 2309 | // - 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)} | |
| 2430 | 2313 | } | |
| 2431 | 2314 | ||
| 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 { | |
| 2433 | 2316 | _c.Call.Run(func(args mock.Arguments) { | |
| 2434 | 2317 | var arg0 context.Context | |
| 2435 | 2318 | if args[0] != nil { | |
| 2436 | 2319 | arg0 = args[0].(context.Context) | |
| 2437 | 2320 | } | |
| 2438 | - | var arg1 string | |
| 2321 | + | var arg1 []port.WebView | |
| 2439 | 2322 | if args[1] != nil { | |
| 2440 | - | arg1 = args[1].(string) | |
| 2323 | + | arg1 = args[1].([]port.WebView) | |
| 2441 | 2324 | } | |
| 2442 | 2325 | run( | |
| 2443 | 2326 | arg0, | |
| @@ -2447,54 +2330,70 @@ func (_c *MockPermissionRepository_GetAll_Call) Run(run func(ctx context.Context | |||
| 2447 | 2330 | return _c | |
| 2448 | 2331 | } | |
| 2449 | 2332 | ||
| 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() | |
| 2452 | 2335 | return _c | |
| 2453 | 2336 | } | |
| 2454 | 2337 | ||
| 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) | |
| 2457 | 2340 | return _c | |
| 2458 | 2341 | } | |
| 2459 | 2342 | ||
| 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) | |
| 2463 | 2351 | ||
| 2464 | - | if len(ret) == 0 { | |
| 2465 | - | panic("no return value specified for Set") | |
| 2466 | - | } | |
| 2352 | + | t.Cleanup(func() { mock.AssertExpectations(t) }) | |
| 2467 | 2353 | ||
| 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 | |
| 2475 | 2355 | } | |
| 2476 | 2356 | ||
| 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 { | |
| 2479 | 2378 | *mock.Call | |
| 2480 | 2379 | } | |
| 2481 | 2380 | ||
| 2482 | - | // Set is a helper method to define mock.On call | |
| 2381 | + | // ApplyToAll is a helper method to define mock.On call | |
| 2483 | 2382 | // - 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)} | |
| 2487 | 2386 | } | |
| 2488 | 2387 | ||
| 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 { | |
| 2490 | 2389 | _c.Call.Run(func(args mock.Arguments) { | |
| 2491 | 2390 | var arg0 context.Context | |
| 2492 | 2391 | if args[0] != nil { | |
| 2493 | 2392 | arg0 = args[0].(context.Context) | |
| 2494 | 2393 | } | |
| 2495 | - | var arg1 *entity.PermissionRecord | |
| 2394 | + | var arg1 []port.WebView | |
| 2496 | 2395 | if args[1] != nil { | |
| 2497 | - | arg1 = args[1].(*entity.PermissionRecord) | |
| 2396 | + | arg1 = args[1].([]port.WebView) | |
| 2498 | 2397 | } | |
| 2499 | 2398 | run( | |
| 2500 | 2399 | arg0, | |
| @@ -2504,23 +2403,23 @@ func (_c *MockPermissionRepository_Set_Call) Run(run func(ctx context.Context, r | |||
| 2504 | 2403 | return _c | |
| 2505 | 2404 | } | |
| 2506 | 2405 | ||
| 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() | |
| 2509 | 2408 | return _c | |
| 2510 | 2409 | } | |
| 2511 | 2410 | ||
| 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) | |
| 2514 | 2413 | return _c | |
| 2515 | 2414 | } | |
| 2516 | 2415 | ||
| 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. | |
| 2518 | 2417 | // The first argument is typically a *testing.T value. | |
| 2519 | - | func NewMockSessionLogger(t interface { | |
| 2418 | + | func NewMockFaviconDatabase(t interface { | |
| 2520 | 2419 | mock.TestingT | |
| 2521 | 2420 | Cleanup(func()) | |
| 2522 | - | }) *MockSessionLogger { | |
| 2523 | - | mock := &MockSessionLogger{} | |
| 2421 | + | }) *MockFaviconDatabase { | |
| 2422 | + | mock := &MockFaviconDatabase{} | |
| 2524 | 2423 | mock.Mock.Test(t) | |
| 2525 | 2424 | ||
| 2526 | 2425 | t.Cleanup(func() { mock.AssertExpectations(t) }) | |
| @@ -2528,106 +2427,72 @@ func NewMockSessionLogger(t interface { | |||
| 2528 | 2427 | return mock | |
| 2529 | 2428 | } | |
| 2530 | 2429 | ||
| 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 { | |
| 2533 | 2432 | mock.Mock | |
| 2534 | 2433 | } | |
| 2535 | 2434 | ||
| 2536 | - | type MockSessionLogger_Expecter struct { | |
| 2435 | + | type MockFaviconDatabase_Expecter struct { | |
| 2537 | 2436 | mock *mock.Mock | |
| 2538 | 2437 | } | |
| 2539 | 2438 | ||
| 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} | |
| 2542 | 2441 | } | |
| 2543 | 2442 | ||
| 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 | |
| 2576 | 2447 | } | |
| 2577 | 2448 | ||
| 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 { | |
| 2580 | 2451 | *mock.Call | |
| 2581 | 2452 | } | |
| 2582 | 2453 | ||
| 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)} | |
| 2589 | 2459 | } | |
| 2590 | 2460 | ||
| 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 { | |
| 2592 | 2462 | _c.Call.Run(func(args mock.Arguments) { | |
| 2593 | - | var arg0 context.Context | |
| 2463 | + | var arg0 string | |
| 2594 | 2464 | if args[0] != nil { | |
| 2595 | - | arg0 = args[0].(context.Context) | |
| 2465 | + | arg0 = args[0].(string) | |
| 2596 | 2466 | } | |
| 2597 | - | var arg1 entity.SessionID | |
| 2467 | + | var arg1 func(port.Texture) | |
| 2598 | 2468 | 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)) | |
| 2604 | 2470 | } | |
| 2605 | 2471 | run( | |
| 2606 | 2472 | arg0, | |
| 2607 | 2473 | arg1, | |
| 2608 | - | arg2, | |
| 2609 | 2474 | ) | |
| 2610 | 2475 | }) | |
| 2611 | 2476 | return _c | |
| 2612 | 2477 | } | |
| 2613 | 2478 | ||
| 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() | |
| 2616 | 2481 | return _c | |
| 2617 | 2482 | } | |
| 2618 | 2483 | ||
| 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) | |
| 2621 | 2486 | return _c | |
| 2622 | 2487 | } | |
| 2623 | 2488 | ||
| 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. | |
| 2625 | 2490 | // The first argument is typically a *testing.T value. | |
| 2626 | - | func NewMockTabListProvider(t interface { | |
| 2491 | + | func NewMockFontDetector(t interface { | |
| 2627 | 2492 | mock.TestingT | |
| 2628 | 2493 | Cleanup(func()) | |
| 2629 | - | }) *MockTabListProvider { | |
| 2630 | - | mock := &MockTabListProvider{} | |
| 2494 | + | }) *MockFontDetector { | |
| 2495 | + | mock := &MockFontDetector{} | |
| 2631 | 2496 | mock.Mock.Test(t) | |
| 2632 | 2497 | ||
| 2633 | 2498 | t.Cleanup(func() { mock.AssertExpectations(t) }) | |
| @@ -2635,194 +2500,202 @@ func NewMockTabListProvider(t interface { | |||
| 2635 | 2500 | return mock | |
| 2636 | 2501 | } | |
| 2637 | 2502 | ||
| 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 { | |
| 2640 | 2505 | mock.Mock | |
| 2641 | 2506 | } | |
| 2642 | 2507 | ||
| 2643 | - | type MockTabListProvider_Expecter struct { | |
| 2508 | + | type MockFontDetector_Expecter struct { | |
| 2644 | 2509 | mock *mock.Mock | |
| 2645 | 2510 | } | |
| 2646 | 2511 | ||
| 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} | |
| 2649 | 2514 | } | |
| 2650 | 2515 | ||
| 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) | |
| 2654 | 2519 | ||
| 2655 | 2520 | if len(ret) == 0 { | |
| 2656 | - | panic("no return value specified for GetSessionID") | |
| 2521 | + | panic("no return value specified for GetAvailableFonts") | |
| 2657 | 2522 | } | |
| 2658 | 2523 | ||
| 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) | |
| 2662 | 2531 | } else { | |
| 2663 | - | r0 = ret.Get(0).(entity.SessionID) | |
| 2532 | + | if ret.Get(0) != nil { | |
| 2533 | + | r0 = ret.Get(0).([]string) | |
| 2534 | + | } | |
| 2664 | 2535 | } | |
| 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 | |
| 2666 | 2542 | } | |
| 2667 | 2543 | ||
| 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 { | |
| 2670 | 2546 | *mock.Call | |
| 2671 | 2547 | } | |
| 2672 | 2548 | ||
| 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)} | |
| 2676 | 2553 | } | |
| 2677 | 2554 | ||
| 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 { | |
| 2679 | 2556 | _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 | + | ) | |
| 2681 | 2564 | }) | |
| 2682 | 2565 | return _c | |
| 2683 | 2566 | } | |
| 2684 | 2567 | ||
| 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) | |
| 2687 | 2570 | return _c | |
| 2688 | 2571 | } | |
| 2689 | 2572 | ||
| 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 { | |
| 2691 | 2574 | _c.Call.Return(run) | |
| 2692 | 2575 | return _c | |
| 2693 | 2576 | } | |
| 2694 | 2577 | ||
| 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) | |
| 2698 | 2581 | ||
| 2699 | 2582 | if len(ret) == 0 { | |
| 2700 | - | panic("no return value specified for GetTabList") | |
| 2583 | + | panic("no return value specified for IsAvailable") | |
| 2701 | 2584 | } | |
| 2702 | 2585 | ||
| 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) | |
| 2706 | 2589 | } else { | |
| 2707 | - | if ret.Get(0) != nil { | |
| 2708 | - | r0 = ret.Get(0).(*entity.TabList) | |
| 2709 | - | } | |
| 2590 | + | r0 = ret.Get(0).(bool) | |
| 2710 | 2591 | } | |
| 2711 | 2592 | return r0 | |
| 2712 | 2593 | } | |
| 2713 | 2594 | ||
| 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 { | |
| 2716 | 2597 | *mock.Call | |
| 2717 | 2598 | } | |
| 2718 | 2599 | ||
| 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)} | |
| 2722 | 2604 | } | |
| 2723 | 2605 | ||
| 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 { | |
| 2725 | 2607 | _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 | + | ) | |
| 2727 | 2615 | }) | |
| 2728 | 2616 | return _c | |
| 2729 | 2617 | } | |
| 2730 | 2618 | ||
| 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) | |
| 2733 | 2621 | return _c | |
| 2734 | 2622 | } | |
| 2735 | 2623 | ||
| 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 { | |
| 2737 | 2625 | _c.Call.Return(run) | |
| 2738 | 2626 | return _c | |
| 2739 | 2627 | } | |
| 2740 | 2628 | ||
| 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) | |
| 2771 | 2632 | ||
| 2772 | 2633 | if len(ret) == 0 { | |
| 2773 | - | panic("no return value specified for SpawnWithSession") | |
| 2634 | + | panic("no return value specified for SelectBestFont") | |
| 2774 | 2635 | } | |
| 2775 | 2636 | ||
| 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) | |
| 2779 | 2640 | } else { | |
| 2780 | - | r0 = ret.Error(0) | |
| 2641 | + | r0 = ret.Get(0).(string) | |
| 2781 | 2642 | } | |
| 2782 | 2643 | return r0 | |
| 2783 | 2644 | } | |
| 2784 | 2645 | ||
| 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 { | |
| 2787 | 2648 | *mock.Call | |
| 2788 | 2649 | } | |
| 2789 | 2650 | ||
| 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)} | |
| 2794 | 2657 | } | |
| 2795 | 2658 | ||
| 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 { | |
| 2797 | 2660 | _c.Call.Run(func(args mock.Arguments) { | |
| 2798 | - | var arg0 entity.SessionID | |
| 2661 | + | var arg0 context.Context | |
| 2799 | 2662 | 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) | |
| 2801 | 2672 | } | |
| 2802 | 2673 | run( | |
| 2803 | 2674 | arg0, | |
| 2675 | + | arg1, | |
| 2676 | + | arg2, | |
| 2804 | 2677 | ) | |
| 2805 | 2678 | }) | |
| 2806 | 2679 | return _c | |
| 2807 | 2680 | } | |
| 2808 | 2681 | ||
| 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) | |
| 2811 | 2684 | return _c | |
| 2812 | 2685 | } | |
| 2813 | 2686 | ||
| 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 { | |
| 2815 | 2688 | _c.Call.Return(run) | |
| 2816 | 2689 | return _c | |
| 2817 | 2690 | } | |
| 2818 | 2691 | ||
| 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. | |
| 2820 | 2693 | // The first argument is typically a *testing.T value. | |
| 2821 | - | func NewMockTextInputTarget(t interface { | |
| 2694 | + | func NewMockHardwareSurveyor(t interface { | |
| 2822 | 2695 | mock.TestingT | |
| 2823 | 2696 | Cleanup(func()) | |
| 2824 | - | }) *MockTextInputTarget { | |
| 2825 | - | mock := &MockTextInputTarget{} | |
| 2697 | + | }) *MockHardwareSurveyor { | |
| 2698 | + | mock := &MockHardwareSurveyor{} | |
| 2826 | 2699 | mock.Mock.Test(t) | |
| 2827 | 2700 | ||
| 2828 | 2701 | t.Cleanup(func() { mock.AssertExpectations(t) }) | |
| @@ -2830,106 +2703,171 @@ func NewMockTextInputTarget(t interface { | |||
| 2830 | 2703 | return mock | |
| 2831 | 2704 | } | |
| 2832 | 2705 | ||
| 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 { | |
| 2835 | 2708 | mock.Mock | |
| 2836 | 2709 | } | |
| 2837 | 2710 | ||
| 2838 | - | type MockTextInputTarget_Expecter struct { | |
| 2711 | + | type MockHardwareSurveyor_Expecter struct { | |
| 2839 | 2712 | mock *mock.Mock | |
| 2840 | 2713 | } | |
| 2841 | 2714 | ||
| 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} | |
| 2844 | 2717 | } | |
| 2845 | 2718 | ||
| 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) | |
| 2849 | 2722 | ||
| 2850 | 2723 | if len(ret) == 0 { | |
| 2851 | - | panic("no return value specified for DeleteBeforeCursor") | |
| 2724 | + | panic("no return value specified for Survey") | |
| 2852 | 2725 | } | |
| 2853 | 2726 | ||
| 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) | |
| 2857 | 2730 | } else { | |
| 2858 | - | r0 = ret.Error(0) | |
| 2731 | + | r0 = ret.Get(0).(port.HardwareInfo) | |
| 2859 | 2732 | } | |
| 2860 | 2733 | return r0 | |
| 2861 | 2734 | } | |
| 2862 | 2735 | ||
| 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 { | |
| 2865 | 2738 | *mock.Call | |
| 2866 | 2739 | } | |
| 2867 | 2740 | ||
| 2868 | - | // DeleteBeforeCursor is a helper method to define mock.On call | |
| 2741 | + | // Survey is a helper method to define mock.On call | |
| 2869 | 2742 | // - 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)} | |
| 2873 | 2745 | } | |
| 2874 | 2746 | ||
| 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 { | |
| 2876 | 2748 | _c.Call.Run(func(args mock.Arguments) { | |
| 2877 | 2749 | var arg0 context.Context | |
| 2878 | 2750 | if args[0] != nil { | |
| 2879 | 2751 | arg0 = args[0].(context.Context) | |
| 2880 | 2752 | } | |
| 2881 | - | var arg1 int | |
| 2882 | - | if args[1] != nil { | |
| 2883 | - | arg1 = args[1].(int) | |
| 2884 | - | } | |
| 2885 | 2753 | run( | |
| 2886 | 2754 | arg0, | |
| 2887 | - | arg1, | |
| 2888 | 2755 | ) | |
| 2889 | 2756 | }) | |
| 2890 | 2757 | return _c | |
| 2891 | 2758 | } | |
| 2892 | 2759 | ||
| 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 { | |
| 2894 | 2832 | _c.Call.Return(err) | |
| 2895 | 2833 | return _c | |
| 2896 | 2834 | } | |
| 2897 | 2835 | ||
| 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 { | |
| 2899 | 2837 | _c.Call.Return(run) | |
| 2900 | 2838 | return _c | |
| 2901 | 2839 | } | |
| 2902 | 2840 | ||
| 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) | |
| 2906 | 2844 | ||
| 2907 | 2845 | if len(ret) == 0 { | |
| 2908 | - | panic("no return value specified for InsertText") | |
| 2846 | + | panic("no return value specified for Inhibit") | |
| 2909 | 2847 | } | |
| 2910 | 2848 | ||
| 2911 | 2849 | var r0 error | |
| 2912 | 2850 | if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { | |
| 2913 | - | r0 = returnFunc(ctx, text) | |
| 2851 | + | r0 = returnFunc(ctx, reason) | |
| 2914 | 2852 | } else { | |
| 2915 | 2853 | r0 = ret.Error(0) | |
| 2916 | 2854 | } | |
| 2917 | 2855 | return r0 | |
| 2918 | 2856 | } | |
| 2919 | 2857 | ||
| 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 { | |
| 2922 | 2860 | *mock.Call | |
| 2923 | 2861 | } | |
| 2924 | 2862 | ||
| 2925 | - | // InsertText is a helper method to define mock.On call | |
| 2863 | + | // Inhibit is a helper method to define mock.On call | |
| 2926 | 2864 | // - 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)} | |
| 2930 | 2868 | } | |
| 2931 | 2869 | ||
| 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 { | |
| 2933 | 2871 | _c.Call.Run(func(args mock.Arguments) { | |
| 2934 | 2872 | var arg0 context.Context | |
| 2935 | 2873 | if args[0] != nil { | |
| @@ -2947,111 +2885,93 @@ func (_c *MockTextInputTarget_InsertText_Call) Run(run func(ctx context.Context, | |||
| 2947 | 2885 | return _c | |
| 2948 | 2886 | } | |
| 2949 | 2887 | ||
| 2950 | - | func (_c *MockTextInputTarget_InsertText_Call) Return(err error) *MockTextInputTarget_InsertText_Call { | |
| 2888 | + | func (_c *MockIdleInhibitor_Inhibit_Call) Return(err error) *MockIdleInhibitor_Inhibit_Call { | |
| 2951 | 2889 | _c.Call.Return(err) | |
| 2952 | 2890 | return _c | |
| 2953 | 2891 | } | |
| 2954 | 2892 | ||
| 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 { | |
| 2956 | 2894 | _c.Call.Return(run) | |
| 2957 | 2895 | return _c | |
| 2958 | 2896 | } | |
| 2959 | 2897 | ||
| 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 { | |
| 2989 | 2900 | ret := _mock.Called() | |
| 2990 | 2901 | ||
| 2991 | 2902 | if len(ret) == 0 { | |
| 2992 | - | panic("no return value specified for GetFocusedInput") | |
| 2903 | + | panic("no return value specified for IsInhibited") | |
| 2993 | 2904 | } | |
| 2994 | 2905 | ||
| 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 { | |
| 2997 | 2908 | r0 = returnFunc() | |
| 2998 | 2909 | } else { | |
| 2999 | - | if ret.Get(0) != nil { | |
| 3000 | - | r0 = ret.Get(0).(port.TextInputTarget) | |
| 3001 | - | } | |
| 2910 | + | r0 = ret.Get(0).(bool) | |
| 3002 | 2911 | } | |
| 3003 | 2912 | return r0 | |
| 3004 | 2913 | } | |
| 3005 | 2914 | ||
| 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 { | |
| 3008 | 2917 | *mock.Call | |
| 3009 | 2918 | } | |
| 3010 | 2919 | ||
| 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")} | |
| 3014 | 2923 | } | |
| 3015 | 2924 | ||
| 3016 | - | func (_c *MockFocusedInputProvider_GetFocusedInput_Call) Run(run func()) *MockFocusedInputProvider_GetFocusedInput_Call { | |
| 2925 | + | func (_c *MockIdleInhibitor_IsInhibited_Call) Run(run func()) *MockIdleInhibitor_IsInhibited_Call { | |
| 3017 | 2926 | _c.Call.Run(func(args mock.Arguments) { | |
| 3018 | 2927 | run() | |
| 3019 | 2928 | }) | |
| 3020 | 2929 | return _c | |
| 3021 | 2930 | } | |
| 3022 | 2931 | ||
| 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) | |
| 3025 | 2934 | return _c | |
| 3026 | 2935 | } | |
| 3027 | 2936 | ||
| 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 { | |
| 3029 | 2938 | _c.Call.Return(run) | |
| 3030 | 2939 | return _c | |
| 3031 | 2940 | } | |
| 3032 | 2941 | ||
| 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 | |
| 3037 | 2957 | } | |
| 3038 | 2958 | ||
| 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 { | |
| 3041 | 2961 | *mock.Call | |
| 3042 | 2962 | } | |
| 3043 | 2963 | ||
| 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)} | |
| 3048 | 2968 | } | |
| 3049 | 2969 | ||
| 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 { | |
| 3051 | 2971 | _c.Call.Run(func(args mock.Arguments) { | |
| 3052 | - | var arg0 port.TextInputTarget | |
| 2972 | + | var arg0 context.Context | |
| 3053 | 2973 | if args[0] != nil { | |
| 3054 | - | arg0 = args[0].(port.TextInputTarget) | |
| 2974 | + | arg0 = args[0].(context.Context) | |
| 3055 | 2975 | } | |
| 3056 | 2976 | run( | |
| 3057 | 2977 | arg0, | |
| @@ -3060,23 +2980,23 @@ func (_c *MockFocusedInputProvider_SetFocusedInput_Call) Run(run func(target por | |||
| 3060 | 2980 | return _c | |
| 3061 | 2981 | } | |
| 3062 | 2982 | ||
| 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) | |
| 3065 | 2985 | return _c | |
| 3066 | 2986 | } | |
| 3067 | 2987 | ||
| 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) | |
| 3070 | 2990 | return _c | |
| 3071 | 2991 | } | |
| 3072 | 2992 | ||
| 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. | |
| 3074 | 2994 | // The first argument is typically a *testing.T value. | |
| 3075 | - | func NewMockMemoryPressureApplier(t interface { | |
| 2995 | + | func NewMockKeybindingsProvider(t interface { | |
| 3076 | 2996 | mock.TestingT | |
| 3077 | 2997 | Cleanup(func()) | |
| 3078 | - | }) *MockMemoryPressureApplier { | |
| 3079 | - | mock := &MockMemoryPressureApplier{} | |
| 2998 | + | }) *MockKeybindingsProvider { | |
| 2999 | + | mock := &MockKeybindingsProvider{} | |
| 3080 | 3000 | mock.Mock.Test(t) | |
| 3081 | 3001 | ||
| 3082 | 3002 | t.Cleanup(func() { mock.AssertExpectations(t) }) | |
| @@ -3084,151 +3004,226 @@ func NewMockMemoryPressureApplier(t interface { | |||
| 3084 | 3004 | return mock | |
| 3085 | 3005 | } | |
| 3086 | 3006 | ||
| 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 { | |
| 3089 | 3009 | mock.Mock | |
| 3090 | 3010 | } | |
| 3091 | 3011 | ||
| 3092 | - | type MockMemoryPressureApplier_Expecter struct { | |
| 3012 | + | type MockKeybindingsProvider_Expecter struct { | |
| 3093 | 3013 | mock *mock.Mock | |
| 3094 | 3014 | } | |
| 3095 | 3015 | ||
| 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} | |
| 3098 | 3018 | } | |
| 3099 | 3019 | ||
| 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) | |
| 3103 | 3023 | ||
| 3104 | 3024 | if len(ret) == 0 { | |
| 3105 | - | panic("no return value specified for ApplyNetworkProcessSettings") | |
| 3025 | + | panic("no return value specified for CheckConflicts") | |
| 3106 | 3026 | } | |
| 3107 | 3027 | ||
| 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) | |
| 3113 | 3032 | } | |
| 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 | |
| 3115 | 3046 | } | |
| 3116 | 3047 | ||
| 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 { | |
| 3119 | 3050 | *mock.Call | |
| 3120 | 3051 | } | |
| 3121 | 3052 | ||
| 3122 | - | // ApplyNetworkProcessSettings is a helper method to define mock.On call | |
| 3053 | + | // CheckConflicts is a helper method to define mock.On call | |
| 3123 | 3054 | // - 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)} | |
| 3127 | 3060 | } | |
| 3128 | 3061 | ||
| 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 { | |
| 3130 | 3063 | _c.Call.Run(func(args mock.Arguments) { | |
| 3131 | 3064 | var arg0 context.Context | |
| 3132 | 3065 | if args[0] != nil { | |
| 3133 | 3066 | arg0 = args[0].(context.Context) | |
| 3134 | 3067 | } | |
| 3135 | - | var arg1 *port.MemoryPressureConfig | |
| 3068 | + | var arg1 string | |
| 3136 | 3069 | 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) | |
| 3138 | 3079 | } | |
| 3139 | 3080 | run( | |
| 3140 | 3081 | arg0, | |
| 3141 | 3082 | arg1, | |
| 3083 | + | arg2, | |
| 3084 | + | arg3, | |
| 3142 | 3085 | ) | |
| 3143 | 3086 | }) | |
| 3144 | 3087 | return _c | |
| 3145 | 3088 | } | |
| 3146 | 3089 | ||
| 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) | |
| 3149 | 3092 | return _c | |
| 3150 | 3093 | } | |
| 3151 | 3094 | ||
| 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 { | |
| 3153 | 3096 | _c.Call.Return(run) | |
| 3154 | 3097 | return _c | |
| 3155 | 3098 | } | |
| 3156 | 3099 | ||
| 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) | |
| 3160 | 3103 | ||
| 3161 | 3104 | if len(ret) == 0 { | |
| 3162 | - | panic("no return value specified for ApplyWebProcessSettings") | |
| 3105 | + | panic("no return value specified for GetDefaultKeybindings") | |
| 3163 | 3106 | } | |
| 3164 | 3107 | ||
| 3165 | - | var r0 any | |
| 3108 | + | var r0 port.KeybindingsConfig | |
| 3166 | 3109 | 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) | |
| 3169 | 3112 | } | |
| 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) | |
| 3172 | 3115 | } else { | |
| 3173 | - | if ret.Get(0) != nil { | |
| 3174 | - | r0 = ret.Get(0).(any) | |
| 3175 | - | } | |
| 3116 | + | r0 = ret.Get(0).(port.KeybindingsConfig) | |
| 3176 | 3117 | } | |
| 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) | |
| 3179 | 3120 | } else { | |
| 3180 | 3121 | r1 = ret.Error(1) | |
| 3181 | 3122 | } | |
| 3182 | 3123 | return r0, r1 | |
| 3183 | 3124 | } | |
| 3184 | 3125 | ||
| 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 { | |
| 3187 | 3128 | *mock.Call | |
| 3188 | 3129 | } | |
| 3189 | 3130 | ||
| 3190 | - | // ApplyWebProcessSettings is a helper method to define mock.On call | |
| 3131 | + | // GetDefaultKeybindings is a helper method to define mock.On call | |
| 3191 | 3132 | // - 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)} | |
| 3195 | 3135 | } | |
| 3196 | 3136 | ||
| 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 { | |
| 3198 | 3138 | _c.Call.Run(func(args mock.Arguments) { | |
| 3199 | 3139 | var arg0 context.Context | |
| 3200 | 3140 | if args[0] != nil { | |
| 3201 | 3141 | arg0 = args[0].(context.Context) | |
| 3202 | 3142 | } | |
| 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) | |
| 3206 | 3202 | } | |
| 3207 | 3203 | run( | |
| 3208 | 3204 | arg0, | |
| 3209 | - | arg1, | |
| 3210 | 3205 | ) | |
| 3211 | 3206 | }) | |
| 3212 | 3207 | return _c | |
| 3213 | 3208 | } | |
| 3214 | 3209 | ||
| 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) | |
| 3217 | 3212 | return _c | |
| 3218 | 3213 | } | |
| 3219 | 3214 | ||
| 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 { | |
| 3221 | 3216 | _c.Call.Return(run) | |
| 3222 | 3217 | return _c | |
| 3223 | 3218 | } | |
| 3224 | 3219 | ||
| 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. | |
| 3226 | 3221 | // The first argument is typically a *testing.T value. | |
| 3227 | - | func NewMockWebKitContextProvider(t interface { | |
| 3222 | + | func NewMockKeybindingsSaver(t interface { | |
| 3228 | 3223 | mock.TestingT | |
| 3229 | 3224 | Cleanup(func()) | |
| 3230 | - | }) *MockWebKitContextProvider { | |
| 3231 | - | mock := &MockWebKitContextProvider{} | |
| 3225 | + | }) *MockKeybindingsSaver { | |
| 3226 | + | mock := &MockKeybindingsSaver{} | |
| 3232 | 3227 | mock.Mock.Test(t) | |
| 3233 | 3228 | ||
| 3234 | 3229 | t.Cleanup(func() { mock.AssertExpectations(t) }) | |
| @@ -3236,189 +3231,165 @@ func NewMockWebKitContextProvider(t interface { | |||
| 3236 | 3231 | return mock | |
| 3237 | 3232 | } | |
| 3238 | 3233 | ||
| 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 { | |
| 3241 | 3236 | mock.Mock | |
| 3242 | 3237 | } | |
| 3243 | 3238 | ||
| 3244 | - | type MockWebKitContextProvider_Expecter struct { | |
| 3239 | + | type MockKeybindingsSaver_Expecter struct { | |
| 3245 | 3240 | mock *mock.Mock | |
| 3246 | 3241 | } | |
| 3247 | 3242 | ||
| 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} | |
| 3250 | 3245 | } | |
| 3251 | 3246 | ||
| 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) | |
| 3255 | 3250 | ||
| 3256 | 3251 | if len(ret) == 0 { | |
| 3257 | - | panic("no return value specified for CacheDir") | |
| 3252 | + | panic("no return value specified for ResetAllKeybindings") | |
| 3258 | 3253 | } | |
| 3259 | 3254 | ||
| 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) | |
| 3263 | 3258 | } else { | |
| 3264 | - | r0 = ret.Get(0).(string) | |
| 3259 | + | r0 = ret.Error(0) | |
| 3265 | 3260 | } | |
| 3266 | 3261 | return r0 | |
| 3267 | 3262 | } | |
| 3268 | 3263 | ||
| 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 { | |
| 3271 | 3266 | *mock.Call | |
| 3272 | 3267 | } | |
| 3273 | 3268 | ||
| 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)} | |
| 3277 | 3273 | } | |
| 3278 | 3274 | ||
| 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 { | |
| 3280 | 3276 | _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 | + | ) | |
| 3282 | 3284 | }) | |
| 3283 | 3285 | return _c | |
| 3284 | 3286 | } | |
| 3285 | 3287 | ||
| 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) | |
| 3288 | 3290 | return _c | |
| 3289 | 3291 | } | |
| 3290 | 3292 | ||
| 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 { | |
| 3292 | 3294 | _c.Call.Return(run) | |
| 3293 | 3295 | return _c | |
| 3294 | 3296 | } | |
| 3295 | 3297 | ||
| 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) | |
| 3299 | 3301 | ||
| 3300 | 3302 | if len(ret) == 0 { | |
| 3301 | - | panic("no return value specified for Close") | |
| 3303 | + | panic("no return value specified for ResetKeybinding") | |
| 3302 | 3304 | } | |
| 3303 | 3305 | ||
| 3304 | 3306 | 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) | |
| 3307 | 3309 | } else { | |
| 3308 | 3310 | r0 = ret.Error(0) | |
| 3309 | 3311 | } | |
| 3310 | 3312 | return r0 | |
| 3311 | 3313 | } | |
| 3312 | 3314 | ||
| 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 { | |
| 3315 | 3317 | *mock.Call | |
| 3316 | 3318 | } | |
| 3317 | 3319 | ||
| 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)} | |
| 3321 | 3325 | } | |
| 3322 | 3326 | ||
| 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 { | |
| 3324 | 3328 | _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 | + | ) | |
| 3370 | 3341 | }) | |
| 3371 | 3342 | return _c | |
| 3372 | 3343 | } | |
| 3373 | 3344 | ||
| 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) | |
| 3376 | 3347 | return _c | |
| 3377 | 3348 | } | |
| 3378 | 3349 | ||
| 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 { | |
| 3380 | 3351 | _c.Call.Return(run) | |
| 3381 | 3352 | return _c | |
| 3382 | 3353 | } | |
| 3383 | 3354 | ||
| 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) | |
| 3387 | 3358 | ||
| 3388 | 3359 | if len(ret) == 0 { | |
| 3389 | - | panic("no return value specified for Initialize") | |
| 3360 | + | panic("no return value specified for SetKeybinding") | |
| 3390 | 3361 | } | |
| 3391 | 3362 | ||
| 3392 | 3363 | 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) | |
| 3395 | 3366 | } else { | |
| 3396 | 3367 | r0 = ret.Error(0) | |
| 3397 | 3368 | } | |
| 3398 | 3369 | return r0 | |
| 3399 | 3370 | } | |
| 3400 | 3371 | ||
| 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 { | |
| 3403 | 3374 | *mock.Call | |
| 3404 | 3375 | } | |
| 3405 | 3376 | ||
| 3406 | - | // Initialize is a helper method to define mock.On call | |
| 3377 | + | // SetKeybinding is a helper method to define mock.On call | |
| 3407 | 3378 | // - 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)} | |
| 3411 | 3382 | } | |
| 3412 | 3383 | ||
| 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 { | |
| 3414 | 3385 | _c.Call.Run(func(args mock.Arguments) { | |
| 3415 | 3386 | var arg0 context.Context | |
| 3416 | 3387 | if args[0] != nil { | |
| 3417 | 3388 | arg0 = args[0].(context.Context) | |
| 3418 | 3389 | } | |
| 3419 | - | var arg1 port.WebKitContextOptions | |
| 3390 | + | var arg1 port.SetKeybindingRequest | |
| 3420 | 3391 | if args[1] != nil { | |
| 3421 | - | arg1 = args[1].(port.WebKitContextOptions) | |
| 3392 | + | arg1 = args[1].(port.SetKeybindingRequest) | |
| 3422 | 3393 | } | |
| 3423 | 3394 | run( | |
| 3424 | 3395 | arg0, | |
| @@ -3428,63 +3399,108 @@ func (_c *MockWebKitContextProvider_Initialize_Call) Run(run func(ctx context.Co | |||
| 3428 | 3399 | return _c | |
| 3429 | 3400 | } | |
| 3430 | 3401 | ||
| 3431 | - | func (_c *MockWebKitContextProvider_Initialize_Call) Return(err error) *MockWebKitContextProvider_Initialize_Call { | |
| 3402 | + | func (_c *MockKeybindingsSaver_SetKeybinding_Call) Return(err error) *MockKeybindingsSaver_SetKeybinding_Call { | |
| 3432 | 3403 | _c.Call.Return(err) | |
| 3433 | 3404 | return _c | |
| 3434 | 3405 | } | |
| 3435 | 3406 | ||
| 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 { | |
| 3437 | 3408 | _c.Call.Return(run) | |
| 3438 | 3409 | return _c | |
| 3439 | 3410 | } | |
| 3440 | 3411 | ||
| 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) | |
| 3444 | 3442 | return | |
| 3445 | 3443 | } | |
| 3446 | 3444 | ||
| 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 { | |
| 3449 | 3447 | *mock.Call | |
| 3450 | 3448 | } | |
| 3451 | 3449 | ||
| 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)} | |
| 3456 | 3457 | } | |
| 3457 | 3458 | ||
| 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 { | |
| 3459 | 3460 | _c.Call.Run(func(args mock.Arguments) { | |
| 3460 | - | var arg0 string | |
| 3461 | + | var arg0 context.Context | |
| 3461 | 3462 | 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)) | |
| 3463 | 3476 | } | |
| 3464 | 3477 | run( | |
| 3465 | 3478 | arg0, | |
| 3479 | + | arg1, | |
| 3480 | + | arg2, | |
| 3481 | + | arg3, | |
| 3466 | 3482 | ) | |
| 3467 | 3483 | }) | |
| 3468 | 3484 | return _c | |
| 3469 | 3485 | } | |
| 3470 | 3486 | ||
| 3471 | - | func (_c *MockWebKitContextProvider_PrefetchDNS_Call) Return() *MockWebKitContextProvider_PrefetchDNS_Call { | |
| 3487 | + | func (_c *MockPermissionDialogPresenter_ShowPermissionDialog_Call) Return() *MockPermissionDialogPresenter_ShowPermissionDialog_Call { | |
| 3472 | 3488 | _c.Call.Return() | |
| 3473 | 3489 | return _c | |
| 3474 | 3490 | } | |
| 3475 | 3491 | ||
| 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 { | |
| 3477 | 3493 | _c.Run(run) | |
| 3478 | 3494 | return _c | |
| 3479 | 3495 | } | |
| 3480 | 3496 | ||
| 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. | |
| 3482 | 3498 | // The first argument is typically a *testing.T value. | |
| 3483 | - | func NewMockWebView(t interface { | |
| 3499 | + | func NewMockPermissionRepository(t interface { | |
| 3484 | 3500 | mock.TestingT | |
| 3485 | 3501 | Cleanup(func()) | |
| 3486 | - | }) *MockWebView { | |
| 3487 | - | mock := &MockWebView{} | |
| 3502 | + | }) *MockPermissionRepository { | |
| 3503 | + | mock := &MockPermissionRepository{} | |
| 3488 | 3504 | mock.Mock.Test(t) | |
| 3489 | 3505 | ||
| 3490 | 3506 | t.Cleanup(func() { mock.AssertExpectations(t) }) | |
| @@ -3492,745 +3508,2418 @@ func NewMockWebView(t interface { | |||
| 3492 | 3508 | return mock | |
| 3493 | 3509 | } | |
| 3494 | 3510 | ||
| 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 { | |
| 3497 | 3513 | mock.Mock | |
| 3498 | 3514 | } | |
| 3499 | 3515 | ||
| 3500 | - | type MockWebView_Expecter struct { | |
| 3516 | + | type MockPermissionRepository_Expecter struct { | |
| 3501 | 3517 | mock *mock.Mock | |
| 3502 | 3518 | } | |
| 3503 | 3519 | ||
| 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} | |
| 3506 | 3522 | } | |
| 3507 | 3523 | ||
| 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) | |
| 3511 | 3527 | ||
| 3512 | 3528 | if len(ret) == 0 { | |
| 3513 | - | panic("no return value specified for CanGoBack") | |
| 3529 | + | panic("no return value specified for Delete") | |
| 3514 | 3530 | } | |
| 3515 | 3531 | ||
| 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) | |
| 3519 | 3535 | } else { | |
| 3520 | - | r0 = ret.Get(0).(bool) | |
| 3536 | + | r0 = ret.Error(0) | |
| 3521 | 3537 | } | |
| 3522 | 3538 | return r0 | |
| 3523 | 3539 | } | |
| 3524 | 3540 | ||
| 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 { | |
| 3527 | 3543 | *mock.Call | |
| 3528 | 3544 | } | |
| 3529 | 3545 | ||
| 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)} | |
| 3533 | 3552 | } | |
| 3534 | 3553 | ||
| 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 { | |
| 3536 | 3555 | _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 | + | ) | |
| 3538 | 3573 | }) | |
| 3539 | 3574 | return _c | |
| 3540 | 3575 | } | |
| 3541 | 3576 | ||
| 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) | |
| 3544 | 3579 | return _c | |
| 3545 | 3580 | } | |
| 3546 | 3581 | ||
| 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 { | |
| 3548 | 3583 | _c.Call.Return(run) | |
| 3549 | 3584 | return _c | |
| 3550 | 3585 | } | |
| 3551 | 3586 | ||
| 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) | |
| 3555 | 3590 | ||
| 3556 | 3591 | if len(ret) == 0 { | |
| 3557 | - | panic("no return value specified for CanGoForward") | |
| 3592 | + | panic("no return value specified for Get") | |
| 3558 | 3593 | } | |
| 3559 | 3594 | ||
| 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) | |
| 3563 | 3602 | } 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") | |
| 3565 | 5140 | } | |
| 3566 | - | return r0 | |
| 3567 | - | } | |
| 3568 | 5141 | ||
| 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 { | |
| 3571 | 5153 | *mock.Call | |
| 3572 | 5154 | } | |
| 3573 | 5155 | ||
| 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")} | |
| 3577 | 5159 | } | |
| 3578 | 5160 | ||
| 3579 | - | func (_c *MockWebView_CanGoForward_Call) Run(run func()) *MockWebView_CanGoForward_Call { | |
| 5161 | + | func (_c *MockWebView_ID_Call) Run(run func()) *MockWebView_ID_Call { | |
| 3580 | 5162 | _c.Call.Run(func(args mock.Arguments) { | |
| 3581 | 5163 | run() | |
| 3582 | 5164 | }) | |
| 3583 | 5165 | return _c | |
| 3584 | 5166 | } | |
| 3585 | 5167 | ||
| 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) | |
| 3588 | 5170 | return _c | |
| 3589 | 5171 | } | |
| 3590 | 5172 | ||
| 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 { | |
| 3592 | 5174 | _c.Call.Return(run) | |
| 3593 | 5175 | return _c | |
| 3594 | 5176 | } | |
| 3595 | 5177 | ||
| 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 | |
| 3600 | 5193 | } | |
| 3601 | 5194 | ||
| 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 { | |
| 3604 | 5197 | *mock.Call | |
| 3605 | 5198 | } | |
| 3606 | 5199 | ||
| 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")} | |
| 3610 | 5203 | } | |
| 3611 | 5204 | ||
| 3612 | - | func (_c *MockWebView_Destroy_Call) Run(run func()) *MockWebView_Destroy_Call { | |
| 5205 | + | func (_c *MockWebView_IsDestroyed_Call) Run(run func()) *MockWebView_IsDestroyed_Call { | |
| 3613 | 5206 | _c.Call.Run(func(args mock.Arguments) { | |
| 3614 | 5207 | run() | |
| 3615 | 5208 | }) | |
| 3616 | 5209 | return _c | |
| 3617 | 5210 | } | |
| 3618 | 5211 | ||
| 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) | |
| 3621 | 5214 | return _c | |
| 3622 | 5215 | } | |
| 3623 | 5216 | ||
| 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) | |
| 3626 | 5219 | return _c | |
| 3627 | 5220 | } | |
| 3628 | 5221 | ||
| 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 { | |
| 3631 | 5224 | ret := _mock.Called() | |
| 3632 | 5225 | ||
| 3633 | 5226 | if len(ret) == 0 { | |
| 3634 | - | panic("no return value specified for EstimatedProgress") | |
| 5227 | + | panic("no return value specified for IsFullscreen") | |
| 3635 | 5228 | } | |
| 3636 | 5229 | ||
| 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 { | |
| 3639 | 5232 | r0 = returnFunc() | |
| 3640 | 5233 | } else { | |
| 3641 | - | r0 = ret.Get(0).(float64) | |
| 5234 | + | r0 = ret.Get(0).(bool) | |
| 3642 | 5235 | } | |
| 3643 | 5236 | return r0 | |
| 3644 | 5237 | } | |
| 3645 | 5238 | ||
| 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 { | |
| 3648 | 5241 | *mock.Call | |
| 3649 | 5242 | } | |
| 3650 | 5243 | ||
| 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")} | |
| 3654 | 5247 | } | |
| 3655 | 5248 | ||
| 3656 | - | func (_c *MockWebView_EstimatedProgress_Call) Run(run func()) *MockWebView_EstimatedProgress_Call { | |
| 5249 | + | func (_c *MockWebView_IsFullscreen_Call) Run(run func()) *MockWebView_IsFullscreen_Call { | |
| 3657 | 5250 | _c.Call.Run(func(args mock.Arguments) { | |
| 3658 | 5251 | run() | |
| 3659 | 5252 | }) | |
| 3660 | 5253 | return _c | |
| 3661 | 5254 | } | |
| 3662 | 5255 | ||
| 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) | |
| 3665 | 5258 | return _c | |
| 3666 | 5259 | } | |
| 3667 | 5260 | ||
| 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 { | |
| 3669 | 5262 | _c.Call.Return(run) | |
| 3670 | 5263 | return _c | |
| 3671 | 5264 | } | |
| 3672 | 5265 | ||
| 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 { | |
| 3675 | 5268 | ret := _mock.Called() | |
| 3676 | 5269 | ||
| 3677 | 5270 | if len(ret) == 0 { | |
| 3678 | - | panic("no return value specified for GetFindController") | |
| 5271 | + | panic("no return value specified for IsLoading") | |
| 3679 | 5272 | } | |
| 3680 | 5273 | ||
| 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 { | |
| 3683 | 5276 | r0 = returnFunc() | |
| 3684 | 5277 | } else { | |
| 3685 | - | if ret.Get(0) != nil { | |
| 3686 | - | r0 = ret.Get(0).(port.FindController) | |
| 3687 | - | } | |
| 5278 | + | r0 = ret.Get(0).(bool) | |
| 3688 | 5279 | } | |
| 3689 | 5280 | return r0 | |
| 3690 | 5281 | } | |
| 3691 | 5282 | ||
| 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 { | |
| 3694 | 5285 | *mock.Call | |
| 3695 | 5286 | } | |
| 3696 | 5287 | ||
| 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")} | |
| 3700 | 5291 | } | |
| 3701 | 5292 | ||
| 3702 | - | func (_c *MockWebView_GetFindController_Call) Run(run func()) *MockWebView_GetFindController_Call { | |
| 5293 | + | func (_c *MockWebView_IsLoading_Call) Run(run func()) *MockWebView_IsLoading_Call { | |
| 3703 | 5294 | _c.Call.Run(func(args mock.Arguments) { | |
| 3704 | 5295 | run() | |
| 3705 | 5296 | }) | |
| 3706 | 5297 | return _c | |
| 3707 | 5298 | } | |
| 3708 | 5299 | ||
| 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) | |
| 3711 | 5302 | return _c | |
| 3712 | 5303 | } | |
| 3713 | 5304 | ||
| 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 { | |
| 3715 | 5306 | _c.Call.Return(run) | |
| 3716 | 5307 | return _c | |
| 3717 | 5308 | } | |
| 3718 | 5309 | ||
| 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 { | |
| 3721 | 5312 | ret := _mock.Called() | |
| 3722 | 5313 | ||
| 3723 | 5314 | if len(ret) == 0 { | |
| 3724 | - | panic("no return value specified for GetZoomLevel") | |
| 5315 | + | panic("no return value specified for IsPlayingAudio") | |
| 3725 | 5316 | } | |
| 3726 | 5317 | ||
| 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 { | |
| 3729 | 5320 | r0 = returnFunc() | |
| 3730 | 5321 | } else { | |
| 3731 | - | r0 = ret.Get(0).(float64) | |
| 5322 | + | r0 = ret.Get(0).(bool) | |
| 3732 | 5323 | } | |
| 3733 | 5324 | return r0 | |
| 3734 | 5325 | } | |
| 3735 | 5326 | ||
| 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 { | |
| 3738 | 5329 | *mock.Call | |
| 3739 | 5330 | } | |
| 3740 | 5331 | ||
| 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")} | |
| 3744 | 5335 | } | |
| 3745 | 5336 | ||
| 3746 | - | func (_c *MockWebView_GetZoomLevel_Call) Run(run func()) *MockWebView_GetZoomLevel_Call { | |
| 5337 | + | func (_c *MockWebView_IsPlayingAudio_Call) Run(run func()) *MockWebView_IsPlayingAudio_Call { | |
| 3747 | 5338 | _c.Call.Run(func(args mock.Arguments) { | |
| 3748 | 5339 | run() | |
| 3749 | 5340 | }) | |
| 3750 | 5341 | return _c | |
| 3751 | 5342 | } | |
| 3752 | 5343 | ||
| 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) | |
| 3755 | 5346 | return _c | |
| 3756 | 5347 | } | |
| 3757 | 5348 | ||
| 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 { | |
| 3759 | 5350 | _c.Call.Return(run) | |
| 3760 | 5351 | return _c | |
| 3761 | 5352 | } | |
| 3762 | 5353 | ||
| 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) | |
| 3766 | 5357 | ||
| 3767 | 5358 | if len(ret) == 0 { | |
| 3768 | - | panic("no return value specified for GoBack") | |
| 5359 | + | panic("no return value specified for LoadHTML") | |
| 3769 | 5360 | } | |
| 3770 | 5361 | ||
| 3771 | 5362 | 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) | |
| 3774 | 5365 | } else { | |
| 3775 | 5366 | r0 = ret.Error(0) | |
| 3776 | 5367 | } | |
| 3777 | 5368 | return r0 | |
| 3778 | 5369 | } | |
| 3779 | 5370 | ||
| 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 { | |
| 3782 | 5373 | *mock.Call | |
| 3783 | 5374 | } | |
| 3784 | 5375 | ||
| 3785 | - | // GoBack is a helper method to define mock.On call | |
| 5376 | + | // LoadHTML is a helper method to define mock.On call | |
| 3786 | 5377 | // - 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)} | |
| 3789 | 5382 | } | |
| 3790 | 5383 | ||
| 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 { | |
| 3792 | 5385 | _c.Call.Run(func(args mock.Arguments) { | |
| 3793 | 5386 | var arg0 context.Context | |
| 3794 | 5387 | if args[0] != nil { | |
| 3795 | 5388 | arg0 = args[0].(context.Context) | |
| 3796 | 5389 | } | |
| 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 | + | } | |
| 3797 | 5398 | run( | |
| 3798 | 5399 | arg0, | |
| 5400 | + | arg1, | |
| 5401 | + | arg2, | |
| 3799 | 5402 | ) | |
| 3800 | 5403 | }) | |
| 3801 | 5404 | return _c | |
| 3802 | 5405 | } | |
| 3803 | 5406 | ||
| 3804 | - | func (_c *MockWebView_GoBack_Call) Return(err error) *MockWebView_GoBack_Call { | |
| 5407 | + | func (_c *MockWebView_LoadHTML_Call) Return(err error) *MockWebView_LoadHTML_Call { | |
| 3805 | 5408 | _c.Call.Return(err) | |
| 3806 | 5409 | return _c | |
| 3807 | 5410 | } | |
| 3808 | 5411 | ||
| 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 { | |
| 3810 | 5413 | _c.Call.Return(run) | |
| 3811 | 5414 | return _c | |
| 3812 | 5415 | } | |
| 3813 | 5416 | ||
| 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) | |
| 3817 | 5420 | ||
| 3818 | 5421 | if len(ret) == 0 { | |
| 3819 | - | panic("no return value specified for GoForward") | |
| 5422 | + | panic("no return value specified for LoadURI") | |
| 3820 | 5423 | } | |
| 3821 | 5424 | ||
| 3822 | 5425 | 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) | |
| 3825 | 5428 | } else { | |
| 3826 | 5429 | r0 = ret.Error(0) | |
| 3827 | 5430 | } | |
| 3828 | 5431 | return r0 | |
| 3829 | 5432 | } | |
| 3830 | 5433 | ||
| 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 { | |
| 3833 | 5436 | *mock.Call | |
| 3834 | 5437 | } | |
| 3835 | 5438 | ||
| 3836 | - | // GoForward is a helper method to define mock.On call | |
| 5439 | + | // LoadURI is a helper method to define mock.On call | |
| 3837 | 5440 | // - 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)} | |
| 3840 | 5444 | } | |
| 3841 | 5445 | ||
| 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 { | |
| 3843 | 5447 | _c.Call.Run(func(args mock.Arguments) { | |
| 3844 | 5448 | var arg0 context.Context | |
| 3845 | 5449 | if args[0] != nil { | |
| 3846 | 5450 | arg0 = args[0].(context.Context) | |
| 3847 | 5451 | } | |
| 5452 | + | var arg1 string | |
| 5453 | + | if args[1] != nil { | |
| 5454 | + | arg1 = args[1].(string) | |
| 5455 | + | } | |
| 3848 | 5456 | run( | |
| 3849 | 5457 | arg0, | |
| 5458 | + | arg1, | |
| 3850 | 5459 | ) | |
| 3851 | 5460 | }) | |
| 3852 | 5461 | return _c | |
| 3853 | 5462 | } | |
| 3854 | 5463 | ||
| 3855 | - | func (_c *MockWebView_GoForward_Call) Return(err error) *MockWebView_GoForward_Call { | |
| 5464 | + | func (_c *MockWebView_LoadURI_Call) Return(err error) *MockWebView_LoadURI_Call { | |
| 3856 | 5465 | _c.Call.Return(err) | |
| 3857 | 5466 | return _c | |
| 3858 | 5467 | } | |
| 3859 | 5468 | ||
| 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 { | |
| 3861 | 5470 | _c.Call.Return(run) | |
| 3862 | 5471 | return _c | |
| 3863 | 5472 | } | |
| 3864 | 5473 | ||
| 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) | |
| 3868 | 5477 | ||
| 3869 | 5478 | if len(ret) == 0 { | |
| 3870 | - | panic("no return value specified for ID") | |
| 5479 | + | panic("no return value specified for Reload") | |
| 3871 | 5480 | } | |
| 3872 | 5481 | ||
| 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) | |
| 3876 | 5485 | } else { | |
| 3877 | - | r0 = ret.Get(0).(port.WebViewID) | |
| 5486 | + | r0 = ret.Error(0) | |
| 3878 | 5487 | } | |
| 3879 | 5488 | return r0 | |
| 3880 | 5489 | } | |
| 3881 | 5490 | ||
| 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 { | |
| 3884 | 5493 | *mock.Call | |
| 3885 | 5494 | } | |
| 3886 | 5495 | ||
| 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)} | |
| 3890 | 5500 | } | |
| 3891 | 5501 | ||
| 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 { | |
| 3893 | 5503 | _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 | + | ) | |
| 3895 | 5511 | }) | |
| 3896 | 5512 | return _c | |
| 3897 | 5513 | } | |
| 3898 | 5514 | ||
| 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) | |
| 3901 | 5517 | return _c | |
| 3902 | 5518 | } | |
| 3903 | 5519 | ||
| 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 { | |
| 3905 | 5521 | _c.Call.Return(run) | |
| 3906 | 5522 | return _c | |
| 3907 | 5523 | } | |
| 3908 | 5524 | ||
| 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) | |
| 3912 | 5528 | ||
| 3913 | 5529 | if len(ret) == 0 { | |
| 3914 | - | panic("no return value specified for IsDestroyed") | |
| 5530 | + | panic("no return value specified for ReloadBypassCache") | |
| 3915 | 5531 | } | |
| 3916 | 5532 | ||
| 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) | |
| 3920 | 5536 | } else { | |
| 3921 | - | r0 = ret.Get(0).(bool) | |
| 5537 | + | r0 = ret.Error(0) | |
| 3922 | 5538 | } | |
| 3923 | 5539 | return r0 | |
| 3924 | 5540 | } | |
| 3925 | 5541 | ||
| 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 { | |
| 3928 | 5544 | *mock.Call | |
| 3929 | 5545 | } | |
| 3930 | 5546 | ||
| 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)} | |
| 3934 | 5551 | } | |
| 3935 | 5552 | ||
| 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 { | |
| 3937 | 5554 | _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 | + | ) | |
| 3939 | 5562 | }) | |
| 3940 | 5563 | return _c | |
| 3941 | 5564 | } | |
| 3942 | 5565 | ||
| 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) | |
| 3945 | 5568 | return _c | |
| 3946 | 5569 | } | |
| 3947 | 5570 | ||
| 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 { | |
| 3949 | 5572 | _c.Call.Return(run) | |
| 3950 | 5573 | return _c | |
| 3951 | 5574 | } | |
| 3952 | 5575 | ||
| 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 | |
| 3968 | 5580 | } | |
| 3969 | 5581 | ||
| 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 { | |
| 3972 | 5584 | *mock.Call | |
| 3973 | 5585 | } | |
| 3974 | 5586 | ||
| 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)} | |
| 3978 | 5591 | } | |
| 3979 | 5592 | ||
| 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 { | |
| 3981 | 5594 | _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 | + | ) | |
| 3983 | 5602 | }) | |
| 3984 | 5603 | return _c | |
| 3985 | 5604 | } | |
| 3986 | 5605 | ||
| 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() | |
| 3989 | 5608 | return _c | |
| 3990 | 5609 | } | |
| 3991 | 5610 | ||
| 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) | |
| 3994 | 5613 | return _c | |
| 3995 | 5614 | } | |
| 3996 | 5615 | ||
| 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) | |
| 4000 | 5619 | ||
| 4001 | 5620 | if len(ret) == 0 { | |
| 4002 | - | panic("no return value specified for IsLoading") | |
| 5621 | + | panic("no return value specified for SetZoomLevel") | |
| 4003 | 5622 | } | |
| 4004 | 5623 | ||
| 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) | |
| 4008 | 5627 | } else { | |
| 4009 | - | r0 = ret.Get(0).(bool) | |
| 5628 | + | r0 = ret.Error(0) | |
| 4010 | 5629 | } | |
| 4011 | 5630 | return r0 | |
| 4012 | 5631 | } | |
| 4013 | 5632 | ||
| 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 { | |
| 4016 | 5635 | *mock.Call | |
| 4017 | 5636 | } | |
| 4018 | 5637 | ||
| 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)} | |
| 4022 | 5643 | } | |
| 4023 | 5644 | ||
| 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 { | |
| 4025 | 5646 | _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 | + | ) | |
| 4027 | 5659 | }) | |
| 4028 | 5660 | return _c | |
| 4029 | 5661 | } | |
| 4030 | 5662 | ||
| 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) | |
| 4033 | 5665 | return _c | |
| 4034 | 5666 | } | |
| 4035 | 5667 | ||
| 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 { | |
| 4037 | 5669 | _c.Call.Return(run) | |
| 4038 | 5670 | return _c | |
| 4039 | 5671 | } | |
| 4040 | 5672 | ||
| 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 { | |
| 4043 | 5675 | ret := _mock.Called() | |
| 4044 | 5676 | ||
| 4045 | 5677 | if len(ret) == 0 { | |
| 4046 | - | panic("no return value specified for IsPlayingAudio") | |
| 5678 | + | panic("no return value specified for State") | |
| 4047 | 5679 | } | |
| 4048 | 5680 | ||
| 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 { | |
| 4051 | 5683 | r0 = returnFunc() | |
| 4052 | 5684 | } else { | |
| 4053 | - | r0 = ret.Get(0).(bool) | |
| 5685 | + | r0 = ret.Get(0).(port.WebViewState) | |
| 4054 | 5686 | } | |
| 4055 | 5687 | return r0 | |
| 4056 | 5688 | } | |
| 4057 | 5689 | ||
| 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 { | |
| 4060 | 5692 | *mock.Call | |
| 4061 | 5693 | } | |
| 4062 | 5694 | ||
| 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")} | |
| 4066 | 5698 | } | |
| 4067 | 5699 | ||
| 4068 | - | func (_c *MockWebView_IsPlayingAudio_Call) Run(run func()) *MockWebView_IsPlayingAudio_Call { | |
| 5700 | + | func (_c *MockWebView_State_Call) Run(run func()) *MockWebView_State_Call { | |
| 4069 | 5701 | _c.Call.Run(func(args mock.Arguments) { | |
| 4070 | 5702 | run() | |
| 4071 | 5703 | }) | |
| 4072 | 5704 | return _c | |
| 4073 | 5705 | } | |
| 4074 | 5706 | ||
| 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) | |
| 4077 | 5709 | return _c | |
| 4078 | 5710 | } | |
| 4079 | 5711 | ||
| 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 { | |
| 4081 | 5713 | _c.Call.Return(run) | |
| 4082 | 5714 | return _c | |
| 4083 | 5715 | } | |
| 4084 | 5716 | ||
| 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) | |
| 4088 | 5720 | ||
| 4089 | 5721 | if len(ret) == 0 { | |
| 4090 | - | panic("no return value specified for LoadHTML") | |
| 5722 | + | panic("no return value specified for Stop") | |
| 4091 | 5723 | } | |
| 4092 | 5724 | ||
| 4093 | 5725 | 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) | |
| 4096 | 5728 | } else { | |
| 4097 | 5729 | r0 = ret.Error(0) | |
| 4098 | 5730 | } | |
| 4099 | 5731 | return r0 | |
| 4100 | 5732 | } | |
| 4101 | 5733 | ||
| 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 { | |
| 4104 | 5736 | *mock.Call | |
| 4105 | 5737 | } | |
| 4106 | 5738 | ||
| 4107 | - | // LoadHTML is a helper method to define mock.On call | |
| 5739 | + | // Stop is a helper method to define mock.On call | |
| 4108 | 5740 | // - 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)} | |
| 4113 | 5743 | } | |
| 4114 | 5744 | ||
| 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 { | |
| 4116 | 5746 | _c.Call.Run(func(args mock.Arguments) { | |
| 4117 | 5747 | var arg0 context.Context | |
| 4118 | 5748 | if args[0] != nil { | |
| 4119 | 5749 | arg0 = args[0].(context.Context) | |
| 4120 | 5750 | } | |
| 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 | - | } | |
| 4129 | 5751 | run( | |
| 4130 | 5752 | arg0, | |
| 4131 | - | arg1, | |
| 4132 | - | arg2, | |
| 4133 | 5753 | ) | |
| 4134 | 5754 | }) | |
| 4135 | 5755 | return _c | |
| 4136 | 5756 | } | |
| 4137 | 5757 | ||
| 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) | |
| 4140 | 5804 | return _c | |
| 4141 | 5805 | } | |
| 4142 | 5806 | ||
| 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 { | |
| 4144 | 5808 | _c.Call.Return(run) | |
| 4145 | 5809 | return _c | |
| 4146 | 5810 | } | |
| 4147 | 5811 | ||
| 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() | |
| 4151 | 5815 | ||
| 4152 | 5816 | if len(ret) == 0 { | |
| 4153 | - | panic("no return value specified for LoadURI") | |
| 5817 | + | panic("no return value specified for URI") | |
| 4154 | 5818 | } | |
| 4155 | 5819 | ||
| 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() | |
| 4159 | 5823 | } else { | |
| 4160 | - | r0 = ret.Error(0) | |
| 5824 | + | r0 = ret.Get(0).(string) | |
| 4161 | 5825 | } | |
| 4162 | 5826 | return r0 | |
| 4163 | 5827 | } | |
| 4164 | 5828 | ||
| 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 { | |
| 4167 | 5831 | *mock.Call | |
| 4168 | 5832 | } | |
| 4169 | 5833 | ||
| 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")} | |
| 4175 | 5837 | } | |
| 4176 | 5838 | ||
| 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 { | |
| 4178 | 5840 | _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() | |
| 4191 | 5842 | }) | |
| 4192 | 5843 | return _c | |
| 4193 | 5844 | } | |
| 4194 | 5845 | ||
| 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) | |
| 4197 | 5848 | return _c | |
| 4198 | 5849 | } | |
| 4199 | 5850 | ||
| 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 { | |
| 4201 | 5852 | _c.Call.Return(run) | |
| 4202 | 5853 | return _c | |
| 4203 | 5854 | } | |
| 4204 | 5855 | ||
| 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) { | |
| 4207 | 5885 | ret := _mock.Called(ctx) | |
| 4208 | 5886 | ||
| 4209 | 5887 | if len(ret) == 0 { | |
| 4210 | - | panic("no return value specified for Reload") | |
| 5888 | + | panic("no return value specified for Acquire") | |
| 4211 | 5889 | } | |
| 4212 | 5890 | ||
| 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 { | |
| 4215 | 5897 | r0 = returnFunc(ctx) | |
| 4216 | 5898 | } else { | |
| 4217 | - | r0 = ret.Error(0) | |
| 5899 | + | if ret.Get(0) != nil { | |
| 5900 | + | r0 = ret.Get(0).(port.WebView) | |
| 5901 | + | } | |
| 4218 | 5902 | } | |
| 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 | |
| 4220 | 5909 | } | |
| 4221 | 5910 | ||
| 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 { | |
| 4224 | 5913 | *mock.Call | |
| 4225 | 5914 | } | |
| 4226 | 5915 | ||
| 4227 | - | // Reload is a helper method to define mock.On call | |
| 5916 | + | // Acquire is a helper method to define mock.On call | |
| 4228 | 5917 | // - 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)} | |
| 4231 | 5920 | } | |
| 4232 | 5921 | ||
| 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 { | |
| 4234 | 5923 | _c.Call.Run(func(args mock.Arguments) { | |
| 4235 | 5924 | var arg0 context.Context | |
| 4236 | 5925 | if args[0] != nil { | |
| @@ -4243,89 +5932,71 @@ func (_c *MockWebView_Reload_Call) Run(run func(ctx context.Context)) *MockWebVi | |||
| 4243 | 5932 | return _c | |
| 4244 | 5933 | } | |
| 4245 | 5934 | ||
| 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) | |
| 4248 | 5937 | return _c | |
| 4249 | 5938 | } | |
| 4250 | 5939 | ||
| 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 { | |
| 4252 | 5941 | _c.Call.Return(run) | |
| 4253 | 5942 | return _c | |
| 4254 | 5943 | } | |
| 4255 | 5944 | ||
| 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 | |
| 4271 | 5949 | } | |
| 4272 | 5950 | ||
| 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 { | |
| 4275 | 5953 | *mock.Call | |
| 4276 | 5954 | } | |
| 4277 | 5955 | ||
| 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")} | |
| 4282 | 5959 | } | |
| 4283 | 5960 | ||
| 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 { | |
| 4285 | 5962 | _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() | |
| 4293 | 5964 | }) | |
| 4294 | 5965 | return _c | |
| 4295 | 5966 | } | |
| 4296 | 5967 | ||
| 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() | |
| 4299 | 5970 | return _c | |
| 4300 | 5971 | } | |
| 4301 | 5972 | ||
| 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) | |
| 4304 | 5975 | return _c | |
| 4305 | 5976 | } | |
| 4306 | 5977 | ||
| 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) | |
| 4310 | 5981 | return | |
| 4311 | 5982 | } | |
| 4312 | 5983 | ||
| 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 { | |
| 4315 | 5986 | *mock.Call | |
| 4316 | 5987 | } | |
| 4317 | 5988 | ||
| 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)} | |
| 4322 | 5993 | } | |
| 4323 | 5994 | ||
| 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 { | |
| 4325 | 5996 | _c.Call.Run(func(args mock.Arguments) { | |
| 4326 | - | var arg0 *port.WebViewCallbacks | |
| 5997 | + | var arg0 int | |
| 4327 | 5998 | if args[0] != nil { | |
| 4328 | - | arg0 = args[0].(*port.WebViewCallbacks) | |
| 5999 | + | arg0 = args[0].(int) | |
| 4329 | 6000 | } | |
| 4330 | 6001 | run( | |
| 4331 | 6002 | arg0, | |
| @@ -4334,146 +6005,167 @@ func (_c *MockWebView_SetCallbacks_Call) Run(run func(callbacks *port.WebViewCal | |||
| 4334 | 6005 | return _c | |
| 4335 | 6006 | } | |
| 4336 | 6007 | ||
| 4337 | - | func (_c *MockWebView_SetCallbacks_Call) Return() *MockWebView_SetCallbacks_Call { | |
| 6008 | + | func (_c *MockWebViewPool_Prewarm_Call) Return() *MockWebViewPool_Prewarm_Call { | |
| 4338 | 6009 | _c.Call.Return() | |
| 4339 | 6010 | return _c | |
| 4340 | 6011 | } | |
| 4341 | 6012 | ||
| 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 { | |
| 4343 | 6014 | _c.Run(run) | |
| 4344 | 6015 | return _c | |
| 4345 | 6016 | } | |
| 4346 | 6017 | ||
| 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 | |
| 4362 | 6022 | } | |
| 4363 | 6023 | ||
| 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 { | |
| 4366 | 6026 | *mock.Call | |
| 4367 | 6027 | } | |
| 4368 | 6028 | ||
| 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)} | |
| 4374 | 6033 | } | |
| 4375 | 6034 | ||
| 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) | |
| 4385 | 6040 | } | |
| 4386 | 6041 | run( | |
| 4387 | 6042 | arg0, | |
| 4388 | - | arg1, | |
| 4389 | 6043 | ) | |
| 4390 | 6044 | }) | |
| 4391 | 6045 | return _c | |
| 4392 | 6046 | } | |
| 4393 | 6047 | ||
| 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() | |
| 4396 | 6050 | return _c | |
| 4397 | 6051 | } | |
| 4398 | 6052 | ||
| 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) | |
| 4401 | 6055 | return _c | |
| 4402 | 6056 | } | |
| 4403 | 6057 | ||
| 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 { | |
| 4406 | 6060 | ret := _mock.Called() | |
| 4407 | 6061 | ||
| 4408 | 6062 | if len(ret) == 0 { | |
| 4409 | - | panic("no return value specified for State") | |
| 6063 | + | panic("no return value specified for Size") | |
| 4410 | 6064 | } | |
| 4411 | 6065 | ||
| 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 { | |
| 4414 | 6068 | r0 = returnFunc() | |
| 4415 | 6069 | } else { | |
| 4416 | - | r0 = ret.Get(0).(port.WebViewState) | |
| 6070 | + | r0 = ret.Get(0).(int) | |
| 4417 | 6071 | } | |
| 4418 | 6072 | return r0 | |
| 4419 | 6073 | } | |
| 4420 | 6074 | ||
| 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 { | |
| 4423 | 6077 | *mock.Call | |
| 4424 | 6078 | } | |
| 4425 | 6079 | ||
| 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")} | |
| 4429 | 6083 | } | |
| 4430 | 6084 | ||
| 4431 | - | func (_c *MockWebView_State_Call) Run(run func()) *MockWebView_State_Call { | |
| 6085 | + | func (_c *MockWebViewPool_Size_Call) Run(run func()) *MockWebViewPool_Size_Call { | |
| 4432 | 6086 | _c.Call.Run(func(args mock.Arguments) { | |
| 4433 | 6087 | run() | |
| 4434 | 6088 | }) | |
| 4435 | 6089 | return _c | |
| 4436 | 6090 | } | |
| 4437 | 6091 | ||
| 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) | |
| 4440 | 6094 | return _c | |
| 4441 | 6095 | } | |
| 4442 | 6096 | ||
| 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 { | |
| 4444 | 6098 | _c.Call.Return(run) | |
| 4445 | 6099 | return _c | |
| 4446 | 6100 | } | |
| 4447 | 6101 | ||
| 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) { | |
| 4450 | 6131 | ret := _mock.Called(ctx) | |
| 4451 | 6132 | ||
| 4452 | 6133 | if len(ret) == 0 { | |
| 4453 | - | panic("no return value specified for Stop") | |
| 6134 | + | panic("no return value specified for Create") | |
| 4454 | 6135 | } | |
| 4455 | 6136 | ||
| 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 { | |
| 4458 | 6143 | r0 = returnFunc(ctx) | |
| 4459 | 6144 | } else { | |
| 4460 | - | r0 = ret.Error(0) | |
| 6145 | + | if ret.Get(0) != nil { | |
| 6146 | + | r0 = ret.Get(0).(port.WebView) | |
| 6147 | + | } | |
| 4461 | 6148 | } | |
| 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 | |
| 4463 | 6155 | } | |
| 4464 | 6156 | ||
| 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 { | |
| 4467 | 6159 | *mock.Call | |
| 4468 | 6160 | } | |
| 4469 | 6161 | ||
| 4470 | - | // Stop is a helper method to define mock.On call | |
| 6162 | + | // Create is a helper method to define mock.On call | |
| 4471 | 6163 | // - 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)} | |
| 4474 | 6166 | } | |
| 4475 | 6167 | ||
| 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 { | |
| 4477 | 6169 | _c.Call.Run(func(args mock.Arguments) { | |
| 4478 | 6170 | var arg0 context.Context | |
| 4479 | 6171 | if args[0] != nil { | |
| @@ -4486,111 +6178,91 @@ func (_c *MockWebView_Stop_Call) Run(run func(ctx context.Context)) *MockWebView | |||
| 4486 | 6178 | return _c | |
| 4487 | 6179 | } | |
| 4488 | 6180 | ||
| 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) | |
| 4491 | 6183 | return _c | |
| 4492 | 6184 | } | |
| 4493 | 6185 | ||
| 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 { | |
| 4495 | 6187 | _c.Call.Return(run) | |
| 4496 | 6188 | return _c | |
| 4497 | 6189 | } | |
| 4498 | 6190 | ||
| 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) | |
| 4502 | 6194 | ||
| 4503 | 6195 | if len(ret) == 0 { | |
| 4504 | - | panic("no return value specified for Title") | |
| 6196 | + | panic("no return value specified for CreateRelated") | |
| 4505 | 6197 | } | |
| 4506 | 6198 | ||
| 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) | |
| 4512 | 6203 | } | |
| 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 | + | } | |
| 4549 | 6210 | } | |
| 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) | |
| 4554 | 6213 | } else { | |
| 4555 | - | r0 = ret.Get(0).(string) | |
| 6214 | + | r1 = ret.Error(1) | |
| 4556 | 6215 | } | |
| 4557 | - | return r0 | |
| 6216 | + | return r0, r1 | |
| 4558 | 6217 | } | |
| 4559 | 6218 | ||
| 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 { | |
| 4562 | 6221 | *mock.Call | |
| 4563 | 6222 | } | |
| 4564 | 6223 | ||
| 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)} | |
| 4568 | 6229 | } | |
| 4569 | 6230 | ||
| 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 { | |
| 4571 | 6232 | _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 | + | ) | |
| 4573 | 6245 | }) | |
| 4574 | 6246 | return _c | |
| 4575 | 6247 | } | |
| 4576 | 6248 | ||
| 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) | |
| 4579 | 6251 | return _c | |
| 4580 | 6252 | } | |
| 4581 | 6253 | ||
| 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 { | |
| 4583 | 6255 | _c.Call.Return(run) | |
| 4584 | 6256 | return _c | |
| 4585 | 6257 | } | |
| 4586 | 6258 | ||
| 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. | |
| 4588 | 6260 | // The first argument is typically a *testing.T value. | |
| 4589 | - | func NewMockWebViewPool(t interface { | |
| 6261 | + | func NewMockDevToolsOpener(t interface { | |
| 4590 | 6262 | mock.TestingT | |
| 4591 | 6263 | Cleanup(func()) | |
| 4592 | - | }) *MockWebViewPool { | |
| 4593 | - | mock := &MockWebViewPool{} | |
| 6264 | + | }) *MockDevToolsOpener { | |
| 6265 | + | mock := &MockDevToolsOpener{} | |
| 4594 | 6266 | mock.Mock.Test(t) | |
| 4595 | 6267 | ||
| 4596 | 6268 | t.Cleanup(func() { mock.AssertExpectations(t) }) | |
| @@ -4598,136 +6270,161 @@ func NewMockWebViewPool(t interface { | |||
| 4598 | 6270 | return mock | |
| 4599 | 6271 | } | |
| 4600 | 6272 | ||
| 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 { | |
| 4603 | 6275 | mock.Mock | |
| 4604 | 6276 | } | |
| 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 | |
| 4640 | 6280 | } | |
| 4641 | 6281 | ||
| 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 { | |
| 4644 | 6294 | *mock.Call | |
| 4645 | 6295 | } | |
| 4646 | 6296 | ||
| 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")} | |
| 4651 | 6300 | } | |
| 4652 | 6301 | ||
| 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 { | |
| 4654 | 6303 | _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() | |
| 4662 | 6305 | }) | |
| 4663 | 6306 | return _c | |
| 4664 | 6307 | } | |
| 4665 | 6308 | ||
| 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() | |
| 4668 | 6311 | return _c | |
| 4669 | 6312 | } | |
| 4670 | 6313 | ||
| 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) | |
| 4673 | 6316 | return _c | |
| 4674 | 6317 | } | |
| 4675 | 6318 | ||
| 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() { | |
| 4678 | 6348 | _mock.Called() | |
| 4679 | 6349 | return | |
| 4680 | 6350 | } | |
| 4681 | 6351 | ||
| 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 { | |
| 4684 | 6354 | *mock.Call | |
| 4685 | 6355 | } | |
| 4686 | 6356 | ||
| 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")} | |
| 4690 | 6360 | } | |
| 4691 | 6361 | ||
| 4692 | - | func (_c *MockWebViewPool_Close_Call) Run(run func()) *MockWebViewPool_Close_Call { | |
| 6362 | + | func (_c *MockPrinter_PrintPage_Call) Run(run func()) *MockPrinter_PrintPage_Call { | |
| 4693 | 6363 | _c.Call.Run(func(args mock.Arguments) { | |
| 4694 | 6364 | run() | |
| 4695 | 6365 | }) | |
| 4696 | 6366 | return _c | |
| 4697 | 6367 | } | |
| 4698 | 6368 | ||
| 4699 | - | func (_c *MockWebViewPool_Close_Call) Return() *MockWebViewPool_Close_Call { | |
| 6369 | + | func (_c *MockPrinter_PrintPage_Call) Return() *MockPrinter_PrintPage_Call { | |
| 4700 | 6370 | _c.Call.Return() | |
| 4701 | 6371 | return _c | |
| 4702 | 6372 | } | |
| 4703 | 6373 | ||
| 4704 | - | func (_c *MockWebViewPool_Close_Call) RunAndReturn(run func()) *MockWebViewPool_Close_Call { | |
| 6374 | + | func (_c *MockPrinter_PrintPage_Call) RunAndReturn(run func()) *MockPrinter_PrintPage_Call { | |
| 4705 | 6375 | _c.Run(run) | |
| 4706 | 6376 | return _c | |
| 4707 | 6377 | } | |
| 4708 | 6378 | ||
| 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) | |
| 4712 | 6409 | return | |
| 4713 | 6410 | } | |
| 4714 | 6411 | ||
| 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 { | |
| 4717 | 6414 | *mock.Call | |
| 4718 | 6415 | } | |
| 4719 | 6416 | ||
| 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)} | |
| 4724 | 6421 | } | |
| 4725 | 6422 | ||
| 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 { | |
| 4727 | 6424 | _c.Call.Run(func(args mock.Arguments) { | |
| 4728 | - | var arg0 int | |
| 6425 | + | var arg0 func() | |
| 4729 | 6426 | if args[0] != nil { | |
| 4730 | - | arg0 = args[0].(int) | |
| 6427 | + | arg0 = args[0].(func()) | |
| 4731 | 6428 | } | |
| 4732 | 6429 | run( | |
| 4733 | 6430 | arg0, | |
| @@ -4736,38 +6433,38 @@ func (_c *MockWebViewPool_Prewarm_Call) Run(run func(count int)) *MockWebViewPoo | |||
| 4736 | 6433 | return _c | |
| 4737 | 6434 | } | |
| 4738 | 6435 | ||
| 4739 | - | func (_c *MockWebViewPool_Prewarm_Call) Return() *MockWebViewPool_Prewarm_Call { | |
| 6436 | + | func (_c *MockPopupCapable_SetOnClose_Call) Return() *MockPopupCapable_SetOnClose_Call { | |
| 4740 | 6437 | _c.Call.Return() | |
| 4741 | 6438 | return _c | |
| 4742 | 6439 | } | |
| 4743 | 6440 | ||
| 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 { | |
| 4745 | 6442 | _c.Run(run) | |
| 4746 | 6443 | return _c | |
| 4747 | 6444 | } | |
| 4748 | 6445 | ||
| 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) | |
| 4752 | 6449 | return | |
| 4753 | 6450 | } | |
| 4754 | 6451 | ||
| 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 { | |
| 4757 | 6454 | *mock.Call | |
| 4758 | 6455 | } | |
| 4759 | 6456 | ||
| 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)} | |
| 4764 | 6461 | } | |
| 4765 | 6462 | ||
| 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 { | |
| 4767 | 6464 | _c.Call.Run(func(args mock.Arguments) { | |
| 4768 | - | var arg0 port.WebView | |
| 6465 | + | var arg0 func() | |
| 4769 | 6466 | if args[0] != nil { | |
| 4770 | - | arg0 = args[0].(port.WebView) | |
| 6467 | + | arg0 = args[0].(func()) | |
| 4771 | 6468 | } | |
| 4772 | 6469 | run( | |
| 4773 | 6470 | arg0, | |
| @@ -4776,67 +6473,56 @@ func (_c *MockWebViewPool_Release_Call) Run(run func(wv port.WebView)) *MockWebV | |||
| 4776 | 6473 | return _c | |
| 4777 | 6474 | } | |
| 4778 | 6475 | ||
| 4779 | - | func (_c *MockWebViewPool_Release_Call) Return() *MockWebViewPool_Release_Call { | |
| 6476 | + | func (_c *MockPopupCapable_SetOnReadyToShow_Call) Return() *MockPopupCapable_SetOnReadyToShow_Call { | |
| 4780 | 6477 | _c.Call.Return() | |
| 4781 | 6478 | return _c | |
| 4782 | 6479 | } | |
| 4783 | 6480 | ||
| 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 { | |
| 4785 | 6482 | _c.Run(run) | |
| 4786 | 6483 | return _c | |
| 4787 | 6484 | } | |
| 4788 | 6485 | ||
| 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 | |
| 4804 | 6490 | } | |
| 4805 | 6491 | ||
| 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 { | |
| 4808 | 6494 | *mock.Call | |
| 4809 | 6495 | } | |
| 4810 | 6496 | ||
| 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")} | |
| 4814 | 6500 | } | |
| 4815 | 6501 | ||
| 4816 | - | func (_c *MockWebViewPool_Size_Call) Run(run func()) *MockWebViewPool_Size_Call { | |
| 6502 | + | func (_c *MockPopupCapable_Show_Call) Run(run func()) *MockPopupCapable_Show_Call { | |
| 4817 | 6503 | _c.Call.Run(func(args mock.Arguments) { | |
| 4818 | 6504 | run() | |
| 4819 | 6505 | }) | |
| 4820 | 6506 | return _c | |
| 4821 | 6507 | } | |
| 4822 | 6508 | ||
| 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() | |
| 4825 | 6511 | return _c | |
| 4826 | 6512 | } | |
| 4827 | 6513 | ||
| 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) | |
| 4830 | 6516 | return _c | |
| 4831 | 6517 | } | |
| 4832 | 6518 | ||
| 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. | |
| 4834 | 6520 | // The first argument is typically a *testing.T value. | |
| 4835 | - | func NewMockWebViewFactory(t interface { | |
| 6521 | + | func NewMockOAuthCallbackCapable(t interface { | |
| 4836 | 6522 | mock.TestingT | |
| 4837 | 6523 | Cleanup(func()) | |
| 4838 | - | }) *MockWebViewFactory { | |
| 4839 | - | mock := &MockWebViewFactory{} | |
| 6524 | + | }) *MockOAuthCallbackCapable { | |
| 6525 | + | mock := &MockOAuthCallbackCapable{} | |
| 4840 | 6526 | mock.Mock.Test(t) | |
| 4841 | 6527 | ||
| 4842 | 6528 | t.Cleanup(func() { mock.AssertExpectations(t) }) | |
| @@ -4844,63 +6530,41 @@ func NewMockWebViewFactory(t interface { | |||
| 4844 | 6530 | return mock | |
| 4845 | 6531 | } | |
| 4846 | 6532 | ||
| 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 { | |
| 4849 | 6535 | mock.Mock | |
| 4850 | 6536 | } | |
| 4851 | 6537 | ||
| 4852 | - | type MockWebViewFactory_Expecter struct { | |
| 6538 | + | type MockOAuthCallbackCapable_Expecter struct { | |
| 4853 | 6539 | mock *mock.Mock | |
| 4854 | 6540 | } | |
| 4855 | 6541 | ||
| 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} | |
| 4858 | 6544 | } | |
| 4859 | 6545 | ||
| 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 | |
| 4886 | 6550 | } | |
| 4887 | 6551 | ||
| 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 { | |
| 4890 | 6554 | *mock.Call | |
| 4891 | 6555 | } | |
| 4892 | 6556 | ||
| 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)} | |
| 4897 | 6561 | } | |
| 4898 | 6562 | ||
| 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 { | |
| 4900 | 6564 | _c.Call.Run(func(args mock.Arguments) { | |
| 4901 | - | var arg0 context.Context | |
| 6565 | + | var arg0 func() | |
| 4902 | 6566 | if args[0] != nil { | |
| 4903 | - | arg0 = args[0].(context.Context) | |
| 6567 | + | arg0 = args[0].(func()) | |
| 4904 | 6568 | } | |
| 4905 | 6569 | run( | |
| 4906 | 6570 | arg0, | |
| @@ -4909,80 +6573,85 @@ func (_c *MockWebViewFactory_Create_Call) Run(run func(ctx context.Context)) *Mo | |||
| 4909 | 6573 | return _c | |
| 4910 | 6574 | } | |
| 4911 | 6575 | ||
| 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() | |
| 4914 | 6578 | return _c | |
| 4915 | 6579 | } | |
| 4916 | 6580 | ||
| 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) | |
| 4919 | 6583 | return _c | |
| 4920 | 6584 | } | |
| 4921 | 6585 | ||
| 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 | |
| 4948 | 6590 | } | |
| 4949 | 6591 | ||
| 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 { | |
| 4952 | 6594 | *mock.Call | |
| 4953 | 6595 | } | |
| 4954 | 6596 | ||
| 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)} | |
| 4960 | 6601 | } | |
| 4961 | 6602 | ||
| 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 { | |
| 4963 | 6604 | _c.Call.Run(func(args mock.Arguments) { | |
| 4964 | - | var arg0 context.Context | |
| 6605 | + | var arg0 func(uri string) | |
| 4965 | 6606 | 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)) | |
| 4971 | 6608 | } | |
| 4972 | 6609 | run( | |
| 4973 | 6610 | arg0, | |
| 4974 | - | arg1, | |
| 4975 | 6611 | ) | |
| 4976 | 6612 | }) | |
| 4977 | 6613 | return _c | |
| 4978 | 6614 | } | |
| 4979 | 6615 | ||
| 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() | |
| 4982 | 6618 | return _c | |
| 4983 | 6619 | } | |
| 4984 | 6620 | ||
| 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) | |
| 4987 | 6656 | return _c | |
| 4988 | 6657 | } | |
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 | + | } | |