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

Side by Side Diff: content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeCoercionTest.java

Issue 353163002: [Android] Switch to Gin Java Bridge implementation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed AwSettingsTest#testBlockNetworkLoadsWithAudio Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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.content.browser; 5 package org.chromium.content.browser;
6 6
7 import android.test.suitebuilder.annotation.SmallTest; 7 import android.test.suitebuilder.annotation.SmallTest;
8 8
9 import org.chromium.base.test.util.Feature; 9 import org.chromium.base.test.util.Feature;
10 10
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 // values as either 32-bit integers or doubles, though this should not 165 // values as either 32-bit integers or doubles, though this should not
166 // affect the result. 166 // affect the result.
167 @SmallTest 167 @SmallTest
168 @Feature({"AndroidWebView", "Android-JavaBridge"}) 168 @Feature({"AndroidWebView", "Android-JavaBridge"})
169 public void testPassNumberInt32() throws Throwable { 169 public void testPassNumberInt32() throws Throwable {
170 executeJavaScript("testObject.setByteValue(42);"); 170 executeJavaScript("testObject.setByteValue(42);");
171 assertEquals(42, mTestObject.waitForByteValue()); 171 assertEquals(42, mTestObject.waitForByteValue());
172 executeJavaScript("testObject.setByteValue(" + Byte.MAX_VALUE + " + 42); "); 172 executeJavaScript("testObject.setByteValue(" + Byte.MAX_VALUE + " + 42); ");
173 assertEquals(Byte.MIN_VALUE + 42 - 1, mTestObject.waitForByteValue()); 173 assertEquals(Byte.MIN_VALUE + 42 - 1, mTestObject.waitForByteValue());
174 174
175 // LIVECONNECT_COMPLIANCE: Should convert to numeric char value.
176 executeJavaScript("testObject.setCharValue(42);"); 175 executeJavaScript("testObject.setCharValue(42);");
177 assertEquals('\u0000', mTestObject.waitForCharValue()); 176 assertEquals(42, mTestObject.waitForCharValue());
178 177
179 executeJavaScript("testObject.setShortValue(42);"); 178 executeJavaScript("testObject.setShortValue(42);");
180 assertEquals(42, mTestObject.waitForShortValue()); 179 assertEquals(42, mTestObject.waitForShortValue());
181 executeJavaScript("testObject.setShortValue(" + Short.MAX_VALUE + " + 42 );"); 180 executeJavaScript("testObject.setShortValue(" + Short.MAX_VALUE + " + 42 );");
182 assertEquals(Short.MIN_VALUE + 42 - 1, mTestObject.waitForShortValue()); 181 assertEquals(Short.MIN_VALUE + 42 - 1, mTestObject.waitForShortValue());
183 182
184 executeJavaScript("testObject.setIntValue(42);"); 183 executeJavaScript("testObject.setIntValue(42);");
185 assertEquals(42, mTestObject.waitForIntValue()); 184 assertEquals(42, mTestObject.waitForIntValue());
186 185
187 executeJavaScript("testObject.setLongValue(42);"); 186 executeJavaScript("testObject.setLongValue(42);");
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 public void testPassFunctionObject() throws Throwable { 723 public void testPassFunctionObject() throws Throwable {
725 executeJavaScript("func = new Function('a', 'b', 'return a + b');"); 724 executeJavaScript("func = new Function('a', 'b', 'return a + b');");
726 725
727 executeJavaScript("testObject.setStringValue(func);"); 726 executeJavaScript("testObject.setStringValue(func);");
728 assertEquals("undefined", mTestObject.waitForStringValue()); 727 assertEquals("undefined", mTestObject.waitForStringValue());
729 728
730 executeJavaScript("testObject.setObjectValue(func);"); 729 executeJavaScript("testObject.setObjectValue(func);");
731 assertNull(mTestObject.waitForObjectValue()); 730 assertNull(mTestObject.waitForObjectValue());
732 } 731 }
733 } 732 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698