Index: ppapi/tests/test_case.cc |
=================================================================== |
--- ppapi/tests/test_case.cc (revision 91865) |
+++ ppapi/tests/test_case.cc (working copy) |
@@ -35,24 +35,20 @@ |
return output.str(); |
} |
-#if !(defined __native_client__) |
-pp::VarPrivate TestCase::GetTestObject() { |
+pp::Var TestCase::GetTestObject() { |
if (test_object_.is_undefined()) { |
pp::deprecated::ScriptableObject* so = CreateTestObject(); |
if (so) |
- test_object_ = pp::VarPrivate(instance_, so); // Takes ownership. |
+ test_object_ = pp::Var(instance_, so); // Takes ownership. |
} |
return test_object_; |
} |
-#endif |
void TestCase::HandleMessage(const pp::Var& message_data) {} |
-#if !(defined __native_client__) |
pp::deprecated::ScriptableObject* TestCase::CreateTestObject() { |
return NULL; |
} |
-#endif |
bool TestCase::InitTestingInterface() { |
testing_interface_ = GetTestingInterface(); |
@@ -69,7 +65,10 @@ |
} |
bool TestCase::EnsureRunningOverHTTP() { |
- if (instance_->protocol() != "http:") { |
+ 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; |
} |