Commit eba23a11 authored by Lei Tian's avatar Lei Tian Committed by Commit Bot

Fix Browser Actions bugs

This CL fixes Browser Actions bugs includes:
1. Change download menu text to "Download link".
2. Fix flaky test.

Bug: 773073, 831306
Change-Id: I4f2bc4d9288c2d96b7d878eb80ac0802e8065fe3
Reviewed-on: https://chromium-review.googlesource.com/1091875Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Commit-Queue: Lei Tian <ltian@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565718}
parent aee6fc83
...@@ -1917,7 +1917,7 @@ To obtain new licenses, connect to the internet and play your downloaded content ...@@ -1917,7 +1917,7 @@ To obtain new licenses, connect to the internet and play your downloaded content
Open in incognito tab Open in incognito tab
</message> </message>
<message name="IDS_BROWSER_ACTIONS_SAVE_LINK_AS" desc="Browser Actions menu item to download the page of the selected link. [CHAR-LIMIT=30]"> <message name="IDS_BROWSER_ACTIONS_SAVE_LINK_AS" desc="Browser Actions menu item to download the page of the selected link. [CHAR-LIMIT=30]">
Download page Download link
</message> </message>
<message name="IDS_BROWSER_ACTIONS_COPY_ADDRESS" desc="Browser Actions menu item to copy the url address of the selected link. [CHAR-LIMIT=30]"> <message name="IDS_BROWSER_ACTIONS_COPY_ADDRESS" desc="Browser Actions menu item to copy the url address of the selected link. [CHAR-LIMIT=30]">
Copy link Copy link
......
...@@ -418,7 +418,6 @@ public class BrowserActionActivityTest { ...@@ -418,7 +418,6 @@ public class BrowserActionActivityTest {
final BrowserActionActivity activity2 = startBrowserActionActivity(mTestPage3, 1); final BrowserActionActivity activity2 = startBrowserActionActivity(mTestPage3, 1);
mOnBrowserActionsMenuShownCallback.waitForCallback(1); mOnBrowserActionsMenuShownCallback.waitForCallback(1);
mOnFinishNativeInitializationCallback.waitForCallback(1);
Assert.assertEquals(2, mActivityTestRule.getActivity().getCurrentTabModel().getCount()); Assert.assertEquals(2, mActivityTestRule.getActivity().getCurrentTabModel().getCount());
openTabInBackground(activity2); openTabInBackground(activity2);
// Notification title should be shown for multiple tabs. // Notification title should be shown for multiple tabs.
...@@ -431,13 +430,22 @@ public class BrowserActionActivityTest { ...@@ -431,13 +430,22 @@ public class BrowserActionActivityTest {
}); });
// Tabs should always be added at the end of the model. // Tabs should always be added at the end of the model.
Assert.assertEquals(3, mActivityTestRule.getActivity().getCurrentTabModel().getCount()); int tabCount = mActivityTestRule.getActivity().getCurrentTabModel().getCount();
Assert.assertEquals(mTestPage, Assert.assertEquals(mTestPage,
mActivityTestRule.getActivity().getCurrentTabModel().getTabAt(0).getUrl()); mActivityTestRule.getActivity()
.getCurrentTabModel()
.getTabAt(tabCount - 3)
.getUrl());
Assert.assertEquals(mTestPage2, Assert.assertEquals(mTestPage2,
mActivityTestRule.getActivity().getCurrentTabModel().getTabAt(1).getUrl()); mActivityTestRule.getActivity()
.getCurrentTabModel()
.getTabAt(tabCount - 2)
.getUrl());
Assert.assertEquals(mTestPage3, Assert.assertEquals(mTestPage3,
mActivityTestRule.getActivity().getCurrentTabModel().getTabAt(2).getUrl()); mActivityTestRule.getActivity()
.getCurrentTabModel()
.getTabAt(tabCount - 1)
.getUrl());
Intent notificationIntent = BrowserActionsService.getNotificationIntent(); Intent notificationIntent = BrowserActionsService.getNotificationIntent();
notificationIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); notificationIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment