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

Side by Side Diff: content/browser/devtools/protocol/devtools_protocol_browsertest.cc

Issue 2639203003: Add certificate error handling to devtools. (Closed)
Patch Set: format Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include <stddef.h> 5 #include <stddef.h>
6 #include <utility> 6 #include <utility>
7 7
8 #include "base/base64.h" 8 #include "base/base64.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after
1267 web_contents->GetController().GetTransientEntry(); 1267 web_contents->GetController().GetTransientEntry();
1268 ASSERT_TRUE(transient_entry); 1268 ASSERT_TRUE(transient_entry);
1269 transient_entry->GetSSL().certificate = expired_cert(); 1269 transient_entry->GetSSL().certificate = expired_cert();
1270 ASSERT_TRUE(transient_entry->GetSSL().certificate); 1270 ASSERT_TRUE(transient_entry->GetSSL().certificate);
1271 1271
1272 std::unique_ptr<base::DictionaryValue> params2(new base::DictionaryValue()); 1272 std::unique_ptr<base::DictionaryValue> params2(new base::DictionaryValue());
1273 SendCommand("Security.showCertificateViewer", std::move(params2), true); 1273 SendCommand("Security.showCertificateViewer", std::move(params2), true);
1274 EXPECT_EQ(transient_entry->GetSSL().certificate, last_shown_certificate()); 1274 EXPECT_EQ(transient_entry->GetSSL().certificate, last_shown_certificate());
1275 } 1275 }
1276 1276
1277 IN_PROC_BROWSER_TEST_F(DevToolsProtocolTest, CertificateError) {
1278 net::EmbeddedTestServer https_server(net::EmbeddedTestServer::TYPE_HTTPS);
1279 https_server.SetSSLConfig(net::EmbeddedTestServer::CERT_EXPIRED);
1280 ASSERT_TRUE(https_server.Start());
1281 GURL test_url = https_server.GetURL("/devtools/navigation.html");
1282
1283 Attach();
1284 SendCommand("Security.enable", nullptr, true);
Eric Seckler 2017/01/19 11:42:28 I'm considering whether we should add an additiona
irisu 2017/02/07 23:30:19 Done.
1285 shell()->LoadURL(test_url);
1286
1287 WaitForNotification("Security.certificateError", true);
Eric Seckler 2017/01/19 11:42:28 Shall we also add tests for handleCertificateError
irisu 2017/02/07 23:30:19 As discussed - this has been a struggle.
1288 }
1289
1277 IN_PROC_BROWSER_TEST_F(DevToolsProtocolTest, TargetDiscovery) { 1290 IN_PROC_BROWSER_TEST_F(DevToolsProtocolTest, TargetDiscovery) {
1278 std::string temp; 1291 std::string temp;
1279 std::set<std::string> ids; 1292 std::set<std::string> ids;
1280 std::unique_ptr<base::DictionaryValue> command_params; 1293 std::unique_ptr<base::DictionaryValue> command_params;
1281 std::unique_ptr<base::DictionaryValue> params; 1294 std::unique_ptr<base::DictionaryValue> params;
1282 1295
1283 ASSERT_TRUE(embedded_test_server()->Start()); 1296 ASSERT_TRUE(embedded_test_server()->Start());
1284 GURL first_url = embedded_test_server()->GetURL("/devtools/navigation.html"); 1297 GURL first_url = embedded_test_server()->GetURL("/devtools/navigation.html");
1285 NavigateToURLBlockUntilNavigationsComplete(shell(), first_url, 1); 1298 NavigateToURLBlockUntilNavigationsComplete(shell(), first_url, 1);
1286 1299
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
1507 EXPECT_EQ("polyglottal", value); 1520 EXPECT_EQ("polyglottal", value);
1508 found++; 1521 found++;
1509 } else { 1522 } else {
1510 FAIL(); 1523 FAIL();
1511 } 1524 }
1512 } 1525 }
1513 EXPECT_EQ(2u, found); 1526 EXPECT_EQ(2u, found);
1514 } 1527 }
1515 1528
1516 } // namespace content 1529 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698