ant-design-blazor/tests/AntDesign.TestKit
Tony Yip 4b04f09832 perf: avoid memory leak issue of event listener (#1857)
* perf: avoid memory leak #1834

Avoid memory leak by remove the exclusive parameter and logic in the code block on AddEventListener method in DomEventService class.

The following are the components affected:
components/affix/Affix.razor.cs
components/anchor/Anchor.razor.cs
components/carousel/Carousel.razor.cs
components/core/Component/Overlay/Overlay.razor.cs
components/core/Component/Overlay/OverlayTrigger.razor.cs
components/core/JsInterop/DomEventService.cs
components/descriptions/Descriptions.razor.cs
components/dropdown/DropdownButton.cs
components/grid/Row.razor.cs
components/input/Input.cs
components/input/TextArea.razor.cs
components/layout/Sider.razor.cs
components/list/ListItem.razor.cs
components/select/Select.razor.cs
components/select/internal/SelectContent.razor.cs
components/slider/Slider.razor.cs
components/table/Table.razor.cs
components/tabs/Tabs.razor.cs

* fix override AddEventListener method in AntDesign.TestKit project

* add register/remove event listerner for exclusive use in DomEventService class

* move _dotNetObjects to DomEventListerner class/service, so that users not required to maintain it in each component.

* * move share/reuse dom event listerner methods to DomEventListerner class

* remove method 'AddEventListener' that no longer exists in DomEventService class in AntDesign.TestKit project

* * change the component referring to an IDomEventListerner interface instead of a concrete class,
  so that the component can be tested via a mock TestDomEventListerner.

* introduce DisposeShared and Dispose method in DomEventListerner to ease user remove callback from DomEventListerner

* register IDomEventListerner into DI container instead of create manually

* fix FormatKey

* fix FormatKey

* fix tests

* fix test

* fix test

Co-authored-by: James Yeung <shunjiey@hotmail.com>
2021-09-09 12:56:11 +08:00
..
Properties test: add TestKit for public tests (#1248) 2021-04-04 21:37:06 +08:00
AntDesign.TestKit.csproj perf: avoid memory leak issue of event listener (#1857) 2021-09-09 12:56:11 +08:00
AntDesignTestBase.cs merge 0.8.1 to feature 2021-05-16 19:58:03 +08:00
RecordedTestExtensions.cs test: add TestKit for public tests (#1248) 2021-04-04 21:37:06 +08:00
TestDomEventListerner.cs perf: avoid memory leak issue of event listener (#1857) 2021-09-09 12:56:11 +08:00
TestDomEventService.cs perf: avoid memory leak issue of event listener (#1857) 2021-09-09 12:56:11 +08:00
TestNavigationManager.cs feat:(module: form): edit context dynamic change (#1504) 2021-05-11 11:13:14 +08:00