Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(369)

Unified Diff: components/web_restrictions/browser/junit/src/org/chromium/components/webrestrictions/WebRestrictionsClientTest.java

Issue 1847523002: Avoid HTML in WebRestrictionsContentProvider interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to one more comment Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/web_restrictions/browser/junit/src/org/chromium/components/webrestrictions/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/WebRestrictionsClientTest.java
index b4ad0a9aa5197d52aa5abf3c66f130e872b02938..662fbf4057e4aa060cebdf4daa39ea0bf2645c83 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/WebRestrictionsClientTest.java
@@ -74,26 +74,26 @@ public class WebRestrictionsClientTest {
verify(mProvider).query(Uri.parse("content://" + TEST_CONTENT_PROVIDER + "/authorized"),
null, "url = 'http://example.com'", null, null);
assertThat(result.shouldProceed(), is(true));
- assertThat(result.getErrorPage(), is(nullValue()));
+ assertThat(result.getString(1), is(nullValue()));
Cursor cursor = Mockito.mock(Cursor.class);
when(cursor.getInt(0)).thenReturn(1);
- when(cursor.getString(1)).thenReturn("No error");
+ when(cursor.getInt(1)).thenReturn(42);
+ when(cursor.getString(2)).thenReturn("No error");
when(mProvider.query(any(Uri.class), any(String[].class), anyString(), any(String[].class),
anyString()))
.thenReturn(cursor);
result = mTestClient.shouldProceed("http://example.com");
assertThat(result.shouldProceed(), is(true));
- assertThat(result.getErrorPage(), is(nullValue()));
+ assertThat(result.getInt(1), is(42));
+ assertThat(result.getString(2), is("No error"));
when(cursor.getInt(0)).thenReturn(0);
- when(cursor.getString(1)).thenReturn("Error");
when(mProvider.query(any(Uri.class), any(String[].class), anyString(), any(String[].class),
anyString()))
.thenReturn(cursor);
result = mTestClient.shouldProceed("http://example.com");
assertThat(result.shouldProceed(), is(false));
- assertThat(result.getErrorPage(), is("Error"));
}
@Test

Powered by Google App Engine
This is Rietveld 408576698