summaryrefslogtreecommitdiffstats
path: root/ppapi/tests/test_case.cc
diff options
context:
space:
mode:
authordumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-04 00:36:22 +0000
committerdumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-04 00:36:22 +0000
commitde9bdd1e4d2f87f53b1c2d3eacfbe43ef6ca1019 (patch)
tree7e714193e2f5abad3d3ca54d353b62a7f9ebf7e3 /ppapi/tests/test_case.cc
parentf8ce465c025d457778f8376eca12d94e723965bb (diff)
downloadchromium_src-de9bdd1e4d2f87f53b1c2d3eacfbe43ef6ca1019.zip
chromium_src-de9bdd1e4d2f87f53b1c2d3eacfbe43ef6ca1019.tar.gz
chromium_src-de9bdd1e4d2f87f53b1c2d3eacfbe43ef6ca1019.tar.bz2
Pepper's directory reader implementation + test.
BUG=none TEST=test_directory_reader.cc Review URL: http://codereview.chromium.org/4107004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65002 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/tests/test_case.cc')
-rw-r--r--ppapi/tests/test_case.cc27
1 files changed, 27 insertions, 0 deletions
diff --git a/ppapi/tests/test_case.cc b/ppapi/tests/test_case.cc
index a37bfc3..20a7f5f 100644
--- a/ppapi/tests/test_case.cc
+++ b/ppapi/tests/test_case.cc
@@ -6,6 +6,9 @@
#include <sstream>
+#include "ppapi/tests/test_utils.h"
+#include "ppapi/tests/testing_instance.h"
+
std::string TestCase::MakeFailureMessage(const char* file,
int line,
const char* cmd) {
@@ -35,3 +38,27 @@ pp::deprecated::ScriptableObject* TestCase::CreateTestObject() {
return NULL;
}
+bool TestCase::InitTestingInterface() {
+ if (!GetTestingInterface()) {
+ // Give a more helpful error message for the testing interface being gone
+ // since that needs special enabling in Chrome.
+ instance_->AppendError("This test needs the testing interface, which is "
+ "not currently available. In Chrome, use "
+ "--enable-pepper-testing when launching.");
+ return false;
+ }
+
+ return true;
+}
+
+bool TestCase::EnsureRunningOverHTTP() {
+ pp::Var window = instance_->GetWindowObject();
+ pp::Var location = window.GetProperty("location");
+ pp::Var protocol = location.GetProperty("protocol");
+ if (!protocol.is_string() || protocol.AsString() != "http:") {
+ instance_->AppendError("This test needs to be run over HTTP.");
+ return false;
+ }
+
+ return true;
+}