| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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.util; | 5 package org.chromium.chrome.browser.util; |
| 6 | 6 |
| 7 import android.content.Context; | 7 import android.content.Context; |
| 8 import android.net.Uri; | 8 import android.net.Uri; |
| 9 import android.os.AsyncTask; | 9 import android.os.AsyncTask; |
| 10 import android.os.ParcelFileDescriptor; | 10 import android.os.ParcelFileDescriptor; |
| 11 import android.test.suitebuilder.annotation.LargeTest; | 11 import android.support.test.filters.LargeTest; |
| 12 import android.test.suitebuilder.annotation.SmallTest; | 12 import android.support.test.filters.SmallTest; |
| 13 | 13 |
| 14 import org.chromium.content.browser.test.NativeLibraryTestBase; | 14 import org.chromium.content.browser.test.NativeLibraryTestBase; |
| 15 | 15 |
| 16 import java.io.FileNotFoundException; | 16 import java.io.FileNotFoundException; |
| 17 | 17 |
| 18 /** | 18 /** |
| 19 * Tests working of ChromeFileProvider. | 19 * Tests working of ChromeFileProvider. |
| 20 * | 20 * |
| 21 * The openFile should be blocked till notify is called. These tests can timeout
if the notify does | 21 * The openFile should be blocked till notify is called. These tests can timeout
if the notify does |
| 22 * not work correctly. | 22 * not work correctly. |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 // This should be unblocked when the notify is called. | 88 // This should be unblocked when the notify is called. |
| 89 Uri file2 = ChromeFileProvider.getFileUriWhenReady(uri2); | 89 Uri file2 = ChromeFileProvider.getFileUriWhenReady(uri2); |
| 90 assertEquals(fileUri2, file2); | 90 assertEquals(fileUri2, file2); |
| 91 | 91 |
| 92 // This should not be blocked even without a notify since file was chang
ed. | 92 // This should not be blocked even without a notify since file was chang
ed. |
| 93 file1 = ChromeFileProvider.getFileUriWhenReady(uri1); | 93 file1 = ChromeFileProvider.getFileUriWhenReady(uri1); |
| 94 // File should be null because the notify passes a null file uri. | 94 // File should be null because the notify passes a null file uri. |
| 95 assertNull(file1); | 95 assertNull(file1); |
| 96 } | 96 } |
| 97 } | 97 } |
| OLD | NEW |