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/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/memory/shared_memory.h" | 9 #include "base/memory/shared_memory.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 EXPECT_EQ(blink::WebNavigationPolicyIgnore, policy); | 633 EXPECT_EQ(blink::WebNavigationPolicyIgnore, policy); |
634 | 634 |
635 // Clean up after the new view so we don't leak it. | 635 // Clean up after the new view so we don't leak it. |
636 new_view->Close(); | 636 new_view->Close(); |
637 new_view->Release(); | 637 new_view->Release(); |
638 } | 638 } |
639 | 639 |
640 // Ensure the RenderViewImpl sends an ACK to a SwapOut request, even if it is | 640 // Ensure the RenderViewImpl sends an ACK to a SwapOut request, even if it is |
641 // already swapped out. http://crbug.com/93427. | 641 // already swapped out. http://crbug.com/93427. |
642 TEST_F(RenderViewImplTest, SendSwapOutACK) { | 642 TEST_F(RenderViewImplTest, SendSwapOutACK) { |
| 643 // This test is invalid in --site-per-process mode, as swapped-out is no |
| 644 // longer used. |
| 645 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 646 switches::kSitePerProcess)) { |
| 647 return; |
| 648 } |
643 LoadHTML("<div>Page A</div>"); | 649 LoadHTML("<div>Page A</div>"); |
644 int initial_page_id = view_page_id(); | 650 int initial_page_id = view_page_id(); |
645 | 651 |
646 // Increment the ref count so that we don't exit when swapping out. | 652 // Increment the ref count so that we don't exit when swapping out. |
647 RenderProcess::current()->AddRefProcess(); | 653 RenderProcess::current()->AddRefProcess(); |
648 | 654 |
649 // Respond to a swap out request. | 655 // Respond to a swap out request. |
650 SwapOut(frame(), kProxyRoutingId, true, content::FrameReplicationState()); | 656 SwapOut(frame(), kProxyRoutingId, true, content::FrameReplicationState()); |
651 | 657 |
652 // Ensure the swap out commits synchronously. | 658 // Ensure the swap out commits synchronously. |
(...skipping 26 matching lines...) Expand all Loading... |
679 NavigateMainFrame(common_params, StartNavigationParams(), request_params); | 685 NavigateMainFrame(common_params, StartNavigationParams(), request_params); |
680 ProcessPendingMessages(); | 686 ProcessPendingMessages(); |
681 const IPC::Message* msg3 = render_thread_->sink().GetUniqueMessageMatching( | 687 const IPC::Message* msg3 = render_thread_->sink().GetUniqueMessageMatching( |
682 ViewHostMsg_UpdateState::ID); | 688 ViewHostMsg_UpdateState::ID); |
683 EXPECT_FALSE(msg3); | 689 EXPECT_FALSE(msg3); |
684 } | 690 } |
685 | 691 |
686 // Ensure the RenderViewImpl reloads the previous page if a reload request | 692 // Ensure the RenderViewImpl reloads the previous page if a reload request |
687 // arrives while it is showing swappedout://. http://crbug.com/143155. | 693 // arrives while it is showing swappedout://. http://crbug.com/143155. |
688 TEST_F(RenderViewImplTest, ReloadWhileSwappedOut) { | 694 TEST_F(RenderViewImplTest, ReloadWhileSwappedOut) { |
| 695 // This test is invalid in --site-per-process mode, as swapped-out is no |
| 696 // longer used. |
| 697 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 698 switches::kSitePerProcess)) { |
| 699 return; |
| 700 } |
| 701 |
689 // Load page A. | 702 // Load page A. |
690 LoadHTML("<div>Page A</div>"); | 703 LoadHTML("<div>Page A</div>"); |
691 | 704 |
692 // Load page B, which will trigger an UpdateState message for page A. | 705 // Load page B, which will trigger an UpdateState message for page A. |
693 LoadHTML("<div>Page B</div>"); | 706 LoadHTML("<div>Page B</div>"); |
694 | 707 |
695 // Check for a valid UpdateState message for page A. | 708 // Check for a valid UpdateState message for page A. |
696 ProcessPendingMessages(); | 709 ProcessPendingMessages(); |
697 const IPC::Message* msg_A = render_thread_->sink().GetUniqueMessageMatching( | 710 const IPC::Message* msg_A = render_thread_->sink().GetUniqueMessageMatching( |
698 ViewHostMsg_UpdateState::ID); | 711 ViewHostMsg_UpdateState::ID); |
(...skipping 1695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2394 FROM_HERE, | 2407 FROM_HERE, |
2395 base::Bind(&DevToolsAgentTest::CloseWhilePaused, base::Unretained(this))); | 2408 base::Bind(&DevToolsAgentTest::CloseWhilePaused, base::Unretained(this))); |
2396 ExecuteJavaScript("debugger;"); | 2409 ExecuteJavaScript("debugger;"); |
2397 | 2410 |
2398 // CloseWhilePaused should resume execution and continue here. | 2411 // CloseWhilePaused should resume execution and continue here. |
2399 EXPECT_FALSE(IsPaused()); | 2412 EXPECT_FALSE(IsPaused()); |
2400 Detach(); | 2413 Detach(); |
2401 } | 2414 } |
2402 | 2415 |
2403 } // namespace content | 2416 } // namespace content |
OLD | NEW |