summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpolina@google.com <polina@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-13 21:23:14 +0000
committerpolina@google.com <polina@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-13 21:23:14 +0000
commit74277a970c0268c9436f3383f2720e2c169018dd (patch)
tree069c674b7ae37233f86b7dcb74be2f933be28223
parent6d6002dce9548d5d4fae05f06a167fb5fefdd3fc (diff)
downloadchromium_src-74277a970c0268c9436f3383f2720e2c169018dd.zip
chromium_src-74277a970c0268c9436f3383f2720e2c169018dd.tar.gz
chromium_src-74277a970c0268c9436f3383f2720e2c169018dd.tar.bz2
ppapi_tests: Support DidChangeView overriding via
TestingInstance/TestCase. BUG=none TEST=bots+other CL using this feature Review URL: http://codereview.chromium.org/7782042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100967 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--ppapi/tests/test_case.cc2
-rw-r--r--ppapi/tests/test_case.h5
-rw-r--r--ppapi/tests/testing_instance.cc1
-rw-r--r--ppapi/tests/testing_instance.h1
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_
-