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

Unified Diff: ppapi/tests/testing_instance.h

Issue 7312008: Porting ppapi_tests framework to postMessage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disable Scrollbar test on Mac for now, merge Created 9 years, 5 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 | « ppapi/tests/test_var_deprecated.cc ('k') | ppapi/tests/testing_instance.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/testing_instance.h
diff --git a/ppapi/tests/testing_instance.h b/ppapi/tests/testing_instance.h
index 2201e13f55e0f0c23725c882d3b3f349ace3e678..9f424098113c3ab16fb1a578772528a44281bbf9 100644
--- a/ppapi/tests/testing_instance.h
+++ b/ppapi/tests/testing_instance.h
@@ -8,11 +8,23 @@
#include <string>
#include "ppapi/cpp/completion_callback.h"
+
+#if defined(__native_client__)
#include "ppapi/cpp/instance.h"
+#else
+#include "ppapi/cpp/private/instance_private.h"
+#endif
class TestCase;
-class TestingInstance : public pp::Instance {
+// In trusted builds, we use InstancePrivate and allow tests that use
+// synchronous scripting. NaCl does not support synchronous scripting.
+class TestingInstance : public
+#if defined(__native_client__)
+pp::Instance {
+#else
+pp::InstancePrivate {
+#endif
public:
explicit TestingInstance(PP_Instance instance);
virtual ~TestingInstance();
@@ -20,7 +32,10 @@ class TestingInstance : public pp::Instance {
// pp::Instance override.
virtual bool Init(uint32_t argc, const char* argn[], const char* argv[]);
virtual void DidChangeView(const pp::Rect& position, const pp::Rect& clip);
+
+#if !(defined __native_client__)
virtual pp::Var GetInstanceObject();
+#endif
// Outputs the information from one test run, using the format
// <test_name> [PASS|FAIL <error_message>]
@@ -46,6 +61,10 @@ class TestingInstance : public pp::Instance {
// TestClass object that's associated with this instance.
virtual void HandleMessage(const pp::Var& message_data);
+ const std::string& protocol() {
+ return protocol_;
+ }
+
private:
void ExecuteTests(int32_t unused);
@@ -78,6 +97,10 @@ class TestingInstance : public pp::Instance {
// True if running in Native Client.
bool nacl_mode_;
+
+ // String representing the protocol. Used for detecting whether we're running
+ // with http.
+ std::string protocol_;
};
#endif // PPAPI_TESTS_TESTING_INSTANCE_H_
« no previous file with comments | « ppapi/tests/test_var_deprecated.cc ('k') | ppapi/tests/testing_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698