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

Unified Diff: content/browser/browser_plugin/browser_plugin_host_browsertest.cc

Issue 258373002: Towards moving guest management to chrome: Introduce GuestViewManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with ToT Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/browser_plugin/browser_plugin_host_browsertest.cc
diff --git a/content/browser/browser_plugin/browser_plugin_host_browsertest.cc b/content/browser/browser_plugin/browser_plugin_host_browsertest.cc
index b4059505b67f2ce962513282fba53b1e6d65e522..6aeab3e0f2eb05a231f2be080b5e6d69020fb187 100644
--- a/content/browser/browser_plugin/browser_plugin_host_browsertest.cc
+++ b/content/browser/browser_plugin/browser_plugin_host_browsertest.cc
@@ -102,11 +102,11 @@ class TestBrowserPluginEmbedder : public BrowserPluginEmbedder {
class TestBrowserPluginHostFactory : public BrowserPluginHostFactory {
public:
virtual BrowserPluginGuestManager*
- CreateBrowserPluginGuestManager() OVERRIDE {
+ CreateBrowserPluginGuestManager(BrowserContext* context) OVERRIDE {
guest_manager_instance_count_++;
if (message_loop_runner_)
message_loop_runner_->Quit();
- return new TestBrowserPluginGuestManager();
+ return new TestBrowserPluginGuestManager(context);
}
virtual BrowserPluginGuest* CreateBrowserPluginGuest(
@@ -315,18 +315,13 @@ class BrowserPluginHostTest : public ContentBrowserTest {
ASSERT_TRUE(test_embedder_);
test_guest_manager_ = static_cast<TestBrowserPluginGuestManager*>(
- embedder_web_contents->GetBrowserPluginGuestManager());
+ BrowserPluginGuestManager::FromBrowserContext(
+ test_embedder_->GetWebContents()->GetBrowserContext()));
ASSERT_TRUE(test_guest_manager_);
- test_guest_manager_->WaitForGuestAdded();
-
- // Verify that we have exactly one guest.
- const TestBrowserPluginGuestManager::GuestInstanceMap& instance_map =
- test_guest_manager_->guest_web_contents_for_testing();
- EXPECT_EQ(1u, instance_map.size());
-
WebContentsImpl* test_guest_web_contents = static_cast<WebContentsImpl*>(
- instance_map.begin()->second);
+ test_guest_manager_->WaitForGuestAdded());
+
test_guest_ = static_cast<TestBrowserPluginGuest*>(
test_guest_web_contents->GetBrowserPluginGuest());
test_guest_->WaitForLoadStop();
@@ -541,12 +536,9 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, DISABLED_ReloadEmbedder) {
ExecuteSyncJSFunction(
test_embedder()->web_contents()->GetMainFrame(),
base::StringPrintf("SetSrc('%s');", kHTMLForGuest));
- test_guest_manager()->WaitForGuestAdded();
- const TestBrowserPluginGuestManager::GuestInstanceMap& instance_map =
- test_guest_manager()->guest_web_contents_for_testing();
WebContentsImpl* test_guest_web_contents = static_cast<WebContentsImpl*>(
- instance_map.begin()->second);
+ test_guest_manager()->WaitForGuestAdded());
TestBrowserPluginGuest* new_test_guest =
static_cast<TestBrowserPluginGuest*>(
test_guest_web_contents->GetBrowserPluginGuest());

Powered by Google App Engine
This is Rietveld 408576698