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

Unified Diff: content/test/ppapi_unittest.cc

Issue 2463703006: Initialy renderer ppapi host in ppapi_unittests to fix nullptr access. (Closed)
Patch Set: Export CreateOnModuleForInProcess Created 4 years, 1 month 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
« no previous file with comments | « content/renderer/pepper/renderer_ppapi_host_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/ppapi_unittest.cc
diff --git a/content/test/ppapi_unittest.cc b/content/test/ppapi_unittest.cc
index 865351cde8dee25294235676fd5e8240b282d71e..8ebebe0eeceb31c31890ada3ead401a300de9870 100644
--- a/content/test/ppapi_unittest.cc
+++ b/content/test/ppapi_unittest.cc
@@ -11,6 +11,7 @@
#include "content/renderer/pepper/host_globals.h"
#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
#include "content/renderer/pepper/plugin_module.h"
+#include "content/renderer/pepper/renderer_ppapi_host_impl.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/pp_var.h"
#include "ppapi/c/ppp_instance.h"
@@ -80,14 +81,19 @@ void PpapiUnittest::SetUp() {
message_loop_.reset(new base::MessageLoop());
// Initialize the mock module.
+ ppapi::PpapiPermissions perms;
module_ = new PluginModule("Mock plugin", "1.0", base::FilePath(),
- ppapi::PpapiPermissions());
+ perms);
ppapi::PpapiGlobals::Get()->ResetMainThreadMessageLoopForTesting();
PepperPluginInfo::EntryPoints entry_points;
entry_points.get_interface = &MockGetInterface;
entry_points.initialize_module = &MockInitializeModule;
ASSERT_TRUE(module_->InitAsInternalPlugin(entry_points));
+ // Initialize renderer ppapi host.
+ CHECK(RendererPpapiHostImpl::CreateOnModuleForInProcess(module(), perms));
+ CHECK(module_->renderer_ppapi_host());
+
// Initialize the mock instance.
instance_ = PepperPluginInstanceImpl::Create(NULL, module(), NULL, GURL());
}
« no previous file with comments | « content/renderer/pepper/renderer_ppapi_host_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698