<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>24077</bug_id>
          
          <creation_ts>2013-12-12 15:12:08 +0000</creation_ts>
          <short_desc>second-argument-null.html worker test is incorrect</short_desc>
          <delta_ts>2014-01-03 15:14:29 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>HISTORICAL - Test suite</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>MOVED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Boris Zbarsky">bzbarsky</reporter>
          <assigned_to name="This bug has no owner yet - up for the taking">dave.null</assigned_to>
          <cc>art.barstow</cc>
    
    <cc>mike</cc>
    
    <cc>public-webapps</cc>
    
    <cc>zcorpan</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>97513</commentid>
    <comment_count>0</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2013-12-12 15:12:08 +0000</bug_when>
    <thetext>The test has:

  try {
    postMessage(1, null);
  } catch(e) {
    postMessage(&apos;&apos;+e);
  }

and asserts that 1 is posted.

But the spec for postMessage is:

  void postMessage(any message, optional sequence&lt;Transferable&gt; transfer);

and passing null to the second argument of that should throw, per webidl.

I recommend we do three things:

1)  Add a copy of this test that replaces the first postMessage line with:

     postMessage(1);

2)  Add a copy of this test that replaces the first postMessage line with:

     postMessage(1, undefined);

3)  Modify this test to check that postMessage(1, null) in fact throws.

#1 and #2 would test correct handling of the optional argument when it&apos;s not actually passed and #3 would test correct handling of null here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97535</commentid>
    <comment_count>1</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2013-12-12 21:18:26 +0000</bug_when>
    <thetext>Test
http://w3c-test.org/web-platform-tests/master/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/second-argument-null.html

Spec
http://www.whatwg.org/specs/web-apps/current-work/multipage/workers.html#dedicatedworkerglobalscope

I think the spec was correct when it was written because it predates transferables, but obviously it should be fixed. I think #3 since the test is explicitly about testing null in the second argument.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97537</commentid>
    <comment_count>2</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2013-12-12 21:21:21 +0000</bug_when>
    <thetext>My 3 suggestions were not mutually exclusive.  I didn&apos;t say &quot;one of three things&quot;, right?  We should do all three, with different test names for 1 and 2, obviously.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97576</commentid>
    <comment_count>3</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2013-12-13 07:53:01 +0000</bug_when>
    <thetext>Oh, OK, sure. I think #1 is probably tested already somewhere.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97967</commentid>
    <comment_count>4</comment_count>
    <who name="Arthur Barstow">art.barstow</who>
    <bug_when>2014-01-03 15:14:29 +0000</bug_when>
    <thetext>Moving this bug report to Github as Issue 491 https://github.com/w3c/web-platform-tests/issues/491</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>