W3C home > Mailing lists > Public > public-webapps-testsuite@w3.org > December 2012

RE: Adding WebSocket and WebWorker test suites to testing framework

From: Kris Krueger <krisk@microsoft.com>
Date: Mon, 3 Dec 2012 23:53:59 +0000
To: James Graham <jgraham@opera.com>
CC: Arthur Barstow <art.barstow@nokia.com>, Simon Pieters <simonp@opera.com>, "public-webapps-testsuite@w3.org" <public-webapps-testsuite@w3.org>
Message-ID: <0A605FCDA3A4DC45A98B0DDD1C5351A7038BA66A@TK5EX14MBXW603.wingroup.windeploy.ntdev.microsoft.com>
OK to be clear...

All the Opera tests have been submitted that you would like to be part of the test suite.  Some of these tests need to be fixed as mentioned below.

Correct?  If so then seems like I or others could help convert/fix these tests.  

-Thx

-----Original Message-----
From: James Graham [mailto:jgraham@opera.com] 
Sent: Monday, December 3, 2012 3:43 AM
To: Kris Krueger
Cc: Arthur Barstow; Simon Pieters; public-webapps-testsuite@w3.org
Subject: Re: Adding WebSocket and WebWorker test suites to testing framework

On 12/01/2012 09:15 AM, Kris Krueger wrote:
> Please provide pointers :)

Well I really meant "answers to specific questions". Everything that I've done is checked in to the WebApps repo.

You can tell tests that have not been converted yet because they still contain a call to end(). *Possibly* some of the converted tests stil try to use an incorrect port, but I'm not sure.

The process for converting the tests is basically:
a) Possibly replace test with async_test
b) Update the port to match the W3C server
c) Replace any old-framework asserts that remain (identified as
assertCamelCase) with the correct testharness.js assert
d) Ensure that the flow for the test is correct and that any async parts are wrapped in step_func.
e) Replace end() with t.done() or similar.

So for example
http://dvcs.w3.org/hg/webapps/file/8297f95f9f20/WebSockets/tests/submissions/Opera/binary/001.html
might become

<!doctype html>
<title>WebSockets: Send/Receive blob, blob size less than network array buffer</title> <script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=../constants.js></script>
<div id=log></div>
<script>
async_test(function(t){
   var ws = new WebSocket(SCHEME_AND_DOMAIN+':8007/echo');
   var data = "";
   var datasize = 10;
   ws.onopen = t.step_func(function(e) {
    ws.binaryType = "blob";
    data = new ArrayBuffer(datasize);
    ws.send(data);
   } )
   ws.onmessage = t.step_func(function(e) {
     assert_true(e.data instanceof Blob);
     assert_equals(e.data.size, datasize);
     t.done();
   } )

});
</script>

(I didn't check the port number, so that might not be quite right. And using assert_true is really ugly. Nut I hope it is enough to give you the idea).
Received on Monday, 3 December 2012 23:54:33 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 22 April 2014 14:15:59 UTC