| Index: components/web_restrictions/browser/junit/src/org/chromium/components/webrestrictions/browser/WebRestrictionsClientTest.java
|
| diff --git a/components/web_restrictions/browser/junit/src/org/chromium/components/webrestrictions/WebRestrictionsClientTest.java b/components/web_restrictions/browser/junit/src/org/chromium/components/webrestrictions/browser/WebRestrictionsClientTest.java
|
| similarity index 89%
|
| rename from components/web_restrictions/browser/junit/src/org/chromium/components/webrestrictions/WebRestrictionsClientTest.java
|
| rename to components/web_restrictions/browser/junit/src/org/chromium/components/webrestrictions/browser/WebRestrictionsClientTest.java
|
| index 0fd87569731eab5190e675aaf3e52693609640b8..c048b8768580abc42ea98615839f34bb73a490b9 100644
|
| --- a/components/web_restrictions/browser/junit/src/org/chromium/components/webrestrictions/WebRestrictionsClientTest.java
|
| +++ b/components/web_restrictions/browser/junit/src/org/chromium/components/webrestrictions/browser/WebRestrictionsClientTest.java
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -package org.chromium.components.webrestrictions;
|
| +package org.chromium.components.webrestrictions.browser;
|
|
|
| import static org.hamcrest.CoreMatchers.is;
|
| import static org.hamcrest.CoreMatchers.nullValue;
|
| @@ -43,7 +43,7 @@ public class WebRestrictionsClientTest {
|
| public void setUp() {
|
| ContextUtils.initApplicationContextForTests(Robolectric.application);
|
| mTestClient = Mockito.spy(new WebRestrictionsClient());
|
| - Mockito.doNothing().when(mTestClient).nativeNotifyWebRestrictionsChanged(anyLong());
|
| + Mockito.doNothing().when(mTestClient).nativeOnWebRestrictionsChanged(anyLong());
|
| mProvider = Mockito.mock(ContentProvider.class);
|
|
|
| mTestClient.init(TEST_CONTENT_PROVIDER, 1234L);
|
| @@ -69,17 +69,19 @@ public class WebRestrictionsClientTest {
|
| when(mProvider.query(any(Uri.class), any(String[].class), anyString(), any(String[].class),
|
| anyString()))
|
| .thenReturn(null);
|
| - WebRestrictionsClient.ShouldProceedResult result =
|
| - mTestClient.shouldProceed("http://example.com");
|
| + WebRestrictionsClientResult result = mTestClient.shouldProceed("http://example.com");
|
| verify(mProvider).query(Uri.parse("content://" + TEST_CONTENT_PROVIDER + "/authorized"),
|
| null, "url = 'http://example.com'", null, null);
|
| assertThat(result.shouldProceed(), is(true));
|
| - assertThat(result.getString(1), is(nullValue()));
|
| + assertThat(result.getString(2), is(nullValue()));
|
|
|
| Cursor cursor = Mockito.mock(Cursor.class);
|
| when(cursor.getInt(0)).thenReturn(1);
|
| when(cursor.getInt(1)).thenReturn(42);
|
| when(cursor.getString(2)).thenReturn("No error");
|
| + when(cursor.getColumnName(1)).thenReturn("Error Int");
|
| + when(cursor.getColumnName(2)).thenReturn("Error String");
|
| + when(cursor.getColumnCount()).thenReturn(3);
|
| when(mProvider.query(any(Uri.class), any(String[].class), anyString(), any(String[].class),
|
| anyString()))
|
| .thenReturn(cursor);
|
| @@ -118,6 +120,6 @@ public class WebRestrictionsClientTest {
|
|
|
| ContentResolver resolver = Robolectric.application.getContentResolver();
|
| resolver.notifyChange(Uri.parse("content://" + TEST_CONTENT_PROVIDER), null);
|
| - verify(mTestClient).nativeNotifyWebRestrictionsChanged(1234L);
|
| + verify(mTestClient).nativeOnWebRestrictionsChanged(1234L);
|
| }
|
| }
|
|
|