This source file includes following definitions.
- testAuthentication
package org.chromium.chrome.browser;
import android.content.Context;
import android.test.InstrumentationTestCase;
import android.test.suitebuilder.annotation.SmallTest;
public class WebappAuthenticatorTest extends InstrumentationTestCase {
@SmallTest
public void testAuthentication() {
Context context = getInstrumentation().getTargetContext();
String url = "http://www.example.org/hello.html";
byte[] mac = WebappAuthenticator.getMacForUrl(context, url);
assertNotNull(mac);
assertTrue(WebappAuthenticator.isUrlValid(context, url, mac));
assertFalse(WebappAuthenticator.isUrlValid(context, url + "?goats=true", mac));
mac[4] += 1;
assertFalse(WebappAuthenticator.isUrlValid(context, url, mac));
}
}