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: ios/web/net/cert_verifier_block_adapter_unittest.cc

Issue 1231783003: WKWebView: Do not DCHECK on invalid CertVerifierBlockAdapter::Params. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web/net/cert_verifier_block_adapter.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/net/cert_verifier_block_adapter_unittest.cc
diff --git a/ios/web/net/cert_verifier_block_adapter_unittest.cc b/ios/web/net/cert_verifier_block_adapter_unittest.cc
index 5f8aa600a66f97855b3620ec75ae7dfa6c2a4312..1380045e16e79eee8386043d1cbf9474262a776e 100644
--- a/ios/web/net/cert_verifier_block_adapter_unittest.cc
+++ b/ios/web/net/cert_verifier_block_adapter_unittest.cc
@@ -135,6 +135,26 @@ TEST_F(CertVerifierBlockAdapterTest, DefaultParamsAndAsync) {
actualResult->is_issued_by_known_root);
}
+// Tests |Verify| with invalid arguments.
+TEST_F(CertVerifierBlockAdapterTest, InvalidParamsAndError) {
+ // Set up expectation.
+ const int kExpectedStatus = ERR_INVALID_ARGUMENT;
+ EXPECT_CALL(*cert_verifier_mock_,
+ Verify(nullptr, "", "", 0, nullptr, _, _, _, _))
+ .Times(1)
+ .WillOnce(testing::Return(kExpectedStatus));
+
+ // Call |Verify|.
+ scoped_ptr<CertVerifyResult> actualResult;
+ int actualStatus = -1;
+ CertVerifierBlockAdapter::Params params(nullptr, "");
+ Verify(params, &actualResult, &actualStatus);
+
+ // Ensure that Verification results are correct.
+ EXPECT_EQ(kExpectedStatus, actualStatus);
+ EXPECT_FALSE(actualResult);
+}
+
// Tests |Verify| with error.
TEST_F(CertVerifierBlockAdapterTest, DefaultParamsAndError) {
// Set up expectation.
« no previous file with comments | « ios/web/net/cert_verifier_block_adapter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698