From 67eb901fe0b73fc01487a590436423c3c114572b Mon Sep 17 00:00:00 2001 From: Cezar Augusto Date: Thu, 16 Mar 2017 20:22:38 -0300 Subject: [PATCH] Instantly show newTab title instead of location Auditors: @bbondy Fix #7724 Test Plan: covered by automated test --- js/components/tab.js | 2 ++ test/components/tabTest.js | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/js/components/tab.js b/js/components/tab.js index ebf9e7476d6..b937b9532e2 100644 --- a/js/components/tab.js +++ b/js/components/tab.js @@ -85,6 +85,8 @@ class Tab extends ImmutableComponent { // to wait for the title to be parsed. if (this.props.tab.get('location') === 'about:blank') { return locale.translation('aboutBlankTitle') + } else if (this.props.tab.get('location') === 'about:newtab') { + return locale.translation('newTab') } // YouTube tries to change the title to add a play icon when // there is audio. Since we have our own audio indicator we get diff --git a/test/components/tabTest.js b/test/components/tabTest.js index 56315532438..25514ff9dcf 100644 --- a/test/components/tabTest.js +++ b/test/components/tabTest.js @@ -74,6 +74,16 @@ describe('tab tests', function () { yield this.app.client .waitForVisible('webview[partition="persist:default"]') }) + + it('shows new tab title instead of about:newtab', function * () { + yield this.app.client + .ipcSend(messages.SHORTCUT_NEW_FRAME) + .waitForExist('[data-test-id="tab"][data-frame-key="2"]') + .waitUntil(function () { + return this.getText('[data-test-id="tab"][data-frame-key="2"]') + .then((title) => title === 'New Tab') + }) + }) }) describe('new tab button', function () {