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

Unified Diff: chrome/android/junit/src/org/chromium/chrome/browser/media/router/cast/JSONTestUtils.java

Issue 2076783004: Changes to update Junit and Mockito. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding myself to junit OWNERS Created 4 years, 4 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: chrome/android/junit/src/org/chromium/chrome/browser/media/router/cast/JSONTestUtils.java
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/media/router/cast/JSONTestUtils.java b/chrome/android/junit/src/org/chromium/chrome/browser/media/router/cast/JSONTestUtils.java
index b52dcae1b91861281c55f45752a9df50a787f058..28e232c8faf0140d46e4de0b21db01de90f5e995 100644
--- a/chrome/android/junit/src/org/chromium/chrome/browser/media/router/cast/JSONTestUtils.java
+++ b/chrome/android/junit/src/org/chromium/chrome/browser/media/router/cast/JSONTestUtils.java
@@ -4,7 +4,6 @@
package org.chromium.chrome.browser.media.router.cast;
-import org.hamcrest.Description;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
@@ -75,7 +74,7 @@ public class JSONTestUtils {
}
}
- static class JSONObjectLike extends ArgumentMatcher<JSONObject> {
+ static class JSONObjectLike implements ArgumentMatcher<JSONObject> {
private final JSONObject mExpected;
public JSONObjectLike(JSONObject expected) {
@@ -83,17 +82,17 @@ public class JSONTestUtils {
}
@Override
- public boolean matches(Object actual) {
- return isJSONObjectEqual(mExpected, (JSONObject) actual);
+ public boolean matches(JSONObject actual) {
+ return isJSONObjectEqual(mExpected, actual);
}
@Override
- public void describeTo(Description description) {
- description.appendText("(JSONObject) " + mExpected.toString());
+ public String toString() {
+ return "(JSONObject) " + mExpected.toString();
}
}
- static class JSONStringLike extends ArgumentMatcher<String> {
+ static class JSONStringLike implements ArgumentMatcher<String> {
private JSONObject mExpected;
public JSONStringLike(JSONObject expected) {
@@ -101,17 +100,17 @@ public class JSONTestUtils {
}
@Override
- public boolean matches(Object actual) {
+ public boolean matches(String actual) {
try {
- return isJSONObjectEqual(mExpected, new JSONObject((String) actual));
+ return isJSONObjectEqual(mExpected, new JSONObject(actual));
} catch (JSONException e) {
return false;
}
}
@Override
- public void describeTo(Description description) {
- description.appendText("\"" + mExpected.toString() + "\"");
+ public String toString() {
+ return "\"" + mExpected.toString() + "\"";
}
}
}

Powered by Google App Engine
This is Rietveld 408576698