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 (since we are using process-per-site). |
awong
2012/06/27 00:26:54
This parenthetical doesn't explain enough to me.
Charlie Reis
2012/06/27 20:53:43
Using the NEW_FOREGROUND_TAB disposition will not
| |
844 GURL url = https_server_.GetURL(replacement_path); | 844 GURL url = https_server_.GetURL(replacement_path); |
845 browser::NavigateParams params( | 845 browser::NavigateParams params( |
846 browser(), url, content::PAGE_TRANSITION_TYPED); | 846 browser(), url, content::PAGE_TRANSITION_TYPED); |
847 params.disposition = NEW_FOREGROUND_TAB; | 847 params.disposition = NEW_FOREGROUND_TAB; |
848 params.source_contents = tab1; | 848 params.source_contents = tab1; |
849 ui_test_utils::WindowedNotificationObserver observer( | 849 ui_test_utils::WindowedNotificationObserver observer( |
850 content::NOTIFICATION_LOAD_STOP, | 850 content::NOTIFICATION_LOAD_STOP, |
851 content::NotificationService::AllSources()); | 851 content::NotificationService::AllSources()); |
852 browser::Navigate(¶ms); | 852 browser::Navigate(¶ms); |
853 TabContents* tab2 = params.target_contents; | 853 TabContents* tab2 = params.target_contents; |
854 observer.Wait(); | 854 observer.Wait(); |
855 | 855 |
856 // Both tabs should have the same process. | |
857 EXPECT_EQ(tab1->web_contents()->GetRenderProcessHost(), | |
858 tab2->web_contents()->GetRenderProcessHost()); | |
859 | |
856 // The new tab has insecure content. | 860 // The new tab has insecure content. |
857 CheckAuthenticationBrokenState(tab2->web_contents(), 0, true, false); | 861 CheckAuthenticationBrokenState(tab2->web_contents(), 0, true, false); |
858 | 862 |
859 // Which means the origin for the first tab has also been contaminated with | 863 // Which means the origin for the first tab has also been contaminated with |
860 // insecure content. | 864 // insecure content. |
861 CheckAuthenticationBrokenState(tab1->web_contents(), 0, true, false); | 865 CheckAuthenticationBrokenState(tab1->web_contents(), 0, true, false); |
862 } | 866 } |
863 | 867 |
864 // Visits a page with an image over http. Visits another page over https | 868 // 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 | 869 // 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 | 1453 |
1450 // Visit a page over https that contains a frame with a redirect. | 1454 // Visit a page over https that contains a frame with a redirect. |
1451 | 1455 |
1452 // XMLHttpRequest insecure content in synchronous mode. | 1456 // XMLHttpRequest insecure content in synchronous mode. |
1453 | 1457 |
1454 // XMLHttpRequest insecure content in asynchronous mode. | 1458 // XMLHttpRequest insecure content in asynchronous mode. |
1455 | 1459 |
1456 // XMLHttpRequest over bad ssl in synchronous mode. | 1460 // XMLHttpRequest over bad ssl in synchronous mode. |
1457 | 1461 |
1458 // XMLHttpRequest over OK ssl in synchronous mode. | 1462 // XMLHttpRequest over OK ssl in synchronous mode. |
OLD | NEW |