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/memory/singleton.h" | 5 #include "base/memory/singleton.h" |
6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
7 #include "base/test/test_timeouts.h" | 7 #include "base/test/test_timeouts.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 9 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
10 #include "content/browser/browser_plugin/browser_plugin_host_factory.h" | 10 #include "content/browser/browser_plugin/browser_plugin_host_factory.h" |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 instance_map.begin()->second); | 602 instance_map.begin()->second); |
603 TestBrowserPluginGuest* new_test_guest = | 603 TestBrowserPluginGuest* new_test_guest = |
604 static_cast<TestBrowserPluginGuest*>( | 604 static_cast<TestBrowserPluginGuest*>( |
605 test_guest_web_contents->GetBrowserPluginGuest()); | 605 test_guest_web_contents->GetBrowserPluginGuest()); |
606 | 606 |
607 // Wait for the guest to send an UpdateRectMsg, meaning it is ready. | 607 // Wait for the guest to send an UpdateRectMsg, meaning it is ready. |
608 new_test_guest->WaitForUpdateRectMsg(); | 608 new_test_guest->WaitForUpdateRectMsg(); |
609 } | 609 } |
610 } | 610 } |
611 | 611 |
| 612 IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, TerminateGuest) { |
| 613 const char* kEmbedderURL = "files/browser_plugin_embedder.html"; |
| 614 StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, ""); |
| 615 |
| 616 RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( |
| 617 test_embedder()->web_contents()->GetRenderViewHost()); |
| 618 rvh->ExecuteJavascriptAndGetValue(string16(), ASCIIToUTF16( |
| 619 "document.getElementById('plugin').terminate()")); |
| 620 |
| 621 // Expect the guest to crash. |
| 622 test_guest()->WaitForCrashed(); |
| 623 } |
| 624 |
612 } // namespace content | 625 } // namespace content |
OLD | NEW |