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

Unified Diff: content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeBasicsTest.java

Issue 843913006: Reverting due to Android builders breakage. Subsequent fixes did not fix. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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: content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeBasicsTest.java
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeBasicsTest.java b/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeBasicsTest.java
index 950e772a112c7278a1a91fa0e5a28e0b91072e95..ddc655b8430b3fb0e609ad97f536731c685f2898 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeBasicsTest.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeBasicsTest.java
@@ -10,7 +10,6 @@ import android.test.suitebuilder.annotation.SmallTest;
import junit.framework.Assert;
-import org.chromium.base.annotations.SuppressFBWarnings;
import org.chromium.base.test.util.Feature;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer;
import org.chromium.content_public.browser.LoadUrlParams;
@@ -37,7 +36,6 @@ import java.util.concurrent.CountDownLatch;
* - Inheritance
*/
public class JavaBridgeBasicsTest extends JavaBridgeTestBase {
- @SuppressFBWarnings("CHROMIUM_SYNCHRONIZED_METHOD")
private class TestController extends Controller {
private int mIntValue;
private long mLongValue;
@@ -145,25 +143,16 @@ public class JavaBridgeBasicsTest extends JavaBridgeTestBase {
}
// Note that this requires that we can pass a JavaScript boolean to Java.
- private void executeAndSetIfException(String script) throws Throwable {
+ private void assertRaisesException(String script) throws Throwable {
executeJavaScript("try {"
+ script + ";"
+ " testController.setBooleanValue(false);"
+ "} catch (exception) {"
+ " testController.setBooleanValue(true);"
+ "}");
- }
-
- private void assertRaisesException(String script) throws Throwable {
- executeAndSetIfException(script);
assertTrue(mTestController.waitForBooleanValue());
}
- private void assertNoRaisedException(String script) throws Throwable {
- executeAndSetIfException(script);
- assertFalse(mTestController.waitForBooleanValue());
- }
-
@SmallTest
@Feature({"AndroidWebView", "Android-JavaBridge"})
public void testTypeOfInjectedObject() throws Throwable {
@@ -642,9 +631,7 @@ public class JavaBridgeBasicsTest extends JavaBridgeTestBase {
injectObjectAndReload(new Object() {
public void method() {}
private void privateMethod() {}
- @SuppressFBWarnings("UUF_UNUSED")
public int field;
- @SuppressFBWarnings("UUF_UNUSED")
private int mPrivateField;
}, "testObject");
executeJavaScript(
@@ -712,16 +699,13 @@ public class JavaBridgeBasicsTest extends JavaBridgeTestBase {
return getClass();
}
- @SuppressFBWarnings("UUF_UNUSED")
private int mField;
}, "testObject");
- String fieldName = "mField";
- assertRaisesException("testObject.myGetClass().getField('" + fieldName + "')");
+ assertRaisesException("testObject.myGetClass().getField('field')");
// getDeclaredField() is able to access a private field, but getInt()
// throws a Java exception.
- assertNoRaisedException("testObject.myGetClass().getDeclaredField('" + fieldName + "')");
assertRaisesException(
- "testObject.myGetClass().getDeclaredField('" + fieldName + "').getInt(testObject)");
+ "testObject.myGetClass().getDeclaredField('field').getInt(testObject)");
}
@SmallTest

Powered by Google App Engine
This is Rietveld 408576698