aboutsummaryrefslogtreecommitdiff
path: root/test/background/mock
diff options
context:
space:
mode:
Diffstat (limited to 'test/background/mock')
-rw-r--r--test/background/mock/MockFindClient.ts23
-rw-r--r--test/background/mock/MockFindRepository.ts5
-rw-r--r--test/background/mock/MockFramePresenter.ts7
3 files changed, 23 insertions, 12 deletions
diff --git a/test/background/mock/MockFindClient.ts b/test/background/mock/MockFindClient.ts
index bd25a27..dd6d8f3 100644
--- a/test/background/mock/MockFindClient.ts
+++ b/test/background/mock/MockFindClient.ts
@@ -1,24 +1,23 @@
-import FindClient, {
- FindResult,
-} from "../../../src/background/clients/FindClient";
+import FindClient from "../../../src/background/clients/FindClient";
export default class MockFindClient implements FindClient {
- highlightAll(): Promise<void> {
- throw new Error("not implemented");
- }
-
- removeHighlights(): Promise<void> {
+ findNext(
+ _tabId: number,
+ _frameId: number,
+ _keyword: string
+ ): Promise<boolean> {
throw new Error("not implemented");
}
- selectKeyword(
+ findPrev(
_tabId: number,
- _rangeData: browser.find.RangeData
- ): Promise<void> {
+ _frameId: number,
+ _keyword: string
+ ): Promise<boolean> {
throw new Error("not implemented");
}
- startFind(_keyword: string): Promise<FindResult> {
+ clearSelection(_tabId: number, _frameId: number): Promise<void> {
throw new Error("not implemented");
}
}
diff --git a/test/background/mock/MockFindRepository.ts b/test/background/mock/MockFindRepository.ts
index af552c8..d5151f8 100644
--- a/test/background/mock/MockFindRepository.ts
+++ b/test/background/mock/MockFindRepository.ts
@@ -23,4 +23,9 @@ export default class MockFindRepository implements FindRepository {
this.localStates[tabId] = state;
return Promise.resolve();
}
+
+ deleteLocalState(tabId: number): Promise<void> {
+ delete this.localStates[tabId];
+ return Promise.resolve();
+ }
}
diff --git a/test/background/mock/MockFramePresenter.ts b/test/background/mock/MockFramePresenter.ts
new file mode 100644
index 0000000..d688780
--- /dev/null
+++ b/test/background/mock/MockFramePresenter.ts
@@ -0,0 +1,7 @@
+import FramePresenter from "../../../src/background/presenters/FramePresenter";
+
+export default class MockFramePresenter implements FramePresenter {
+ getAllFrameIds(): Promise<number[]> {
+ throw new Error("not implemented");
+ }
+}