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

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>40129</bug_id>
          
          <creation_ts>2010-06-03 10:25:43 -0700</creation_ts>
          <short_desc>Geolocation needs LayoutTest to test making callbacks to remote frames</short_desc>
          <delta_ts>2010-06-03 21:30:14 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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>
          
          <blocked>39879</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Steve Block">steveblock</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abarth</cc>
    
    <cc>andreip</cc>
    
    <cc>ap</cc>
    
    <cc>eric</cc>
    
    <cc>jorlow</cc>
    
    <cc>steveblock</cc>
    
    <cc>webkit.review.bot</cc>
    
    <cc>xan.lopez</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>233812</commentid>
    <comment_count>0</comment_count>
    <who name="Steve Block">steveblock</who>
    <bug_when>2010-06-03 10:25:43 -0700</bug_when>
    <thetext>Geolocation needs LayoutTest to test making callbacks to remote frames</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>233817</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-06-03 10:30:10 -0700</bug_when>
    <thetext>Yay for more tests!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>233819</commentid>
    <comment_count>2</comment_count>
      <attachid>57787</attachid>
    <who name="Steve Block">steveblock</who>
    <bug_when>2010-06-03 10:32:17 -0700</bug_when>
    <thetext>Created attachment 57787
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>233824</commentid>
    <comment_count>3</comment_count>
      <attachid>57787</attachid>
    <who name="Jeremy Orlow">jorlow</who>
    <bug_when>2010-06-03 10:39:07 -0700</bug_when>
    <thetext>Comment on attachment 57787
Patch

