Chromium Code Reviews| 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/path_service.h" | 5 #include "base/path_service.h" |
| 6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
| 7 #include "content/browser/child_process_security_policy_impl.h" | 7 #include "content/browser/child_process_security_policy_impl.h" |
| 8 #include "content/browser/frame_host/render_frame_host_impl.h" | 8 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 9 #include "content/browser/renderer_host/render_message_filter.h" | 9 #include "content/browser/renderer_host/render_message_filter.h" |
| 10 #include "content/browser/renderer_host/render_view_host_delegate_view.h" | 10 #include "content/browser/renderer_host/render_view_host_delegate_view.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 91 // . After this step IsWaitingForUnloadACK returns true on the first RVH. | 91 // . After this step IsWaitingForUnloadACK returns true on the first RVH. |
| 92 // . click stop before the page has been commited. | 92 // . click stop before the page has been commited. |
| 93 // . click reload. | 93 // . click reload. |
| 94 // . IsWaitingForUnloadACK still returns true, and if the hang monitor fires | 94 // . IsWaitingForUnloadACK still returns true, and if the hang monitor fires |
| 95 // the contents gets closed. | 95 // the contents gets closed. |
| 96 | 96 |
| 97 NavigateAndCommit(url1); | 97 NavigateAndCommit(url1); |
| 98 controller().LoadURL( | 98 controller().LoadURL( |
| 99 url2, Referrer(), ui::PAGE_TRANSITION_LINK, std::string()); | 99 url2, Referrer(), ui::PAGE_TRANSITION_LINK, std::string()); |
| 100 // Simulate the ClosePage call which is normally sent by the net::URLRequest. | 100 // Simulate the ClosePage call which is normally sent by the net::URLRequest. |
| 101 rvh()->ClosePage(); | 101 static_cast<RenderViewHostImpl*>(rvh())->ClosePage(); |
|
Charlie Reis
2015/04/21 17:28:08
Would test_rvh() work?
nasko
2015/04/29 17:09:27
Done.
| |
| 102 // Needed so that navigations are not suspended on the RFH. | 102 // Needed so that navigations are not suspended on the RFH. |
| 103 main_test_rfh()->SendBeforeUnloadACK(true); | 103 main_test_rfh()->SendBeforeUnloadACK(true); |
| 104 contents()->Stop(); | 104 contents()->Stop(); |
| 105 controller().Reload(false); | 105 controller().Reload(false); |
| 106 EXPECT_FALSE(main_test_rfh()->IsWaitingForUnloadACK()); | 106 EXPECT_FALSE(main_test_rfh()->IsWaitingForUnloadACK()); |
| 107 } | 107 } |
| 108 | 108 |
| 109 // Ensure we do not grant bindings to a process shared with unprivileged views. | 109 // Ensure we do not grant bindings to a process shared with unprivileged views. |
| 110 TEST_F(RenderViewHostTest, DontGrantBindingsToSharedProcess) { | 110 TEST_F(RenderViewHostTest, DontGrantBindingsToSharedProcess) { |
| 111 // Create another view in the same process. | 111 // Create another view in the same process. |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 311 const std::string data_url = "data:image/gif;base64," | 311 const std::string data_url = "data:image/gif;base64," |
| 312 "R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs="; | 312 "R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs="; |
| 313 | 313 |
| 314 tester->Reset(); | 314 tester->Reset(); |
| 315 tester->Test(data_url); | 315 tester->Test(data_url); |
| 316 EXPECT_EQ(tester->UrlString(), data_url); | 316 EXPECT_EQ(tester->UrlString(), data_url); |
| 317 EXPECT_TRUE(tester->IsDownloaded()); | 317 EXPECT_TRUE(tester->IsDownloaded()); |
| 318 } | 318 } |
| 319 | 319 |
| 320 } // namespace content | 320 } // namespace content |
| OLD | NEW |