diff options
author | cstefansen@google.com <cstefansen@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-23 22:43:59 +0000 |
---|---|---|
committer | cstefansen@google.com <cstefansen@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-23 22:43:59 +0000 |
commit | 88bfb4303932d94d78020c08752b81d9a0992859 (patch) | |
tree | 89ea0ab8da6dca317bba81fa34d643eb5e0f780c /ppapi | |
parent | 5eb525429e33e6757acfb9e1e95a30c2c1a48b84 (diff) | |
download | chromium_src-88bfb4303932d94d78020c08752b81d9a0992859.zip chromium_src-88bfb4303932d94d78020c08752b81d9a0992859.tar.gz chromium_src-88bfb4303932d94d78020c08752b81d9a0992859.tar.bz2 |
Adjust PPAPI tests so they can also be run in the NaCl build using PyAuto.
TEST= See https://sites.google.com/a/chromium.org/dev/developers/design-documents/pepper-plugin-implementation for running in Chrome.
BUG= http://code.google.com/p/nativeclient/issues/detail?id=1671
Review URL: http://codereview.chromium.org/7049021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86356 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r-- | ppapi/tests/nacl.scons | 65 | ||||
-rw-r--r-- | ppapi/tests/test_case.html | 6 | ||||
-rw-r--r-- | ppapi/tests/test_case.nmf | 2 | ||||
-rw-r--r-- | ppapi/tests/test_utils.cc | 2 | ||||
-rw-r--r-- | ppapi/tests/testing_instance.cc | 9 |
5 files changed, 66 insertions, 18 deletions
diff --git a/ppapi/tests/nacl.scons b/ppapi/tests/nacl.scons index 727e751..197b0f4 100644 --- a/ppapi/tests/nacl.scons +++ b/ppapi/tests/nacl.scons @@ -6,23 +6,64 @@ Import('env') ppapi_tests_target = 'ppapi_tests_%s.nexe' % env.get('TARGET_FULLARCH') +ppapi_tests_sources = [ + # Common test files + 'test_case.cc', + 'test_utils.cc', + 'testing_instance.cc', + + # Compile-time tests + 'test_c_includes.c', + 'test_cpp_includes.cc', + 'test_struct_sizes.c', + + # Test cases (PLEASE KEEP THIS SECTION IN ALPHABETICAL ORDER) + # Add/uncomment PPAPI interfaces below when they get proxied. + #'test_buffer.cc', + #'test_char_set.cc', + #'test_directory_reader.cc', + #'test_file_io.cc', + #'test_file_ref.cc', + #'test_file_system.cc', + 'test_graphics_2d.cc', + 'test_image_data.cc', + 'test_paint_aggregator.cc', + 'test_post_message.cc', + 'test_scrollbar.cc', + #'test_transport.cc', + #'test_uma.cc', + # Activating the URL loader test requires a test httpd that + # understands HTTP POST, which our current httpd.py doesn't. + # It also requires deactivating the tests that use FileIOTrusted + # when running in NaCl. + #'test_url_loader.cc', + #'test_url_util.cc', + #'test_video_decoder.cc', + + # Deprecated test cases. + 'test_instance_deprecated.cc', + # Var_deprecated fails in TestPassReference, and we probably won't + # fix it. + #'test_var_deprecated.cc' + ] + ppapi_tests_nexe = env.ComponentProgram(ppapi_tests_target, - [Glob('*.cc')], - EXTRA_LIBS=['ppruntime', - 'ppapi_cpp', - 'platform', - 'imc', - 'gio', - 'pthread', - 'srpc']) + ppapi_tests_sources, + EXTRA_LIBS=['${PPAPI_LIBS}', + 'ppapi_cpp' + ]) # Note that the html is required to run this program. # To run, load page with mode=nacl search string: # http://localhost:5103/scons-out/nacl-x86-32/staging/test_case.html?mode=nacl # http://localhost:5103/scons-out/nacl-x86-64/staging/test_case.html?mode=nacl -env.Publish(ppapi_tests_nexe, 'run', - ['test_case.html', + +env.Publish(ppapi_tests_target, 'run', + ['test_url_loader_data/*'], subdir='test_url_loader_data') + +env.Publish(ppapi_tests_target, 'run', + [ppapi_tests_nexe, + 'test_case.html', 'test_case.nmf', 'test_image_data', - 'test_page.css', - 'test_url_loader_data'])
\ No newline at end of file + 'test_page.css']) diff --git a/ppapi/tests/test_case.html b/ppapi/tests/test_case.html index 66d6ffd..89bf1b6 100644 --- a/ppapi/tests/test_case.html +++ b/ppapi/tests/test_case.html @@ -72,14 +72,15 @@ onload = function() { document.title = 'Test ' + testcase; var obj; if (mode == "nacl") { - obj = document.createElement("OBJECT"); + obj = document.createElement("EMBED"); + obj.setAttribute("src", "test_case.nmf"); obj.setAttribute("type", "application/x-nacl"); - obj.setAttribute("nacl", "test_case.nmf"); obj.setAttribute("mode", mode); } else { var mimeType = "application/x-ppapi-tests"; if (mimeType in navigator.mimeTypes) { obj = document.createElement("EMBED"); + obj.setAttribute("src", "http://a.b.c/test"); obj.setAttribute("type", mimeType); } else { document.getElementById("console").innerHTML = @@ -90,7 +91,6 @@ onload = function() { if (obj) { obj.setAttribute("id", "plugin"); obj.setAttribute("testcase", testcase); - obj.setAttribute("src", "http://a.b.c/test"); document.getElementById("container").appendChild(obj); } } diff --git a/ppapi/tests/test_case.nmf b/ppapi/tests/test_case.nmf index 614ead4..40af7cc 100644 --- a/ppapi/tests/test_case.nmf +++ b/ppapi/tests/test_case.nmf @@ -2,6 +2,6 @@ "nexes": { "x86-64": "ppapi_tests_x86-64.nexe", "x86-32": "ppapi_tests_x86-32.nexe", - "arm" : "ppapi_tests_arm.nexe", + "arm" : "ppapi_tests_arm.nexe" } }
\ No newline at end of file diff --git a/ppapi/tests/test_utils.cc b/ppapi/tests/test_utils.cc index 7e0a351..01557ce 100644 --- a/ppapi/tests/test_utils.cc +++ b/ppapi/tests/test_utils.cc @@ -18,7 +18,7 @@ const PPB_Testing_Dev* GetTestingInterface() { std::string ReportError(const char* method, int32_t error) { char error_as_string[12]; - sprintf(error_as_string, "%d", error); + sprintf(error_as_string, "%d", static_cast<int>(error)); std::string result = method + std::string(" failed with error: ") + error_as_string; if (error == PP_ERROR_NOSPACE) diff --git a/ppapi/tests/testing_instance.cc b/ppapi/tests/testing_instance.cc index f464214..0c322e3 100644 --- a/ppapi/tests/testing_instance.cc +++ b/ppapi/tests/testing_instance.cc @@ -53,7 +53,10 @@ bool TestingInstance::Init(uint32_t argc, } pp::Var TestingInstance::GetInstanceObject() { - return current_case_->GetTestObject(); + if (current_case_) + return current_case_->GetTestObject(); + + return pp::Var(this, NULL); } void TestingInstance::HandleMessage(const pp::Var& message_data) { @@ -115,6 +118,10 @@ void TestingInstance::ExecuteTests(int32_t unused) { errors_.append("FAIL: Only listed tests"); } else { current_case_->RunTest(); + // Automated PyAuto tests rely on finding the exact strings below. + LogHTML(errors_.empty() ? + "<span class=\"pass\">[SHUTDOWN]</span> All tests passed." : + "<span class=\"fail\">[SHUTDOWN]</span> Some tests failed."); } // Declare we're done by setting a cookie to either "PASS" or the errors. |