OLD | NEW |
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 "content/browser/frame_host/render_frame_host_manager.h" | 5 #include "content/browser/frame_host/render_frame_host_manager.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 // be left waiting for a reply. We pick RunBeforeUnloadConfirm as an example | 667 // be left waiting for a reply. We pick RunBeforeUnloadConfirm as an example |
668 // that can run easily within a unit test, and that needs to receive a reply | 668 // that can run easily within a unit test, and that needs to receive a reply |
669 // without showing an actual dialog. | 669 // without showing an actual dialog. |
670 MockRenderProcessHost* ntp_process_host = ntp_rfh->GetProcess(); | 670 MockRenderProcessHost* ntp_process_host = ntp_rfh->GetProcess(); |
671 ntp_process_host->sink().ClearMessages(); | 671 ntp_process_host->sink().ClearMessages(); |
672 const base::string16 msg = base::ASCIIToUTF16("Message"); | 672 const base::string16 msg = base::ASCIIToUTF16("Message"); |
673 bool result = false; | 673 bool result = false; |
674 base::string16 unused; | 674 base::string16 unused; |
675 FrameHostMsg_RunBeforeUnloadConfirm before_unload_msg( | 675 FrameHostMsg_RunBeforeUnloadConfirm before_unload_msg( |
676 ntp_rfh->GetRoutingID(), kChromeURL, msg, false, &result, &unused); | 676 ntp_rfh->GetRoutingID(), kChromeURL, msg, false, &result, &unused); |
677 // Enable pumping for check in BrowserMessageFilter::CheckCanDispatchOnUI. | |
678 before_unload_msg.EnableMessagePumping(); | |
679 EXPECT_TRUE(ntp_rfh->OnMessageReceived(before_unload_msg)); | 677 EXPECT_TRUE(ntp_rfh->OnMessageReceived(before_unload_msg)); |
680 EXPECT_TRUE(ntp_process_host->sink().GetUniqueMessageMatching(IPC_REPLY_ID)); | 678 EXPECT_TRUE(ntp_process_host->sink().GetUniqueMessageMatching(IPC_REPLY_ID)); |
681 | 679 |
682 // Also test RunJavaScriptMessage. | 680 // Also test RunJavaScriptMessage. |
683 ntp_process_host->sink().ClearMessages(); | 681 ntp_process_host->sink().ClearMessages(); |
684 FrameHostMsg_RunJavaScriptMessage js_msg( | 682 FrameHostMsg_RunJavaScriptMessage js_msg( |
685 ntp_rfh->GetRoutingID(), msg, msg, kChromeURL, | 683 ntp_rfh->GetRoutingID(), msg, msg, kChromeURL, |
686 JAVASCRIPT_MESSAGE_TYPE_CONFIRM, &result, &unused); | 684 JAVASCRIPT_MESSAGE_TYPE_CONFIRM, &result, &unused); |
687 js_msg.EnableMessagePumping(); | 685 js_msg.EnableMessagePumping(); |
688 EXPECT_TRUE(ntp_rfh->OnMessageReceived(js_msg)); | 686 EXPECT_TRUE(ntp_rfh->OnMessageReceived(js_msg)); |
(...skipping 2555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3244 commit_params.should_enforce_strict_mixed_content_checking = false; | 3242 commit_params.should_enforce_strict_mixed_content_checking = false; |
3245 child_host->SendNavigateWithParams(&commit_params); | 3243 child_host->SendNavigateWithParams(&commit_params); |
3246 EXPECT_NO_FATAL_FAILURE(CheckMixedContentIPC( | 3244 EXPECT_NO_FATAL_FAILURE(CheckMixedContentIPC( |
3247 main_test_rfh(), false, proxy_to_parent->GetRoutingID())); | 3245 main_test_rfh(), false, proxy_to_parent->GetRoutingID())); |
3248 EXPECT_FALSE(root->child_at(0) | 3246 EXPECT_FALSE(root->child_at(0) |
3249 ->current_replication_state() | 3247 ->current_replication_state() |
3250 .should_enforce_strict_mixed_content_checking); | 3248 .should_enforce_strict_mixed_content_checking); |
3251 } | 3249 } |
3252 | 3250 |
3253 } // namespace content | 3251 } // namespace content |
OLD | NEW |