Commit 63dcc86b authored by estade's avatar estade Committed by Commit bot

Disable "pause" item in context menu for "Save Page As..." downloads.

BUG=618624

Review-Url: https://codereview.chromium.org/2623613009
Cr-Commit-Position: refs/heads/master@{#442740}
parent 30ffb0ff
......@@ -191,6 +191,7 @@ bool DownloadCommands::IsCommandEnabled(Command command) const {
return !download_item_->IsDone();
case PAUSE:
return !download_item_->IsDone() && !download_item_->IsPaused() &&
!download_item_->IsSavePackageDownload() &&
download_item_->GetState() == content::DownloadItem::IN_PROGRESS;
case RESUME:
return download_item_->CanResume() &&
......
......@@ -126,6 +126,11 @@ TEST_F(DownloadCommandsTest, PausedUnresumable) {
EXPECT_FALSE(IsCommandEnabled(DownloadCommands::RESUME));
}
TEST_F(DownloadCommandsTest, CantPauseSavePackage) {
ON_CALL(item(), IsSavePackageDownload()).WillByDefault(Return(true));
EXPECT_FALSE(IsCommandEnabled(DownloadCommands::PAUSE));
}
TEST_F(DownloadCommandsTest, DoOpenWhenComplete) {
// Open when complete.
EXPECT_CALL(item(), OpenDownload()).Times(1);
......
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