| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser.download; | 5 package org.chromium.chrome.browser.download; |
| 6 | 6 |
| 7 import android.content.Context; | 7 import android.content.Context; |
| 8 import android.test.suitebuilder.annotation.SmallTest; | 8 import android.test.suitebuilder.annotation.SmallTest; |
| 9 | 9 |
| 10 import org.chromium.base.test.util.Feature; | 10 import org.chromium.base.test.util.Feature; |
| 11 import org.chromium.chrome.browser.ChromeActivity; | 11 import org.chromium.chrome.browser.ChromeActivity; |
| 12 import org.chromium.chrome.browser.tab.Tab; | 12 import org.chromium.chrome.browser.tab.Tab; |
| 13 import org.chromium.chrome.test.ChromeActivityTestCaseBase; | 13 import org.chromium.chrome.test.ChromeActivityTestCaseBase; |
| 14 import org.chromium.content.browser.DownloadInfo; | |
| 15 | 14 |
| 16 /** | 15 /** |
| 17 * Tests for ChromeDownloadDelegate class. | 16 * Tests for ChromeDownloadDelegate class. |
| 18 */ | 17 */ |
| 19 public class ChromeDownloadDelegateTest extends ChromeActivityTestCaseBase<Chrom
eActivity> { | 18 public class ChromeDownloadDelegateTest extends ChromeActivityTestCaseBase<Chrom
eActivity> { |
| 20 | 19 |
| 21 public ChromeDownloadDelegateTest() { | 20 public ChromeDownloadDelegateTest() { |
| 22 super(ChromeActivity.class); | 21 super(ChromeActivity.class); |
| 23 } | 22 } |
| 24 | 23 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 52 new MockChromeDownloadDelegate(getInstrumentation().getTargetCon
text(), tab); | 51 new MockChromeDownloadDelegate(getInstrumentation().getTargetCon
text(), tab); |
| 53 assertFalse(delegate.shouldInterceptContextMenuDownload("file://test/tes
t.html")); | 52 assertFalse(delegate.shouldInterceptContextMenuDownload("file://test/tes
t.html")); |
| 54 assertFalse(delegate.shouldInterceptContextMenuDownload("http://test/tes
t.html")); | 53 assertFalse(delegate.shouldInterceptContextMenuDownload("http://test/tes
t.html")); |
| 55 assertFalse(delegate.shouldInterceptContextMenuDownload("ftp://test/test
.dm")); | 54 assertFalse(delegate.shouldInterceptContextMenuDownload("ftp://test/test
.dm")); |
| 56 assertFalse(delegate.shouldInterceptContextMenuDownload("data://test.dd"
)); | 55 assertFalse(delegate.shouldInterceptContextMenuDownload("data://test.dd"
)); |
| 57 assertFalse(delegate.shouldInterceptContextMenuDownload("http://test.dd"
)); | 56 assertFalse(delegate.shouldInterceptContextMenuDownload("http://test.dd"
)); |
| 58 assertFalse(delegate.shouldInterceptContextMenuDownload("http://test/tes
t.dd")); | 57 assertFalse(delegate.shouldInterceptContextMenuDownload("http://test/tes
t.dd")); |
| 59 assertTrue(delegate.shouldInterceptContextMenuDownload("https://test/tes
t.dm")); | 58 assertTrue(delegate.shouldInterceptContextMenuDownload("https://test/tes
t.dm")); |
| 60 } | 59 } |
| 61 } | 60 } |
| OLD | NEW |