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

Unified Diff: components/cronet/android/test/javatests/src/org/chromium/net/PkpTest.java

Issue 1492583002: Add HttpUrlConnection backed implementation of CronetEngine. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 4 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: components/cronet/android/test/javatests/src/org/chromium/net/PkpTest.java
diff --git a/components/cronet/android/test/javatests/src/org/chromium/net/PkpTest.java b/components/cronet/android/test/javatests/src/org/chromium/net/PkpTest.java
index c9775417e69e652c655d5ebfdbd3f201a112905d..d71bdcc1e1d47d60249ba8349fe295686344cf5f 100644
--- a/components/cronet/android/test/javatests/src/org/chromium/net/PkpTest.java
+++ b/components/cronet/android/test/javatests/src/org/chromium/net/PkpTest.java
@@ -62,6 +62,7 @@ public class PkpTest extends CronetTestBase {
*/
@SmallTest
@Feature({"Cronet"})
+ @OnlyRunNativeCronet
public void testErrorCodeIfPinDoesNotMatch() throws Exception {
byte[] nonMatchingHash = generateSomeSha256();
addPkpSha256(mServerHost, nonMatchingHash, EXCLUDE_SUBDOMAINS, DISTANT_FUTURE);
@@ -80,6 +81,7 @@ public class PkpTest extends CronetTestBase {
*/
@SmallTest
@Feature({"Cronet"})
+ @OnlyRunNativeCronet
public void testSuccessIfPinMatches() throws Exception {
// Get PKP hash of the real certificate
X509Certificate cert = readCertFromFileInPemFormat(CERT_USED);
@@ -102,6 +104,7 @@ public class PkpTest extends CronetTestBase {
*/
@SmallTest
@Feature({"Cronet"})
+ @OnlyRunNativeCronet
public void testIncludeSubdomainsFlagEqualTrue() throws Exception {
byte[] nonMatchingHash = generateSomeSha256();
addPkpSha256(mDomain, nonMatchingHash, INCLUDE_SUBDOMAINS, DISTANT_FUTURE);
@@ -121,6 +124,7 @@ public class PkpTest extends CronetTestBase {
*/
@SmallTest
@Feature({"Cronet"})
+ @OnlyRunNativeCronet
public void testIncludeSubdomainsFlagEqualFalse() throws Exception {
byte[] nonMatchingHash = generateSomeSha256();
addPkpSha256(mDomain, nonMatchingHash, EXCLUDE_SUBDOMAINS, DISTANT_FUTURE);
@@ -140,6 +144,7 @@ public class PkpTest extends CronetTestBase {
*/
@SmallTest
@Feature({"Cronet"})
+ @OnlyRunNativeCronet
public void testSuccessIfNoPinSpecified() throws Exception {
byte[] nonMatchingHash = generateSomeSha256();
addPkpSha256("otherhost.com", nonMatchingHash, INCLUDE_SUBDOMAINS, DISTANT_FUTURE);
@@ -158,6 +163,7 @@ public class PkpTest extends CronetTestBase {
*/
@SmallTest
@Feature({"Cronet"})
+ @OnlyRunNativeCronet
public void testSoonExpiringPin() throws Exception {
final int tenSecondsAhead = 10;
byte[] nonMatchingHash = generateSomeSha256();
@@ -177,6 +183,7 @@ public class PkpTest extends CronetTestBase {
*/
@SmallTest
@Feature({"Cronet"})
+ @OnlyRunNativeCronet
public void testRecentlyExpiredPin() throws Exception {
final int oneSecondAgo = -1;
byte[] nonMatchingHash = generateSomeSha256();
@@ -195,6 +202,7 @@ public class PkpTest extends CronetTestBase {
*/
@SmallTest
@Feature({"Cronet"})
+ @OnlyRunNativeCronet
public void testPinsAreNotPersisted() throws Exception {
byte[] nonMatchingHash = generateSomeSha256();
addPkpSha256(mServerHost, nonMatchingHash, EXCLUDE_SUBDOMAINS, DISTANT_FUTURE);

Powered by Google App Engine
This is Rietveld 408576698