diff options
author | scottbyer@chromium.org <scottbyer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-13 22:19:59 +0000 |
---|---|---|
committer | scottbyer@chromium.org <scottbyer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-13 22:19:59 +0000 |
commit | bb68a294684bdb4678d556a97e55f22e17a8f3bf (patch) | |
tree | a8b19f16cfda301ef1a4feff91095e702f36c55f /ppapi | |
parent | f1b4366dc7042812f6b4f51557b6d4847727904b (diff) | |
download | chromium_src-bb68a294684bdb4678d556a97e55f22e17a8f3bf.zip chromium_src-bb68a294684bdb4678d556a97e55f22e17a8f3bf.tar.gz chromium_src-bb68a294684bdb4678d556a97e55f22e17a8f3bf.tar.bz2 |
Fix unit test to allow repeated successful runs by avoiding a function static variable in tests.
BUG=137145
TEST=run unit_tests with --gtest_filter=ComponentInstallerTest.PepperFlashCheck --gtest_repeat=2 successfully.
Review URL: https://chromiumcodereview.appspot.com/10702188
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146670 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r-- | ppapi/shared_impl/ppapi_globals.cc | 6 | ||||
-rw-r--r-- | ppapi/shared_impl/ppapi_globals.h | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/ppapi/shared_impl/ppapi_globals.cc b/ppapi/shared_impl/ppapi_globals.cc index 80a4ee2..0336e0c 100644 --- a/ppapi/shared_impl/ppapi_globals.cc +++ b/ppapi/shared_impl/ppapi_globals.cc @@ -23,10 +23,12 @@ PpapiGlobals* PpapiGlobals::ppapi_globals_ = NULL; PpapiGlobals::PpapiGlobals() { DCHECK(!ppapi_globals_); ppapi_globals_ = this; + message_loop_proxy_ = base::MessageLoopProxy::current(); } PpapiGlobals::PpapiGlobals(ForTest) { DCHECK(!ppapi_globals_); + message_loop_proxy_ = base::MessageLoopProxy::current(); } PpapiGlobals::~PpapiGlobals() { @@ -43,9 +45,7 @@ void PpapiGlobals::SetPpapiGlobalsOnThreadForTest(PpapiGlobals* ptr) { } base::MessageLoopProxy* PpapiGlobals::GetMainThreadMessageLoop() { - CR_DEFINE_STATIC_LOCAL(scoped_refptr<base::MessageLoopProxy>, proxy, - (base::MessageLoopProxy::current())); - return proxy.get(); + return message_loop_proxy_.get(); } bool PpapiGlobals::IsHostGlobals() const { diff --git a/ppapi/shared_impl/ppapi_globals.h b/ppapi/shared_impl/ppapi_globals.h index 00fb9b1..e95cf48 100644 --- a/ppapi/shared_impl/ppapi_globals.h +++ b/ppapi/shared_impl/ppapi_globals.h @@ -8,6 +8,7 @@ #include <string> #include "base/basictypes.h" +#include "base/memory/ref_counted.h" #include "base/threading/thread_local.h" // For testing purposes only. #include "ppapi/c/dev/ppb_console_dev.h" #include "ppapi/c/pp_instance.h" @@ -126,6 +127,8 @@ class PPAPI_SHARED_EXPORT PpapiGlobals { static PpapiGlobals* ppapi_globals_; + scoped_refptr<base::MessageLoopProxy> message_loop_proxy_; + DISALLOW_COPY_AND_ASSIGN(PpapiGlobals); }; |