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

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

Issue 7669055: Remove webkit::ppapi::Resource. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nulls auditeed Created 9 years, 4 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/glue/webkit_glue.gypi ('k') | webkit/plugins/ppapi/message_channel.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/callbacks_unittest.cc
diff --git a/webkit/plugins/ppapi/callbacks_unittest.cc b/webkit/plugins/ppapi/callbacks_unittest.cc
index 4cd80845d98f40cc77e683cb60945d308a9f4873..30e534b96b5b8f81d64cced97b499722c09ada36 100644
--- a/webkit/plugins/ppapi/callbacks_unittest.cc
+++ b/webkit/plugins/ppapi/callbacks_unittest.cc
@@ -12,6 +12,7 @@
#include "webkit/plugins/ppapi/mock_resource.h"
#include "webkit/plugins/ppapi/plugin_module.h"
#include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
+#include "webkit/plugins/ppapi/resource_helper.h"
#include "webkit/plugins/ppapi/resource_tracker.h"
namespace webkit {
@@ -110,27 +111,29 @@ namespace {
class CallbackMockResource : public MockResource {
public:
- CallbackMockResource(PluginInstance* instance) : MockResource(instance) {}
+ CallbackMockResource(PP_Instance instance) : MockResource(instance) {}
~CallbackMockResource() {}
PP_Resource SetupForTest() {
PP_Resource resource_id = GetReference();
EXPECT_NE(0, resource_id);
+ PluginModule* module = ResourceHelper::GetPluginModule(this);
+
callback_did_run_ = new TrackedCompletionCallback(
- instance()->module()->GetCallbackTracker(),
+ module->GetCallbackTracker(),
resource_id,
PP_MakeCompletionCallback(&TestCallback, &info_did_run_));
EXPECT_EQ(0U, info_did_run_.run_count);
callback_did_abort_ = new TrackedCompletionCallback(
- instance()->module()->GetCallbackTracker(),
+ module->GetCallbackTracker(),
resource_id,
PP_MakeCompletionCallback(&TestCallback, &info_did_abort_));
EXPECT_EQ(0U, info_did_abort_.run_count);
callback_didnt_run_ = new TrackedCompletionCallback(
- instance()->module()->GetCallbackTracker(),
+ module->GetCallbackTracker(),
resource_id,
PP_MakeCompletionCallback(&TestCallback, &info_didnt_run_));
EXPECT_EQ(0U, info_didnt_run_.run_count);
@@ -188,13 +191,13 @@ TEST_F(CallbackResourceTest, AbortOnNoRef) {
// Check that the uncompleted one gets aborted, and that the others don't get
// called again.
scoped_refptr<CallbackMockResource> resource_1(
- new CallbackMockResource(instance()));
+ new CallbackMockResource(instance()->pp_instance()));
PP_Resource resource_1_id = resource_1->SetupForTest();
// Also do the same for a second resource, and make sure that unref-ing the
// first resource doesn't much up the second resource.
scoped_refptr<CallbackMockResource> resource_2(
- new CallbackMockResource(instance()));
+ new CallbackMockResource(instance()->pp_instance()));
PP_Resource resource_2_id = resource_2->SetupForTest();
// Double-check that resource #1 is still okay.
@@ -223,7 +226,7 @@ TEST_F(CallbackResourceTest, Resurrection) {
ResourceTracker* resource_tracker = ResourceTracker::Get();
scoped_refptr<CallbackMockResource> resource(
- new CallbackMockResource(instance()));
+ new CallbackMockResource(instance()->pp_instance()));
PP_Resource resource_id = resource->SetupForTest();
// Unref it, spin the message loop to run posted calls, and check that things
« no previous file with comments | « webkit/glue/webkit_glue.gypi ('k') | webkit/plugins/ppapi/message_channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698