LayoutTests/fast/dom/Geolocation/script-tests/callback-to-remote-context.js:3
 +  function onIframeReady() {
Isn&apos;t this being called with the iframe&apos;s ScriptExecutionContext?  I guess testing this is useful as well, but I&apos;m not sure it&apos;s doing what you intend it to.

If so, I think doing a setTimeout(..., 0) on that window with that function should do the trick..but you&apos;ll want to verify in a debugger.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>233827</commentid>
    <comment_count>4</comment_count>
      <attachid>57787</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-06-03 10:48:16 -0700</bug_when>
    <thetext>Comment on attachment 57787
Patch

I don&apos;t think that tests like this should be script-tests. That doesn&apos;t improve anything, but has very real costs - for example, I can&apos;t just open a test and see what it does, as I need to open related .js file in a subdirectory instead.

Also, it&apos;s more difficult to share tests that utilize complicated support libraries with engineers working on other engines, so it&apos;s less likely that they will run our tests and be compatible with us.

And you had to resort to DOM manipulation just to add an iframe element.

It would be useful to also have a test that calls getCurrentPosition() directly from iframe, not from a function defined in main frame&apos;s document.

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>233828</commentid>
    <comment_count>5</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-06-03 10:49:18 -0700</bug_when>
    <thetext>&gt; It would be useful to also have a test that calls getCurrentPosition() directly from iframe

Which is the same as Jeremy said, I think.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>233831</commentid>
    <comment_count>6</comment_count>
    <who name="Steve Block">steveblock</who>
    <bug_when>2010-06-03 10:59:08 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; (From update of attachment 57787 [details])
&gt; LayoutTests/fast/dom/Geolocation/script-tests/callback-to-remote-context.js:3
&gt;  +  function onIframeReady() {
&gt; Isn&apos;t this being called with the iframe&apos;s ScriptExecutionContext?
No, I think the the call to getCurrentPosition() is made with the main frame&apos;s ScriptExecutionContext, because the function OnIframeReady was defined in the scope of the main frame.

&gt; It would be useful to also have a test that calls getCurrentPosition() directly 
&gt; from iframe, not from a function defined in main frame&apos;s document.
Do you mean that the iframe would directly call a method on its own Geolocation object? So just testing the most basic functionality, but in an iframe? It&apos;s true that we don&apos;t currently have a test for this, but the purpose of this bug was to test calling back to a context other than that belonging to the Geolocation&apos;s frame.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>233838</commentid>
    <comment_count>7</comment_count>
    <who name="Jeremy Orlow">jorlow</who>
    <bug_when>2010-06-03 11:12:47 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; (From update of attachment 57787 [details])
&gt; I don&apos;t think that tests like this should be script-tests. That doesn&apos;t improve anything, but has very real costs - for example, I can&apos;t just open a test and see what it does, as I need to open related .js file in a subdirectory instead.
&gt; 
&gt; Also, it&apos;s more difficult to share tests that utilize complicated support libraries with engineers working on other engines, so it&apos;s less likely that they will run our tests and be compatible with us.

If you feel strongly about this, we should probably start a webkit-dev thread on the subject.  Because most other reviewers I know prefer doing tests like this with script-tests and factoring out as much code as possible into support libraries.  (I actually didn&apos;t realize that anyone was advocating keeping them independent and such.  I definitely agree there are some merits to doing so, but I think there are more benefits to keeping tests compact and easy to read.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>233879</commentid>
    <comment_count>8</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-06-03 12:56:43 -0700</bug_when>
    <thetext>&gt; Do you mean that the iframe would directly call a method on its own Geolocation object?

No, I meant making a call to one frame&apos;s Geolocation from a function defined in another frame when JS execution starts in the latter. Using setTimeout as Jeremy suggested is a good way to achieve that.

I do not fully understand all details (Sam Weinig, Geoff Garen, or Adam Barth would be the ones to talk to), but that&apos;s really a different situation.

&gt; If you feel strongly about this, we should probably start a webkit-dev thread on the subject.

I wouldn&apos;t expect any specific conclusion from such a discussion thread. Informing people of both upsides and downsides to using script tests might be useful though. In addition to what I mentioned before, here are some more thing I consider when choosing one or another:
- shouldBe() is great when there are multiple subtests;
- shouldBe() is very smart about argument types, more so than a naive &quot;==&quot; would be;
- results are well structured, so there is no doubt whether a given output is a pass or a failure;
- with a script test, you don&apos;t need to type in dumpAsText();
- we still hope to run fast/js tests with only JavaScriptCore built one day, so keeping those tests in .js files is useful;
- async script-tests are inherently harder to follow, since notifyDone() is hidden, and execution flow is not all coded in one place;
- dynamically creating a DOM structure in a script test is ugly;
- a script test is more limited in how results are presented, binary PASS/FAIL is hard to dig into (why exactly did it fail? is it the thing we test for that fails, or something in surrounding machinery?)
- you don&apos;t get the kind of accidental testing you get with tests that dump more information;
- script tests are sometimes less compatible with other browsers, because you need to both test for a specific issue, and extract the results in a form that can be easily processed - so, you&apos;re relying on things like CSSOM that aren&apos;t well supported everywhere.

The below is neither clean nor compact, and it&apos;s forced on us by script-tests.

+var iframe = document.createElement(&apos;iframe&apos;);
+iframe.src = &apos;resources/callback-to-remote-context-inner.html&apos;;
+document.body.appendChild(iframe);
+
+window.jsTestIsAsync = true;
+window.successfullyParsed = true;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>233959</commentid>
    <comment_count>9</comment_count>
    <who name="Steve Block">steveblock</who>
    <bug_when>2010-06-03 15:41:09 -0700</bug_when>
    <thetext>&gt; No, I meant making a call to one frame&apos;s Geolocation from a function defined
&gt; in another frame when JS execution starts in the latter.
Filed Bug 40146 to track this.

&gt; &gt; If you feel strongly about this, we should probably start a webkit-dev thread on the subject.
Please CC me if a thread is started - I&apos;m keen to learn the best practice here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>233993</commentid>
    <comment_count>10</comment_count>
    <who name="Steve Block">steveblock</who>
    <bug_when>2010-06-03 16:47:42 -0700</bug_when>
    <thetext>Committed r60645: &lt;http://trac.webkit.org/changeset/60645&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>234029</commentid>
    <comment_count>11</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2010-06-03 18:59:44 -0700</bug_when>
    <thetext>http://trac.webkit.org/changeset/60645 might have broken GTK Linux 32-bit Release</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>234044</commentid>
    <comment_count>12</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2010-06-03 21:06:48 -0700</bug_when>
    <thetext>Borked the gtk?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>234051</commentid>
    <comment_count>13</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2010-06-03 21:30:14 -0700</bug_when>
    <thetext>(In reply to comment #12)
&gt; Borked the gtk?

I filed Bug#40153 and add the test to gtk/Skipped.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>57787</attachid>
            <date>2010-06-03 10:32:17 -0700</date>
            <delta_ts>2010-06-03 10:48:15 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-40129-20100603183215.patch</filename>
            <type>text/plain</type>
            <size>4074</size>
            <attacher name="Steve Block">steveblock</attacher>
            
              <data encoding="base64">SW5kZXg6IExheW91dFRlc3RzL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBMYXlvdXRUZXN0cy9D
aGFuZ2VMb2cJKHJldmlzaW9uIDYwNjI3KQorKysgTGF5b3V0VGVzdHMvQ2hhbmdlTG9nCSh3b3Jr
aW5nIGNvcHkpCkBAIC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HZW9sb2NhdGlvbiByZXF1ZXN0IGlzIG1hZGUgZnJvbSBhIHJlbW90ZSBm
cmFtZSwgY2FsbGJhY2tzIGFyZSBtYWRlIGFzIHVzdWFsLiIpOworCitmdW5jdGlvbiBvbklmcmFt
ZVJlYWR5KCkgeworICAgIC8vIE1ha2UgcmVxdWVzdCBmcm9tIHJlbW90ZSBmcmFtZQorICAgIGlm
cmFtZS5jb250ZW50V2luZG93Lm5hdmlnYXRvci5nZW9sb2NhdGlvbi5nZXRDdXJyZW50UG9zaXRp
b24oZnVuY3Rpb24oKSB7CisgICAgICAgIHRlc3RQYXNzZWQoJ1N1Y2Nlc3MgY2FsbGJhY2sgaW52
b2tlZCcpOworICAgICAgICBmaW5pc2hKU1Rlc3QoKTsKKyAgICB9LCBmdW5jdGlvbigpIHsKKyAg
ICAgICAgdGVzdEZhaWxlZCgnRXJyb3IgY2FsbGJhY2sgaW52b2tlZCB1bmV4cGVjdGVkbHknKTsK
KyAgICAgICAgZmluaXNoSlNUZXN0KCk7CisgICAgfSk7Cit9CisKK3ZhciBpZnJhbWUgPSBkb2N1
bWVudC5jcmVhdGVFbGVtZW50KCdpZnJhbWUnKTsKK2lmcmFtZS5zcmMgPSAncmVzb3VyY2VzL2Nh
bGxiYWNrLXRvLXJlbW90ZS1jb250ZXh0LWlubmVyLmh0bWwnOworZG9jdW1lbnQuYm9keS5hcHBl
bmRDaGlsZChpZnJhbWUpOworCit3aW5kb3cuanNUZXN0SXNBc3luYyA9IHRydWU7Cit3aW5kb3cu
c3VjY2Vzc2Z1bGx5UGFyc2VkID0gdHJ1ZTsK
</data>
<flag name="review"
          id="42436"
          type_id="1"
          status="+"
          setter="ap"
    />
          </attachment>
      

    </bug>

</bugzilla>