OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 | 833 |
834 // This tab should be fine. | 834 // This tab should be fine. |
835 CheckAuthenticatedState(tab1->web_contents(), false); | 835 CheckAuthenticatedState(tab1->web_contents(), false); |
836 | 836 |
837 std::string replacement_path; | 837 std::string replacement_path; |
838 ASSERT_TRUE(GetFilePathWithHostAndPortReplacement( | 838 ASSERT_TRUE(GetFilePathWithHostAndPortReplacement( |
839 "files/ssl/page_runs_insecure_content.html", | 839 "files/ssl/page_runs_insecure_content.html", |
840 test_server()->host_port_pair(), | 840 test_server()->host_port_pair(), |
841 &replacement_path)); | 841 &replacement_path)); |
842 | 842 |
843 // Create a new tab in the same process. | 843 // Create a new tab in the same process. Using a NEW_FOREGROUND_TAB |
| 844 // disposition won't usually stay in the same process, but this works |
| 845 // because we are using process-per-site in SetUpCommandLine. |
844 GURL url = https_server_.GetURL(replacement_path); | 846 GURL url = https_server_.GetURL(replacement_path); |
845 browser::NavigateParams params( | 847 browser::NavigateParams params( |
846 browser(), url, content::PAGE_TRANSITION_TYPED); | 848 browser(), url, content::PAGE_TRANSITION_TYPED); |
847 params.disposition = NEW_FOREGROUND_TAB; | 849 params.disposition = NEW_FOREGROUND_TAB; |
848 params.source_contents = tab1; | 850 params.source_contents = tab1; |
849 ui_test_utils::WindowedNotificationObserver observer( | 851 ui_test_utils::WindowedNotificationObserver observer( |
850 content::NOTIFICATION_LOAD_STOP, | 852 content::NOTIFICATION_LOAD_STOP, |
851 content::NotificationService::AllSources()); | 853 content::NotificationService::AllSources()); |
852 browser::Navigate(¶ms); | 854 browser::Navigate(¶ms); |
853 TabContents* tab2 = params.target_contents; | 855 TabContents* tab2 = params.target_contents; |
854 observer.Wait(); | 856 observer.Wait(); |
855 | 857 |
| 858 // Both tabs should have the same process. |
| 859 EXPECT_EQ(tab1->web_contents()->GetRenderProcessHost(), |
| 860 tab2->web_contents()->GetRenderProcessHost()); |
| 861 |
856 // The new tab has insecure content. | 862 // The new tab has insecure content. |
857 CheckAuthenticationBrokenState(tab2->web_contents(), 0, true, false); | 863 CheckAuthenticationBrokenState(tab2->web_contents(), 0, true, false); |
858 | 864 |
859 // Which means the origin for the first tab has also been contaminated with | 865 // Which means the origin for the first tab has also been contaminated with |
860 // insecure content. | 866 // insecure content. |
861 CheckAuthenticationBrokenState(tab1->web_contents(), 0, true, false); | 867 CheckAuthenticationBrokenState(tab1->web_contents(), 0, true, false); |
862 } | 868 } |
863 | 869 |
864 // Visits a page with an image over http. Visits another page over https | 870 // Visits a page with an image over http. Visits another page over https |
865 // referencing that same image over http (hoping it is coming from the webcore | 871 // referencing that same image over http (hoping it is coming from the webcore |
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1449 | 1455 |
1450 // Visit a page over https that contains a frame with a redirect. | 1456 // Visit a page over https that contains a frame with a redirect. |
1451 | 1457 |
1452 // XMLHttpRequest insecure content in synchronous mode. | 1458 // XMLHttpRequest insecure content in synchronous mode. |
1453 | 1459 |
1454 // XMLHttpRequest insecure content in asynchronous mode. | 1460 // XMLHttpRequest insecure content in asynchronous mode. |
1455 | 1461 |
1456 // XMLHttpRequest over bad ssl in synchronous mode. | 1462 // XMLHttpRequest over bad ssl in synchronous mode. |
1457 | 1463 |
1458 // XMLHttpRequest over OK ssl in synchronous mode. | 1464 // XMLHttpRequest over OK ssl in synchronous mode. |
OLD | NEW |