diff options
-rw-r--r-- | ppapi/tests/test_case.cc | 2 | ||||
-rw-r--r-- | ppapi/tests/test_case.h | 5 | ||||
-rw-r--r-- | ppapi/tests/testing_instance.cc | 1 | ||||
-rw-r--r-- | ppapi/tests/testing_instance.h | 1 |
4 files changed, 8 insertions, 1 deletions
diff --git a/ppapi/tests/test_case.cc b/ppapi/tests/test_case.cc index 15f24f0..4bfac10 100644 --- a/ppapi/tests/test_case.cc +++ b/ppapi/tests/test_case.cc @@ -48,6 +48,8 @@ pp::VarPrivate TestCase::GetTestObject() { void TestCase::HandleMessage(const pp::Var& message_data) {} +void TestCase::DidChangeView(const pp::Rect& position, const pp::Rect& clip) {} + #if !(defined __native_client__) pp::deprecated::ScriptableObject* TestCase::CreateTestObject() { return NULL; diff --git a/ppapi/tests/test_case.h b/ppapi/tests/test_case.h index 06ebcb1..5bf295e 100644 --- a/ppapi/tests/test_case.h +++ b/ppapi/tests/test_case.h @@ -55,6 +55,11 @@ class TestCase { // method. virtual void HandleMessage(const pp::Var& message_data); + // A function that is invoked whenever DidChangeView is called on the + // associated TestingInstance. Default implementation does nothing. TestCases + // that want to handle view changes should override this method. + virtual void DidChangeView(const pp::Rect& position, const pp::Rect& clip); + protected: #if !(defined __native_client__) // Overridden by each test to supply a ScriptableObject corresponding to the diff --git a/ppapi/tests/testing_instance.cc b/ppapi/tests/testing_instance.cc index 87c709f..2f925bc 100644 --- a/ppapi/tests/testing_instance.cc +++ b/ppapi/tests/testing_instance.cc @@ -89,6 +89,7 @@ void TestingInstance::DidChangeView(const pp::Rect& position, 0, callback_factory_.NewCallback(&TestingInstance::ExecuteTests)); } + current_case_->DidChangeView(position, clip); } void TestingInstance::LogTest(const std::string& test_name, diff --git a/ppapi/tests/testing_instance.h b/ppapi/tests/testing_instance.h index c0370a7..d27a0bf 100644 --- a/ppapi/tests/testing_instance.h +++ b/ppapi/tests/testing_instance.h @@ -127,4 +127,3 @@ pp::InstancePrivate { }; #endif // PPAPI_TESTS_TESTING_INSTANCE_H_ - |