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

Unified Diff: webkit/plugins/ppapi/resource_tracker_unittest.cc

Issue 8342016: Revert 106142 - Add a new globals object for PPAPI tracking information. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/plugins/ppapi/resource_tracker.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/resource_tracker_unittest.cc
===================================================================
--- webkit/plugins/ppapi/resource_tracker_unittest.cc (revision 106147)
+++ webkit/plugins/ppapi/resource_tracker_unittest.cc (working copy)
@@ -9,7 +9,6 @@
#include "ppapi/c/ppp_instance.h"
#include "third_party/npapi/bindings/npruntime.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h"
-#include "webkit/plugins/ppapi/host_globals.h"
#include "webkit/plugins/ppapi/mock_plugin_delegate.h"
#include "webkit/plugins/ppapi/mock_resource.h"
#include "webkit/plugins/ppapi/npapi_glue.h"
@@ -79,9 +78,23 @@
ResourceTrackerTest() {
}
- ResourceTracker& tracker() {
- return *HostGlobals::Get()->host_resource_tracker();
+ virtual void SetUp() {
+ // The singleton override must be installed before the generic setup because
+ // that creates an instance, etc. which uses the tracker.
+ ResourceTracker::SetSingletonOverride(&tracker_);
+ PpapiUnittest::SetUp();
}
+ virtual void TearDown() {
+ // Must do normal tear down before clearing the override for the same rason
+ // as the SetUp.
+ PpapiUnittest::TearDown();
+ ResourceTracker::ClearSingletonOverride();
+ }
+
+ ResourceTracker& tracker() { return tracker_; }
+
+ private:
+ ResourceTracker tracker_;
};
TEST_F(ResourceTrackerTest, DeleteObjectVarWithInstance) {
@@ -125,8 +138,7 @@
}
// Remove both of the refs we made above.
- ::ppapi::VarTracker* var_tracker =
- ::ppapi::PpapiGlobals::Get()->GetVarTracker();
+ ::ppapi::VarTracker* var_tracker = tracker().GetVarTracker();
var_tracker->ReleaseVar(static_cast<int32_t>(pp_object2.value.as_id));
var_tracker->ReleaseVar(static_cast<int32_t>(pp_object1.value.as_id));
Property changes on: webkit/plugins/ppapi/resource_tracker_unittest.cc
___________________________________________________________________
Added: svn:mergeinfo
Merged /branches/chrome_webkit_merge_branch/src/webkit/plugins/ppapi/resource_tracker_unittest.cc:r3734-4217,4606-5108,5177-5263
« no previous file with comments | « webkit/plugins/ppapi/resource_tracker.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698