| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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.test; | 5 package org.chromium.chrome.browser.test; |
| 6 | 6 |
| 7 import android.content.ContentProvider; | 7 import android.content.ContentProvider; |
| 8 import android.content.ContentResolver; | 8 import android.content.ContentResolver; |
| 9 import android.test.IsolatedContext; | 9 import android.test.IsolatedContext; |
| 10 import android.test.mock.MockContentResolver; | 10 import android.test.mock.MockContentResolver; |
| 11 | 11 |
| 12 import org.chromium.chrome.browser.ChromeBrowserProvider; | 12 import org.chromium.chrome.browser.ChromeBrowserProvider; |
| 13 import org.chromium.chrome.testshell.ChromiumTestShellActivity; | 13 import org.chromium.chrome.shell.ChromiumTestShellActivity; |
| 14 import org.chromium.chrome.testshell.ChromiumTestShellTestBase; | 14 import org.chromium.chrome.shell.ChromiumTestShellTestBase; |
| 15 | 15 |
| 16 /** | 16 /** |
| 17 * Base class for Chrome's ContentProvider tests. | 17 * Base class for Chrome's ContentProvider tests. |
| 18 * Sets up a local ChromeBrowserProvider associated to a mock resolver in an iso
lated context. | 18 * Sets up a local ChromeBrowserProvider associated to a mock resolver in an iso
lated context. |
| 19 */ | 19 */ |
| 20 public class ProviderTestBase extends ChromiumTestShellTestBase { | 20 public class ProviderTestBase extends ChromiumTestShellTestBase { |
| 21 | 21 |
| 22 private IsolatedContext mContext; | 22 private IsolatedContext mContext; |
| 23 | 23 |
| 24 @Override | 24 @Override |
| (...skipping 11 matching lines...) Expand all Loading... |
| 36 resolver.addProvider(ChromeBrowserProvider.getInternalAuthority(activity
), provider); | 36 resolver.addProvider(ChromeBrowserProvider.getInternalAuthority(activity
), provider); |
| 37 | 37 |
| 38 mContext = new IsolatedContext(resolver, activity); | 38 mContext = new IsolatedContext(resolver, activity); |
| 39 assertTrue(getContentResolver() instanceof MockContentResolver); | 39 assertTrue(getContentResolver() instanceof MockContentResolver); |
| 40 } | 40 } |
| 41 | 41 |
| 42 protected ContentResolver getContentResolver() { | 42 protected ContentResolver getContentResolver() { |
| 43 return mContext.getContentResolver(); | 43 return mContext.getContentResolver(); |
| 44 } | 44 } |
| 45 } | 45 } |
| OLD | NEW |