summaryrefslogtreecommitdiffstats
path: root/ppapi/tests/testing_instance.h
diff options
context:
space:
mode:
Diffstat (limited to 'ppapi/tests/testing_instance.h')
-rw-r--r--ppapi/tests/testing_instance.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/ppapi/tests/testing_instance.h b/ppapi/tests/testing_instance.h
index 2201e13..9f42409 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_