From d5e561e777cbfe53a0fddf469b3986a78731de82 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Mon, 4 Feb 2019 14:23:31 +0900 Subject: [PATCH 1/4] Add e2e test case for --- e2e/contents/tab.test.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/e2e/contents/tab.test.js b/e2e/contents/tab.test.js index bfc22ea..3c98dc9 100644 --- a/e2e/contents/tab.test.js +++ b/e2e/contents/tab.test.js @@ -23,6 +23,19 @@ describe("tab test", () => { expect(actual.tabs).to.have.lengthOf(before.tabs.length - 1); }); + it('deletes tabs to the right by D', async () => { + let tab1 = await tabs.create(targetWindow.id, CLIENT_URL + '#1'); + await tabs.create(targetWindow.id, CLIENT_URL + '#2'); + await tabs.create(targetWindow.id, CLIENT_URL + '#3'); + + let before = await windows.get(targetWindow.id) + let tab = await tabs.selectAt(targetWindow.id, tab1.index) + await keys.press(tab.id, 'D', { shiftKey: true }); + + let actual = await windows.get(targetWindow.id); + expect(actual.tabs).to.have.lengthOf(before.tabs.length - 2); + }); + it('duplicates tab by zd', async () => { let tab = await tabs.create(targetWindow.id, CLIENT_URL); let before = await windows.get(targetWindow.id) From 44aff07b89bff560c82820fceeecc7150e0992a4 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Mon, 4 Feb 2019 14:43:03 +0900 Subject: [PATCH 2/4] Remove openerTabId on gH --- src/background/usecases/operation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/background/usecases/operation.js b/src/background/usecases/operation.js index dd24e75..480dd08 100644 --- a/src/background/usecases/operation.js +++ b/src/background/usecases/operation.js @@ -197,7 +197,7 @@ export default class OperationInteractor { return this.tabPresenter.open(us[0], tab.id); } for (let u of us) { - this.tabPresenter.create(u, { openerTabId: tab.id }); + this.tabPresenter.create(u); } } } From ac1a37aeec0a04272e57d6600ff31595e62ad89c Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Mon, 4 Feb 2019 14:43:27 +0900 Subject: [PATCH 3/4] Add test cases for gh/gH --- QA.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/QA.md b/QA.md index 4f37879..e2a6fac 100644 --- a/QA.md +++ b/QA.md @@ -18,6 +18,8 @@ The behaviors of the console are tested in [Console section](#consoles). - [ ] r: reload current tab - [ ] R: reload current tab without cache +- [ ] gh: open start page on current tab +- [ ] gH: open start page to new tab #### Misc From e911d2772c3c8620c0d6207165f1000256a1ae5c Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Mon, 4 Feb 2019 15:11:34 +0900 Subject: [PATCH 4/4] Show alert on opening about:home --- src/background/usecases/operation.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/background/usecases/operation.js b/src/background/usecases/operation.js index 480dd08..73e4111 100644 --- a/src/background/usecases/operation.js +++ b/src/background/usecases/operation.js @@ -193,6 +193,10 @@ export default class OperationInteractor { let tab = await this.tabPresenter.getCurrent(); let result = await browser.browserSettings.homepageOverride.get({}); let us = urls.homepageUrls(result.value); + if (us.length === 1 && us[0] === 'about:home') { + // eslint-disable-next-line max-len + throw new Error('Cannot open Firefox Home (about:home) by WebExnteions, set your custom URLs'); + } if (us.length === 1 && !newTab) { return this.tabPresenter.open(us[0], tab.id); }