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

Side by Side Diff: chrome/browser/ssl/ssl_browser_tests.cc

Issue 146057: Making browser test work (again) on Linux (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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 | « base/path_service.cc ('k') | chrome/test/in_process_browser_test.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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "chrome/browser/browser.h" 5 #include "chrome/browser/browser.h"
6 #include "chrome/browser/profile.h" 6 #include "chrome/browser/profile.h"
7 #include "chrome/browser/tab_contents/interstitial_page.h" 7 #include "chrome/browser/tab_contents/interstitial_page.h"
8 #include "chrome/browser/tab_contents/navigation_entry.h" 8 #include "chrome/browser/tab_contents/navigation_entry.h"
9 #include "chrome/browser/tab_contents/tab_contents.h" 9 #include "chrome/browser/tab_contents/tab_contents.h"
10 #include "chrome/common/pref_names.h" 10 #include "chrome/common/pref_names.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 entry->ssl().security_style()); 66 entry->ssl().security_style());
67 EXPECT_EQ(error, entry->ssl().cert_status() & net::CERT_STATUS_ALL_ERRORS); 67 EXPECT_EQ(error, entry->ssl().cert_status() & net::CERT_STATUS_ALL_ERRORS);
68 EXPECT_FALSE(entry->ssl().has_mixed_content()); 68 EXPECT_FALSE(entry->ssl().has_mixed_content());
69 EXPECT_FALSE(entry->ssl().has_unsafe_content()); 69 EXPECT_FALSE(entry->ssl().has_unsafe_content());
70 } 70 }
71 71
72 private: 72 private:
73 DISALLOW_COPY_AND_ASSIGN(SSLUITest); 73 DISALLOW_COPY_AND_ASSIGN(SSLUITest);
74 }; 74 };
75 75
76 #if defined(OS_WIN)
77 // Visits a regular page over http. 76 // Visits a regular page over http.
78 IN_PROC_BROWSER_TEST_F(SSLUITest, TestHTTP) { 77 IN_PROC_BROWSER_TEST_F(SSLUITest, TestHTTP) {
79 scoped_refptr<HTTPTestServer> server = PlainServer(); 78 scoped_refptr<HTTPTestServer> server = PlainServer();
80 79
81 ui_test_utils::NavigateToURL(browser(), 80 ui_test_utils::NavigateToURL(browser(),
82 server->TestServerPageW(L"files/ssl/google.html")); 81 server->TestServerPageW(L"files/ssl/google.html"));
83 82
84 CheckUnauthenticatedState(browser()->GetSelectedTabContents()); 83 CheckUnauthenticatedState(browser()->GetSelectedTabContents());
85 } 84 }
86 85
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 // And the frame should have been blocked (see bug #2316). 704 // And the frame should have been blocked (see bug #2316).
706 bool is_content_evil = true; 705 bool is_content_evil = true;
707 std::wstring content_frame_xpath(L"html/frameset/frame[2]"); 706 std::wstring content_frame_xpath(L"html/frameset/frame[2]");
708 std::wstring is_frame_evil_js( 707 std::wstring is_frame_evil_js(
709 L"window.domAutomationController" 708 L"window.domAutomationController"
710 L".send(document.getElementById('evilDiv') != null);"); 709 L".send(document.getElementById('evilDiv') != null);");
711 EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(tab, 710 EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(tab,
712 content_frame_xpath, is_frame_evil_js, &is_content_evil)); 711 content_frame_xpath, is_frame_evil_js, &is_content_evil));
713 EXPECT_FALSE(is_content_evil); 712 EXPECT_FALSE(is_content_evil);
714 } 713 }
715 #else
716 // TODO(port): enable the real tests.
717 IN_PROC_BROWSER_TEST_F(SSLUITest, PhonyTest1) {
718 EXPECT_TRUE(true);
719 }
720
721 IN_PROC_BROWSER_TEST_F(SSLUITest, PhonyTest2) {
722 EXPECT_TRUE(false);
723 }
724
725 IN_PROC_BROWSER_TEST_F(SSLUITest, PhonyTest3) {
726 EXPECT_TRUE(true);
727 }
728 #endif
729 714
730 // TODO(jcampan): more tests to do below. 715 // TODO(jcampan): more tests to do below.
731 716
732 // Visit a page over https that contains a frame with a redirect. 717 // Visit a page over https that contains a frame with a redirect.
733 718
734 // XMLHttpRequest mixed in synchronous mode. 719 // XMLHttpRequest mixed in synchronous mode.
735 720
736 // XMLHttpRequest mixed in asynchronous mode. 721 // XMLHttpRequest mixed in asynchronous mode.
737 722
738 // XMLHttpRequest over bad ssl in synchronous mode. 723 // XMLHttpRequest over bad ssl in synchronous mode.
739 724
740 // XMLHttpRequest over OK ssl in synchronous mode. 725 // XMLHttpRequest over OK ssl in synchronous mode.
OLDNEW
« no previous file with comments | « base/path_service.cc ('k') | chrome/test/in_process_browser_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698