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

Unified Diff: ppapi/tests/test_post_message.h

Issue 26564009: [PPAPI] It is now possible to pass filesystems from JavaScript to NaCl modules. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: ResourceRawVarData: Remove ResourceDispatcher and inline everything; much simpler. Created 7 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
Index: ppapi/tests/test_post_message.h
diff --git a/ppapi/tests/test_post_message.h b/ppapi/tests/test_post_message.h
index 2f2f6287c087d4cab70a64505ddc4f1bb9964334..90ed3c12e0bfcf4eb606b69943e8386c9767434c 100644
--- a/ppapi/tests/test_post_message.h
+++ b/ppapi/tests/test_post_message.h
@@ -8,6 +8,9 @@
#include <string>
#include <vector>
+#include "ppapi/c/dev/ppb_var_resource_dev.h"
+#include "ppapi/c/ppb_file_system.h"
+#include "ppapi/c/ppb_var.h"
#include "ppapi/tests/test_case.h"
class TestPostMessage : public TestCase {
@@ -38,6 +41,12 @@ class TestPostMessage : public TestCase {
// JavaScript function which returns the variable to post.
bool PostMessageFromJavaScript(const std::string& func);
+ // Posts a message from JavaScript to the plugin. |func| should be a
+ // JavaScript function(callback) which calls |callback| with the variable to
+ // post. To wait for this message to be posted on the plugin side, use
+ // WaitForMessagesAsync, instead of WaitForMessages.
+ bool PostMessageFromJavaScriptAsync(const std::string& func);
+
// Clear any listeners that have been added using AddEchoingListener by
// calling removeEventListener for each.
// Returns true on success, false on failure.
@@ -47,6 +56,10 @@ class TestPostMessage : public TestCase {
// at the time of invocation.
int WaitForMessages();
+ // Wait for pending messages sent by PostMessageFromJavaScriptAsync; return
+ // the number of messages that were pending at the time of invocation.
+ int WaitForMessagesAsync();
+
// Verifies that the given javascript assertions are true of the message
// (|test_data|) passed via PostMessage().
std::string CheckMessageProperties(
@@ -71,6 +84,9 @@ class TestPostMessage : public TestCase {
// Test sending Dictionary vars in both directions.
std::string TestSendingDictionary();
+ // Test sending Resource vars in both directions.
raymes 2013/10/22 05:59:21 nit: This comment is inaccurate. Currently we only
Matt Giuca 2013/10/23 08:05:54 Done.
+ std::string TestSendingResource();
+
// Test sending a complex var with references and cycles in both directions.
std::string TestSendingComplexVar();
@@ -93,6 +109,12 @@ class TestPostMessage : public TestCase {
// This is used to store pp::Var objects we receive via a call to
// HandleMessage.
VarVector message_data_;
+
+ // Interfaces for C APIs.
+ const PPB_Core* core_interface_;
+ const PPB_FileSystem* file_system_interface_;
+ const PPB_Var* var_interface_;
+ const PPB_VarResource_Dev* var_resource_interface_;
};
#endif // PPAPI_TESTS_TEST_POST_MESSAGE_H_

Powered by Google App Engine
This is Rietveld 408576698