jh-changes
Shin'ya Ueoka 7 years ago
parent 413ad780a0
commit 32fb827f02
  1. 28
      e2e/contents/tab.test.js

@ -139,7 +139,7 @@ describe("tab test", () => {
expect(win.tabs).to.have.lengthOf(1); expect(win.tabs).to.have.lengthOf(1);
await keys.press(win.tabs[0].id, 'u'); await keys.press(win.tabs[0].id, 'u');
await new Promise((resolve) => setTimeout(resolve, 100)); await new Promise(resolve => setTimeout(resolve, 100));
win = await windows.get(targetWindow.id); win = await windows.get(targetWindow.id);
expect(win.tabs).to.have.lengthOf(2); expect(win.tabs).to.have.lengthOf(2);
@ -164,21 +164,15 @@ describe("tab test", () => {
expect(win.tabs).to.have.lengthOf(1); expect(win.tabs).to.have.lengthOf(1);
}); });
it('opens view-source by gf', () => { it('opens view-source by gf', async () => {
let target; let win = await windows.get(targetWindow.id);
return Promise.resolve().then(() => { let tab = win.tabs[0];
return windows.get(targetWindow.id); await keys.press(tab.id, 'g');
}).then((win) => { await keys.press(tab.id, 'f');
target = win.tabs[0]; await new Promise(resolve => setTimeout(resolve, 500));
return keys.press(target.id, 'g');
}).then(() => { win = await windows.get(targetWindow.id);
return keys.press(target.id, 'f'); let urls = win.tabs.map((t) => t.url)
}).then(() => { expect(urls).to.include.members([CLIENT_URL + '/', 'view-source:' + CLIENT_URL + '/']);
return new Promise((resolve) => setTimeout(resolve, 500));
}).then(() => {
return windows.get(targetWindow.id);
}).then((win) => {
expect(win.tabs.map((t) => t.url)).to.include.members([CLIENT_URL + '/', 'view-source:' + CLIENT_URL + '/']);
});
}); });
}); });