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

Side by Side Diff: chrome/browser/ssl_uitest.cc

Issue 16490: Add FTP unit test in preparation for portable FTP implementation.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/sessions/session_restore_uitest.cc ('k') | chrome/browser/tab_restore_uitest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 <Windows.h> 5 #include <Windows.h>
6 #include <Wincrypt.h> 6 #include <Wincrypt.h>
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "chrome/common/pref_names.h" 10 #include "chrome/common/pref_names.h"
(...skipping 23 matching lines...) Expand all
34 void NavigateTab(TabProxy* tab_proxy, const GURL& url) { 34 void NavigateTab(TabProxy* tab_proxy, const GURL& url) {
35 ASSERT_TRUE(tab_proxy->NavigateToURL(url)); 35 ASSERT_TRUE(tab_proxy->NavigateToURL(url));
36 } 36 }
37 37
38 void AppendTab(const GURL& url) { 38 void AppendTab(const GURL& url) {
39 scoped_ptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); 39 scoped_ptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0));
40 EXPECT_TRUE(browser_proxy.get()); 40 EXPECT_TRUE(browser_proxy.get());
41 EXPECT_TRUE(browser_proxy->AppendTab(url)); 41 EXPECT_TRUE(browser_proxy->AppendTab(url));
42 } 42 }
43 43
44 TestServer* PlainServer() { 44 HTTPTestServer* PlainServer() {
45 return new TestServer(kDocRoot); 45 return HTTPTestServer::CreateServer(kDocRoot);
46 } 46 }
47 47
48 HTTPSTestServer* GoodCertServer() { 48 HTTPSTestServer* GoodCertServer() {
49 return new HTTPSTestServer(util_.kHostName, util_.kOKHTTPSPort, 49 return HTTPSTestServer::CreateServer(util_.kHostName, util_.kOKHTTPSPort,
50 kDocRoot, util_.GetOKCertPath().ToWStringHack()); 50 kDocRoot, util_.GetOKCertPath().ToWStringHack());
51 } 51 }
52 52
53 HTTPSTestServer* BadCertServer() { 53 HTTPSTestServer* BadCertServer() {
54 return new HTTPSTestServer(util_.kHostName, util_.kBadHTTPSPort, 54 return HTTPSTestServer::CreateServer(util_.kHostName, util_.kBadHTTPSPort,
55 kDocRoot, util_.GetExpiredCertPath().ToWStringHack()); 55 kDocRoot, util_.GetExpiredCertPath().ToWStringHack());
56 } 56 }
57 57
58 protected: 58 protected:
59 SSLTestUtil util_; 59 SSLTestUtil util_;
60 60
61 DISALLOW_COPY_AND_ASSIGN(SSLUITest); 61 DISALLOW_COPY_AND_ASSIGN(SSLUITest);
62 }; 62 };
63 63
64 } // namespace 64 } // namespace
65 65
66 // Visits a regular page over http. 66 // Visits a regular page over http.
67 TEST_F(SSLUITest, TestHTTP) { 67 TEST_F(SSLUITest, TestHTTP) {
68 scoped_ptr<TestServer> server(PlainServer()); 68 scoped_ptr<HTTPTestServer> server(PlainServer());
69 69
70 scoped_ptr<TabProxy> tab(GetActiveTabProxy()); 70 scoped_ptr<TabProxy> tab(GetActiveTabProxy());
71 NavigateTab(tab.get(), server->TestServerPageW(L"files/ssl/google.html")); 71 NavigateTab(tab.get(), server->TestServerPageW(L"files/ssl/google.html"));
72 72
73 NavigationEntry::PageType page_type; 73 NavigationEntry::PageType page_type;
74 EXPECT_TRUE(tab->GetPageType(&page_type)); 74 EXPECT_TRUE(tab->GetPageType(&page_type));
75 EXPECT_EQ(NavigationEntry::NORMAL_PAGE, page_type); 75 EXPECT_EQ(NavigationEntry::NORMAL_PAGE, page_type);
76 76
77 SecurityStyle security_style; 77 SecurityStyle security_style;
78 int cert_status; 78 int cert_status;
79 int mixed_content_state; 79 int mixed_content_state;
80 EXPECT_TRUE(tab->GetSecurityState(&security_style, &cert_status, 80 EXPECT_TRUE(tab->GetSecurityState(&security_style, &cert_status,
81 &mixed_content_state)); 81 &mixed_content_state));
82 EXPECT_EQ(SECURITY_STYLE_UNAUTHENTICATED, security_style); 82 EXPECT_EQ(SECURITY_STYLE_UNAUTHENTICATED, security_style);
83 EXPECT_EQ(0, cert_status); 83 EXPECT_EQ(0, cert_status);
84 EXPECT_EQ(NavigationEntry::SSLStatus::NORMAL_CONTENT, mixed_content_state); 84 EXPECT_EQ(NavigationEntry::SSLStatus::NORMAL_CONTENT, mixed_content_state);
85 } 85 }
86 86
87 // Visits a page over http which includes broken https resources (status should 87 // Visits a page over http which includes broken https resources (status should
88 // be OK). 88 // be OK).
89 TEST_F(SSLUITest, TestHTTPWithBrokenHTTPSResource) { 89 TEST_F(SSLUITest, TestHTTPWithBrokenHTTPSResource) {
90 scoped_ptr<TestServer> http_server(PlainServer()); 90 scoped_ptr<HTTPTestServer> http_server(PlainServer());
91 scoped_ptr<HTTPSTestServer> bad_https_server(BadCertServer()); 91 scoped_ptr<HTTPSTestServer> bad_https_server(BadCertServer());
92 scoped_ptr<TabProxy> tab(GetActiveTabProxy()); 92 scoped_ptr<TabProxy> tab(GetActiveTabProxy());
93 93
94 NavigateTab(tab.get(), 94 NavigateTab(tab.get(),
95 http_server->TestServerPageW(L"files/ssl/page_with_unsafe_contents.html")) ; 95 http_server->TestServerPageW(L"files/ssl/page_with_unsafe_contents.html")) ;
96 96
97 SecurityStyle security_style; 97 SecurityStyle security_style;
98 int cert_status; 98 int cert_status;
99 int mixed_content_state; 99 int mixed_content_state;
100 EXPECT_TRUE(tab->GetSecurityState(&security_style, &cert_status, 100 EXPECT_TRUE(tab->GetSecurityState(&security_style, &cert_status,
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 EXPECT_EQ(NavigationEntry::SSLStatus::NORMAL_CONTENT, mixed_content_state); 157 EXPECT_EQ(NavigationEntry::SSLStatus::NORMAL_CONTENT, mixed_content_state);
158 } 158 }
159 159
160 // 160 //
161 // Mixed contents 161 // Mixed contents
162 // 162 //
163 163
164 // Visits a page with mixed content. 164 // Visits a page with mixed content.
165 TEST_F(SSLUITest, TestMixedContents) { 165 TEST_F(SSLUITest, TestMixedContents) {
166 scoped_ptr<HTTPSTestServer> https_server(GoodCertServer()); 166 scoped_ptr<HTTPSTestServer> https_server(GoodCertServer());
167 scoped_ptr<TestServer> http_server(PlainServer()); 167 scoped_ptr<HTTPTestServer> http_server(PlainServer());
168 168
169 // Load a page with mixed-content, the default behavior is to show the mixed 169 // Load a page with mixed-content, the default behavior is to show the mixed
170 // content. 170 // content.
171 scoped_ptr<TabProxy> tab(GetActiveTabProxy()); 171 scoped_ptr<TabProxy> tab(GetActiveTabProxy());
172 NavigateTab(tab.get(), 172 NavigateTab(tab.get(),
173 https_server->TestServerPageW(L"files/ssl/page_with_mixed_contents.html")) ; 173 https_server->TestServerPageW(L"files/ssl/page_with_mixed_contents.html")) ;
174 NavigationEntry::PageType page_type; 174 NavigationEntry::PageType page_type;
175 EXPECT_TRUE(tab->GetPageType(&page_type)); 175 EXPECT_TRUE(tab->GetPageType(&page_type));
176 EXPECT_EQ(NavigationEntry::NORMAL_PAGE, page_type); 176 EXPECT_EQ(NavigationEntry::NORMAL_PAGE, page_type);
177 177
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 bool js_result = false; 279 bool js_result = false;
280 EXPECT_TRUE(tab->ExecuteAndExtractBool(L"", 280 EXPECT_TRUE(tab->ExecuteAndExtractBool(L"",
281 L"window.domAutomationController.send(IsFooSet());", 281 L"window.domAutomationController.send(IsFooSet());",
282 &js_result)); 282 &js_result));
283 EXPECT_FALSE(js_result); 283 EXPECT_FALSE(js_result);
284 } 284 }
285 285
286 // Visits a page with mixed content loaded by JS (after the initial page load). 286 // Visits a page with mixed content loaded by JS (after the initial page load).
287 TEST_F(SSLUITest, TestMixedContentsLoadedFromJS) { 287 TEST_F(SSLUITest, TestMixedContentsLoadedFromJS) {
288 scoped_ptr<HTTPSTestServer> https_server(GoodCertServer()); 288 scoped_ptr<HTTPSTestServer> https_server(GoodCertServer());
289 scoped_ptr<TestServer> http_server(PlainServer()); 289 scoped_ptr<HTTPTestServer> http_server(PlainServer());
290 290
291 scoped_ptr<TabProxy> tab(GetActiveTabProxy()); 291 scoped_ptr<TabProxy> tab(GetActiveTabProxy());
292 NavigateTab(tab.get(), https_server->TestServerPageW( 292 NavigateTab(tab.get(), https_server->TestServerPageW(
293 L"files/ssl/page_with_dynamic_mixed_contents.html")); 293 L"files/ssl/page_with_dynamic_mixed_contents.html"));
294 NavigationEntry::PageType page_type; 294 NavigationEntry::PageType page_type;
295 EXPECT_TRUE(tab->GetPageType(&page_type)); 295 EXPECT_TRUE(tab->GetPageType(&page_type));
296 EXPECT_EQ(NavigationEntry::NORMAL_PAGE, page_type); 296 EXPECT_EQ(NavigationEntry::NORMAL_PAGE, page_type);
297 SecurityStyle security_style; 297 SecurityStyle security_style;
298 int cert_status; 298 int cert_status;
299 int mixed_content_state; 299 int mixed_content_state;
(...skipping 18 matching lines...) Expand all
318 EXPECT_EQ(0, 318 EXPECT_EQ(0,
319 cert_status & net::CERT_STATUS_ALL_ERRORS); // No errors expected. 319 cert_status & net::CERT_STATUS_ALL_ERRORS); // No errors expected.
320 EXPECT_EQ(NavigationEntry::SSLStatus::MIXED_CONTENT, mixed_content_state); 320 EXPECT_EQ(NavigationEntry::SSLStatus::MIXED_CONTENT, mixed_content_state);
321 } 321 }
322 322
323 // Visits a page with an image over http. Visits another page over https 323 // Visits a page with an image over http. Visits another page over https
324 // referencing that same image over http (hoping it is coming from the webcore 324 // referencing that same image over http (hoping it is coming from the webcore
325 // memory cache). 325 // memory cache).
326 TEST_F(SSLUITest, TestCachedMixedContents) { 326 TEST_F(SSLUITest, TestCachedMixedContents) {
327 scoped_ptr<HTTPSTestServer> https_server(GoodCertServer()); 327 scoped_ptr<HTTPSTestServer> https_server(GoodCertServer());
328 scoped_ptr<TestServer> http_server(PlainServer()); 328 scoped_ptr<HTTPTestServer> http_server(PlainServer());
329 329
330 scoped_ptr<TabProxy> tab(GetActiveTabProxy()); 330 scoped_ptr<TabProxy> tab(GetActiveTabProxy());
331 NavigateTab(tab.get(), http_server->TestServerPageW( 331 NavigateTab(tab.get(), http_server->TestServerPageW(
332 L"files/ssl/page_with_mixed_contents.html")); 332 L"files/ssl/page_with_mixed_contents.html"));
333 333
334 NavigationEntry::PageType page_type; 334 NavigationEntry::PageType page_type;
335 EXPECT_TRUE(tab->GetPageType(&page_type)); 335 EXPECT_TRUE(tab->GetPageType(&page_type));
336 EXPECT_EQ(NavigationEntry::NORMAL_PAGE, page_type); 336 EXPECT_EQ(NavigationEntry::NORMAL_PAGE, page_type);
337 SecurityStyle security_style; 337 SecurityStyle security_style;
338 int cert_status; 338 int cert_status;
(...skipping 18 matching lines...) Expand all
357 EXPECT_EQ(0, 357 EXPECT_EQ(0,
358 cert_status & net::CERT_STATUS_ALL_ERRORS); // No errors expected. 358 cert_status & net::CERT_STATUS_ALL_ERRORS); // No errors expected.
359 EXPECT_EQ(NavigationEntry::SSLStatus::MIXED_CONTENT, mixed_content_state); 359 EXPECT_EQ(NavigationEntry::SSLStatus::MIXED_CONTENT, mixed_content_state);
360 } 360 }
361 361
362 // This test ensures the CN invalid status does not 'stick' to a certificate 362 // This test ensures the CN invalid status does not 'stick' to a certificate
363 // (see bug #1044942) and that it depends on the host-name. 363 // (see bug #1044942) and that it depends on the host-name.
364 // TODO(jcampan): this test is flacky and fails sometimes (bug #1065095) 364 // TODO(jcampan): this test is flacky and fails sometimes (bug #1065095)
365 TEST_F(SSLUITest, DISABLED_TestCNInvalidStickiness) { 365 TEST_F(SSLUITest, DISABLED_TestCNInvalidStickiness) {
366 const std::string kLocalHost = "localhost"; 366 const std::string kLocalHost = "localhost";
367 scoped_ptr<HTTPSTestServer> https_server( 367 scoped_refptr<HTTPSTestServer> https_server =
368 new HTTPSTestServer(kLocalHost, util_.kOKHTTPSPort, 368 HTTPSTestServer::CreateServer(kLocalHost, util_.kOKHTTPSPort,
369 kDocRoot, util_.GetOKCertPath().ToWStringHack())); 369 kDocRoot, util_.GetOKCertPath().ToWStringHack());
370 ASSERT_TRUE(NULL != https_server.get());
370 371
371 // First we hit the server with hostname, this generates an invalid policy 372 // First we hit the server with hostname, this generates an invalid policy
372 // error. 373 // error.
373 scoped_ptr<TabProxy> tab(GetActiveTabProxy()); 374 scoped_ptr<TabProxy> tab(GetActiveTabProxy());
374 NavigateTab(tab.get(), https_server->TestServerPageW( 375 NavigateTab(tab.get(), https_server->TestServerPageW(
375 L"files/ssl/google.html")); 376 L"files/ssl/google.html"));
376 377
377 // We get an interstitial page as a result. 378 // We get an interstitial page as a result.
378 NavigationEntry::PageType page_type; 379 NavigationEntry::PageType page_type;
379 EXPECT_TRUE(tab->GetPageType(&page_type)); 380 EXPECT_TRUE(tab->GetPageType(&page_type));
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 EXPECT_EQ(SECURITY_STYLE_AUTHENTICATION_BROKEN, security_style); 469 EXPECT_EQ(SECURITY_STYLE_AUTHENTICATION_BROKEN, security_style);
469 EXPECT_EQ(net::CERT_STATUS_DATE_INVALID, 470 EXPECT_EQ(net::CERT_STATUS_DATE_INVALID,
470 cert_status & net::CERT_STATUS_ALL_ERRORS); 471 cert_status & net::CERT_STATUS_ALL_ERRORS);
471 EXPECT_EQ(NavigationEntry::SSLStatus::NORMAL_CONTENT, mixed_content_state); 472 EXPECT_EQ(NavigationEntry::SSLStatus::NORMAL_CONTENT, mixed_content_state);
472 } 473 }
473 474
474 // Tests that closing a page that has a unsafe pop-up does not crash the browser 475 // Tests that closing a page that has a unsafe pop-up does not crash the browser
475 // (bug #1966). 476 // (bug #1966).
476 // Disabled because flaky (bug #2136). 477 // Disabled because flaky (bug #2136).
477 TEST_F(SSLUITest, DISABLED_TestCloseTabWithUnsafePopup) { 478 TEST_F(SSLUITest, DISABLED_TestCloseTabWithUnsafePopup) {
478 scoped_ptr<TestServer> http_server(PlainServer()); 479 scoped_ptr<HTTPTestServer> http_server(PlainServer());
479 scoped_ptr<HTTPSTestServer> bad_https_server(BadCertServer()); 480 scoped_ptr<HTTPSTestServer> bad_https_server(BadCertServer());
480 481
481 scoped_ptr<TabProxy> tab(GetActiveTabProxy()); 482 scoped_ptr<TabProxy> tab(GetActiveTabProxy());
482 NavigateTab(tab.get(), 483 NavigateTab(tab.get(),
483 http_server->TestServerPageW( 484 http_server->TestServerPageW(
484 L"files/ssl/page_with_unsafe_popup.html")); 485 L"files/ssl/page_with_unsafe_popup.html"));
485 486
486 int popup_count = 0; 487 int popup_count = 0;
487 EXPECT_TRUE(tab->GetConstrainedWindowCount(&popup_count)); 488 EXPECT_TRUE(tab->GetConstrainedWindowCount(&popup_count));
488 EXPECT_EQ(1, popup_count); 489 EXPECT_EQ(1, popup_count);
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 &mixed_content_state)); 555 &mixed_content_state));
555 EXPECT_EQ(SECURITY_STYLE_AUTHENTICATION_BROKEN, security_style); 556 EXPECT_EQ(SECURITY_STYLE_AUTHENTICATION_BROKEN, security_style);
556 EXPECT_EQ(net::CERT_STATUS_DATE_INVALID, 557 EXPECT_EQ(net::CERT_STATUS_DATE_INVALID,
557 cert_status & net::CERT_STATUS_ALL_ERRORS); 558 cert_status & net::CERT_STATUS_ALL_ERRORS);
558 EXPECT_EQ(NavigationEntry::SSLStatus::NORMAL_CONTENT, mixed_content_state); 559 EXPECT_EQ(NavigationEntry::SSLStatus::NORMAL_CONTENT, mixed_content_state);
559 } 560 }
560 561
561 // Visit a page over http that is a redirect to a page with https (good and 562 // Visit a page over http that is a redirect to a page with https (good and
562 // bad). 563 // bad).
563 TEST_F(SSLUITest, TestRedirectHTTPToHTTPS) { 564 TEST_F(SSLUITest, TestRedirectHTTPToHTTPS) {
564 scoped_ptr<TestServer> http_server(PlainServer()); 565 scoped_ptr<HTTPTestServer> http_server(PlainServer());
565 scoped_ptr<HTTPSTestServer> good_https_server(GoodCertServer()); 566 scoped_ptr<HTTPSTestServer> good_https_server(GoodCertServer());
566 scoped_ptr<HTTPSTestServer> bad_https_server(BadCertServer()); 567 scoped_ptr<HTTPSTestServer> bad_https_server(BadCertServer());
567 568
568 // HTTP redirects to good HTTPS. 569 // HTTP redirects to good HTTPS.
569 scoped_ptr<TabProxy> tab(GetActiveTabProxy()); 570 scoped_ptr<TabProxy> tab(GetActiveTabProxy());
570 GURL http_url = http_server->TestServerPageW(L"server-redirect?"); 571 GURL http_url = http_server->TestServerPageW(L"server-redirect?");
571 GURL good_https_url = 572 GURL good_https_url =
572 good_https_server->TestServerPageW(L"files/ssl/google.html"); 573 good_https_server->TestServerPageW(L"files/ssl/google.html");
573 NavigateTab(tab.get(), GURL(http_url.spec() + good_https_url.spec())); 574 NavigateTab(tab.get(), GURL(http_url.spec() + good_https_url.spec()));
574 575
(...skipping 22 matching lines...) Expand all
597 &mixed_content_state)); 598 &mixed_content_state));
598 EXPECT_EQ(SECURITY_STYLE_AUTHENTICATION_BROKEN, security_style); 599 EXPECT_EQ(SECURITY_STYLE_AUTHENTICATION_BROKEN, security_style);
599 EXPECT_EQ(net::CERT_STATUS_DATE_INVALID, 600 EXPECT_EQ(net::CERT_STATUS_DATE_INVALID,
600 cert_status & net::CERT_STATUS_ALL_ERRORS); 601 cert_status & net::CERT_STATUS_ALL_ERRORS);
601 EXPECT_EQ(NavigationEntry::SSLStatus::NORMAL_CONTENT, mixed_content_state); 602 EXPECT_EQ(NavigationEntry::SSLStatus::NORMAL_CONTENT, mixed_content_state);
602 } 603 }
603 604
604 // Visit a page over https that is a redirect to a page with http (to make sure 605 // Visit a page over https that is a redirect to a page with http (to make sure
605 // we don't keep the secure state). 606 // we don't keep the secure state).
606 TEST_F(SSLUITest, TestRedirectHTTPSToHTTP) { 607 TEST_F(SSLUITest, TestRedirectHTTPSToHTTP) {
607 scoped_ptr<TestServer> http_server(PlainServer()); 608 scoped_ptr<HTTPTestServer> http_server(PlainServer());
608 scoped_ptr<HTTPSTestServer> https_server(GoodCertServer()); 609 scoped_ptr<HTTPSTestServer> https_server(GoodCertServer());
609 610
610 scoped_ptr<TabProxy> tab(GetActiveTabProxy()); 611 scoped_ptr<TabProxy> tab(GetActiveTabProxy());
611 GURL https_url = https_server->TestServerPageW(L"server-redirect?"); 612 GURL https_url = https_server->TestServerPageW(L"server-redirect?");
612 GURL http_url = http_server->TestServerPageW(L"files/ssl/google.html"); 613 GURL http_url = http_server->TestServerPageW(L"files/ssl/google.html");
613 NavigateTab(tab.get(), GURL(https_url.spec() + http_url.spec())); 614 NavigateTab(tab.get(), GURL(https_url.spec() + http_url.spec()));
614 615
615 SecurityStyle security_style; 616 SecurityStyle security_style;
616 int cert_status; 617 int cert_status;
617 int mixed_content_state; 618 int mixed_content_state;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 // 654 //
654 // Frame navigation 655 // Frame navigation
655 // 656 //
656 657
657 // From a good HTTPS top frame: 658 // From a good HTTPS top frame:
658 // - navigate to an OK HTTPS frame 659 // - navigate to an OK HTTPS frame
659 // - navigate to a bad HTTPS (expect unsafe content and filtered frame), then 660 // - navigate to a bad HTTPS (expect unsafe content and filtered frame), then
660 // back 661 // back
661 // - navigate to HTTP (expect mixed content), then back 662 // - navigate to HTTP (expect mixed content), then back
662 TEST_F(SSLUITest, TestGoodFrameNavigation) { 663 TEST_F(SSLUITest, TestGoodFrameNavigation) {
663 scoped_ptr<TestServer> http_server(PlainServer()); 664 scoped_ptr<HTTPTestServer> http_server(PlainServer());
664 scoped_ptr<HTTPSTestServer> good_https_server(GoodCertServer()); 665 scoped_ptr<HTTPSTestServer> good_https_server(GoodCertServer());
665 scoped_ptr<HTTPSTestServer> bad_https_server(BadCertServer()); 666 scoped_ptr<HTTPSTestServer> bad_https_server(BadCertServer());
666 667
667 scoped_ptr<TabProxy> tab(GetActiveTabProxy()); 668 scoped_ptr<TabProxy> tab(GetActiveTabProxy());
668 NavigateTab(tab.get(), 669 NavigateTab(tab.get(),
669 good_https_server->TestServerPageW(L"files/ssl/top_frame.html")); 670 good_https_server->TestServerPageW(L"files/ssl/top_frame.html"));
670 671
671 SecurityStyle security_style; 672 SecurityStyle security_style;
672 int cert_status; 673 int cert_status;
673 int mixed_content_state; 674 int mixed_content_state;
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 &mixed_content_state)); 792 &mixed_content_state));
792 EXPECT_EQ(SECURITY_STYLE_AUTHENTICATION_BROKEN, security_style); 793 EXPECT_EQ(SECURITY_STYLE_AUTHENTICATION_BROKEN, security_style);
793 EXPECT_EQ(net::CERT_STATUS_DATE_INVALID, 794 EXPECT_EQ(net::CERT_STATUS_DATE_INVALID,
794 cert_status & net::CERT_STATUS_ALL_ERRORS); 795 cert_status & net::CERT_STATUS_ALL_ERRORS);
795 EXPECT_EQ(NavigationEntry::SSLStatus::NORMAL_CONTENT, mixed_content_state); 796 EXPECT_EQ(NavigationEntry::SSLStatus::NORMAL_CONTENT, mixed_content_state);
796 } 797 }
797 798
798 // From an HTTP top frame, navigate to good and bad HTTPS (security state should 799 // From an HTTP top frame, navigate to good and bad HTTPS (security state should
799 // stay unauthenticated). 800 // stay unauthenticated).
800 TEST_F(SSLUITest, TestUnauthenticatedFrameNavigation) { 801 TEST_F(SSLUITest, TestUnauthenticatedFrameNavigation) {
801 scoped_ptr<TestServer> http_server(PlainServer()); 802 scoped_ptr<HTTPTestServer> http_server(PlainServer());
802 scoped_ptr<HTTPSTestServer> good_https_server(GoodCertServer()); 803 scoped_ptr<HTTPSTestServer> good_https_server(GoodCertServer());
803 scoped_ptr<HTTPSTestServer> bad_https_server(BadCertServer()); 804 scoped_ptr<HTTPSTestServer> bad_https_server(BadCertServer());
804 805
805 scoped_ptr<TabProxy> tab(GetActiveTabProxy()); 806 scoped_ptr<TabProxy> tab(GetActiveTabProxy());
806 NavigateTab(tab.get(), 807 NavigateTab(tab.get(),
807 http_server->TestServerPageW(L"files/ssl/top_frame.html")); 808 http_server->TestServerPageW(L"files/ssl/top_frame.html"));
808 809
809 SecurityStyle security_style; 810 SecurityStyle security_style;
810 int cert_status; 811 int cert_status;
811 int mixed_content_state; 812 int mixed_content_state;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
864 865
865 // Visit a page over https that contains a frame with a redirect. 866 // Visit a page over https that contains a frame with a redirect.
866 867
867 // XMLHttpRequest mixed in synchronous mode. 868 // XMLHttpRequest mixed in synchronous mode.
868 869
869 // XMLHttpRequest mixed in asynchronous mode. 870 // XMLHttpRequest mixed in asynchronous mode.
870 871
871 // XMLHttpRequest over bad ssl in synchronous mode. 872 // XMLHttpRequest over bad ssl in synchronous mode.
872 873
873 // XMLHttpRequest over OK ssl in synchronous mode. 874 // XMLHttpRequest over OK ssl in synchronous mode.
OLDNEW
« no previous file with comments | « chrome/browser/sessions/session_restore_uitest.cc ('k') | chrome/browser/tab_restore_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698