patchGnash - The GNU Flash player - Patches: patch #8770, Patch for adding...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #8770: Patch for adding JavaScript-calls-Flash ExternalInterface automated testcase

Submitter:  Nutchanon Wetchasit <nachanon>
Submitted:  Tue 13 Oct 2015 09:42:22 AM UTC
   
 
Category:  testsuite Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  strk Open/Closed:  Closed

Wed 02 Dec 2015 02:38:01 PM UTC, comment #4: 

I cannot reproduce my failure anymore, so I committed this patch.
It is in as commit ac2b26fd133b2fedf7f55c2e8e498a127907122a

Sandro Santilli <strk>
Group Member
Fri 20 Nov 2015 10:49:14 AM UTC, comment #3: 

one last thing, in order to reduce testing times, could gnash process be quit by actionscript ? It shall be possible with a getURL('fscommand:quit'). That way you could also use the "END_OF_TEST" trick, and rely on the dejagnu default timeout to catch a failure.

Sandro Santilli <strk>
Group Member
Fri 20 Nov 2015 10:42:35 AM UTC, comment #2: 

The testrun.sum shows the test failing by command line is succeeding when invoked by make:

PASS: extcommtests-runner: Gnash should properly register an ExternalInterface callback
PASS: extcommtests-runner: Gnash should return a correct value from ExternalInterface callback
PASS: extcommtests-runner: Gnash should terminate successfully
PASS: extcommtests-runner: ExternalInterface.available  [/usr/src/gnash/gnash-head/testsuite/misc-mtasc.all/extcomm.as:33]
PASS: extcommtests-runner: ExternalInterface.addCallback("script_call", mc, function(arg1, arg2):String { check(true); check_equals(arg1, "Hello"); check_equals(arg2, "World"); return "Too"; } )  [/usr/src/gnash/gnash-head/testsuite/misc-mtasc.all/extcomm.as:56]
PASS: extcommtests-runner: true  [/usr/src/gnash/gnash-head/testsuite/misc-mtasc.all/extcomm.as:56]
PASS: extcommtests-runner: Hello == Hello  [/usr/src/gnash/gnash-head/testsuite/misc-mtasc.all/extcomm.as:56]
PASS: extcommtests-runner: World == World  [/usr/src/gnash/gnash-head/testsuite/misc-mtasc.all/extcomm.as:56]
PASS: extcommtests-runner: There should be 8 tests run

BTW, it would be nice to get line numbers in the shell tests too (but I understand it's not as easy w/out a preprocessor)

Oh, another thing, the "Open host-to-player pipe" failure message reports the wrong pipename

Sandro Santilli <strk>
Group Member
Fri 20 Nov 2015 10:38:10 AM UTC, comment #1: 

I'm trying to run the test as part of "make check" but finding it to fail when invoked via bash. Still, "make check" does not show any failure.

The runtest call I see happening (after removing the '@' sign from the check-DEJAGNU Makefile rule):

[strk@cdb:/usr/src/gnash/build/head/gtk+qt4+sdl+fb+dump_ffmpeg+gst/testsuite/misc-mtasc.all] make check
make  check-DEJAGNU
make[1]: Entering directory `/usr/src/gnash/build/head/gtk+qt4+sdl+fb+dump_ffmpeg+gst/testsuite/misc-mtasc.all'
runtest=runtest; \
        if /bin/bash -c "$runtest --version" > /dev/null 2>&1; then \
            GNASH_GC_TRIGGER_THRESHOLD=0  GNASHRC=../gnashrc $runtest  ../simple.exp; true; \
        else \
          echo "WARNING: could not find \`runtest'" 1>&2; \
          for i in "sanetests-runner bogustests-runner extcommtests-runner "; do \
            GNASH_GC_TRIGGER_THRESHOLD=0  GNASHRC=../gnashrc /bin/bash $i; \
          done; \
        fi
WARNING: No tool specified
Test Run By strk on Fri Nov 20 11:31:55 2015
Native configuration is x86_64-unknown-linux-gnu

                ===  tests ===

Schedule of variations:
    unix

Running target unix
Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target.
Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.
WARNING: Couldn't find tool config file for unix, using default.
Running /usr/src/gnash/gnash-head/testsuite/misc-mtasc.all/../simple.exp ...

                ===  Summary ===

# of expected passes            193
# of expected failures          2
make[1]: Leaving directory `/usr/src/gnash/build/head/gtk+qt4+sdl+fb+dump_ffmpeg+gst/testsuite/misc-mtasc.all'

If I only keep the extcommtests-runner in TEST_CASES, I get:

 Running /usr/src/gnash/gnash-head/testsuite/misc-mtasc.all/../simple.exp ...

                ===  Summary ===

 # of expected passes            9

But running the test manually:

 GNASH_GC_TRIGGER_THRESHOLD=0  GNASHRC=../gnashrc /bin/bash extcommtests-runner > /tmp/log

I see an early failure:

 FAILED: Gnash should return a correct value from ExternalInterface callback ("<invoke name="addMethod" returntype="xml"><arguments><string>script_call</string></arguments></invoke>" != "<string>Too</string>")

and other 8 successes.

Ideas about why there's such difference ?


Sandro Santilli <strk>
Group Member
Tue 13 Oct 2015 09:42:22 AM UTC, original submission:  

Patch 1: see the attached `0004_add-js2flash-automated-testcase.patch`.

The patch adds an integrated version of `js2flash-auto` test provided
in bug #37223 to Gnash testsuite.

This automated test case is comprised of three parts:

  • The test generator (`extcommtest-runner.sh`), generates the parameterized test runner.
  • The test runner (`extcommtest-runner`), creates named pipes, starts Gnash, sends/recieves and check invoke/return message.
  • The test SWF, runs inside Gnash, registers, listen for, and respond to the callback call.


Note:

  • The test generator followed what `testsuite/misc-ming.all/XMLSocketTester.sh` script did.
  • The test assumes that filesystem supports named pipe.
  • The test used a hard-coded 10-sec time frame for letting SWF file respond to the invoke call. (Using `gnash -t 10`)
  • The test used 5-sec timeout on reading each Gnash's response.
  • Shell script side of this test used its own `check_*()` function.
  • Shell script side of this test is responsible for counting total tests done on both side.
  • ExternalInterface callback registration is tested using an anonymous function, registered using `_root` as `this` instance.
  • "END OF TEST" signature check is not used, since the real tests start after SWF's `main()` ended.


This patch might need some scrutiny regarding design and all, since this
is a pilot patch that adds infrastructure for testing on ExternalInterface
and related plugin functions.

Gnash: 0.8.11dev (patched against git f0f66ce 23-Sep-2015)
System: Debian GNU/Linux 7.0 Wheezy i386

Nutchanon Wetchasit <nachanon>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #35178:  0004_add-js2flash-automated-testcase.patch added by nachanon (9KiB - text/x-patch - Patch to add JavaScript-calls-Flash ExternalInterface automated testcase)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by strk (Updated the item)
  • -email is unavailable- added by nachanon (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-12-02 strk StatusIn Progress Done
        Open/ClosedOpen Closed
    2015-11-20 strk StatusNone In Progress
        Assigned toNone strk
    2015-10-13 nachanon Attached File- Added 0004_add-js2flash-automated-testcase.patch, #35178

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code