Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(665)

Side by Side Diff: content/browser/browser_plugin/browser_plugin_host_browsertest.cc

Issue 11048023: Browser Plugin: Implement terminate() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged with ToT Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW
« no previous file with comments | « content/browser/browser_plugin/browser_plugin_guest.cc ('k') | content/common/browser_plugin_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698