Make PPAPI unittests work independent of order run. The issue is that PpapiGlobals (a singleton) was caching pointers to MessageLoopProxy which change every test.
BUG=126514
TBR=brettw
Review URL: https://codereview.chromium.org/14390004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195703 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/webkit/plugins/ppapi/ppapi_unittest.cc b/webkit/plugins/ppapi/ppapi_unittest.cc
index e5c747ac..01d3698 100644
--- a/webkit/plugins/ppapi/ppapi_unittest.cc
+++ b/webkit/plugins/ppapi/ppapi_unittest.cc
@@ -7,6 +7,7 @@
#include "base/message_loop.h"
#include "ppapi/c/pp_var.h"
#include "ppapi/c/ppp_instance.h"
+#include "ppapi/shared_impl/ppapi_globals.h"
#include "ppapi/shared_impl/ppapi_permissions.h"
#include "webkit/plugins/ppapi/gfx_conversion.h"
#include "webkit/plugins/ppapi/mock_plugin_delegate.h"
@@ -81,6 +82,7 @@
// Initialize the mock module.
module_ = new PluginModule("Mock plugin", base::FilePath(), this,
::ppapi::PpapiPermissions());
+ ::ppapi::PpapiGlobals::Get()->ResetMainThreadMessageLoopForTesting();
PluginModule::EntryPoints entry_points;
entry_points.get_interface = &MockGetInterface;
entry_points.initialize_module = &MockInitializeModule;