<?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>21419</bug_id>
          
          <creation_ts>2008-10-06 17:01:14 -0700</creation_ts>
          <short_desc>Add a layout test to verify popup properties while they&apos;re opening</short_desc>
          <delta_ts>2008-10-14 15:49:57 -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>DOM</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Pam Greene (IRC:pamg)">pam</reporter>
          <assigned_to name="Pam Greene (IRC:pamg)">pam</assigned_to>
          <cc>abarth</cc>
    
    <cc>sam</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>94296</commentid>
    <comment_count>0</comment_count>
    <who name="Pam Greene (IRC:pamg)">pam</who>
    <bug_when>2008-10-06 17:01:14 -0700</bug_when>
    <thetext>Different browsers return different things for the properties of a popup window while the window is opening. In particular, the behavior of window.location, window.href, and window.pathname vary.  

The Selenium web app test system -- http://selenium.openqa.org -- depends on this behavior.

When running the attached test, popup.location reports as follows:

Safari ToT: location: /
Firefox: location: about:blank
Chrome: location: about:blank
IE7: location: file:///C:/&lt;path to&gt;/fast/dom/Window/resources/destination.html

My goal is to contribute all of Chromium&apos;s new layout tests promptly for everyone&apos;s benefit, so even if it&apos;s decided that WebKit will change its behavior, I&apos;d still vote for submitting the attached files as they are for now, filing a new bug, and updating the result when it changes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94298</commentid>
    <comment_count>1</comment_count>
      <attachid>24131</attachid>
    <who name="Pam Greene (IRC:pamg)">pam</who>
    <bug_when>2008-10-06 17:06:19 -0700</bug_when>
    <thetext>Created attachment 24131
Layout test and expected result</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94338</commentid>
    <comment_count>2</comment_count>
      <attachid>24131</attachid>
    <who name="Sam Weinig">sam</who>
    <bug_when>2008-10-07 00:20:31 -0700</bug_when>
    <thetext>Comment on attachment 24131
Layout test and expected result

r=me.  We are trying to move to more tests where the expected results are clear, so in the future, that would be a good thing to do.  But this looks good.  Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94339</commentid>
    <comment_count>3</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2008-10-07 00:53:00 -0700</bug_when>
    <thetext>What Sam meant, was that we&apos;re trying to move towards more tests where the test itself contains the expected results.  You can see this in all the &quot;shouldBe&quot; based tests which use the scripts in fast/js/resources and the TEMPLATE.html system with make-js-test-wrappers generated test files.

the fast/js tests aren&apos;t very well documented, but they&apos;re pretty simple to write.  Any time you find a resources/ directory containing a TEMPLATE.html file, all of the .js files in that directory are examples of the fast/js testing system, which uses shouldBe.  This test could then be re-written as something like:

description(&quot;Test to make sure that popup&apos;s have no properties while opening to match other browsers https://bugs.webkit.org/show_bug.cgi?id=21419&quot;);

// dumpAsText is handled for you in fast/js style tests
if (window.layoutTestController) {
    layoutTestController.setCanOpenWindows();
    layoutTestController.waitUntilDone();
}

var popup = window.open(&apos;resources/destination.html&apos;);
shouldBe(&quot;popup.location&quot;, &quot;/&quot;);
shouldBe(&quot;popup.location[&apos;href&apos;]&quot;, &quot;/&quot;);
shouldBe(&quot;popup.location[&apos;pathname&apos;]&quot;, &quot;/&quot;);
shouldBe(&quot;popup.location[&apos;hash&apos;]&quot;, &quot;&quot;);
shouldBe(&quot;popup.location[&apos;port&apos;]&quot;, &quot;&quot;);
shouldBe(&quot;popup.location[&apos;protocol&apos;]&quot;, &quot;&quot;);
shouldBe(&quot;popup.location[&apos;search&apos;]&quot;, &quot;&quot;);
shouldBe(&quot;popup.location[&apos;pathname&apos;]&quot;, &quot;&quot;);

Wait... actually this test never calls &quot;notifyDone()&quot; so it will just hit the timeout every time!  That&apos;s bad. :(  I have to change review to r-, unless I missed something...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94340</commentid>
    <comment_count>4</comment_count>
      <attachid>24131</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2008-10-07 00:54:07 -0700</bug_when>
    <thetext>Comment on attachment 24131
Layout test and expected result

Yeah, this needs to call notifyDone() or not call waitUntilDone(), otherwise this test just takes longer than necessary to run.

Consider looking at the new fancy fast/js testing system if you have interest.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94341</commentid>
    <comment_count>5</comment_count>
      <attachid>24131</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2008-10-07 00:56:34 -0700</bug_when>
    <thetext>Comment on attachment 24131
Layout test and expected result

Sam tells me notifyDone() is part of destination.html... so this is OK.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94396</commentid>
    <comment_count>6</comment_count>
    <who name="Pam Greene (IRC:pamg)">pam</who>
    <bug_when>2008-10-07 11:27:10 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; What Sam meant, was that we&apos;re trying to move towards more tests where the test
&gt; itself contains the expected results.

I&apos;d agree in general, but that does cause problems for tests like this one where different embedders may legitimately want different results.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94414</commentid>
    <comment_count>7</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2008-10-07 12:44:49 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; I&apos;d agree in general, but that does cause problems for tests like this one
&gt; where different embedders may legitimately want different results.

I can see no reason why different ports would want different results here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94415</commentid>
    <comment_count>8</comment_count>
    <who name="Pam Greene (IRC:pamg)">pam</who>
    <bug_when>2008-10-07 12:49:15 -0700</bug_when>
    <thetext>Well, I know Chrome reports &quot;location: about:blank&quot; so Selenium works.  I don&apos;t know if there&apos;s a specific reason that Safari reports &quot;location: /&quot; instead, or if it&apos;s just that nobody had a reason to care before.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94416</commentid>
    <comment_count>9</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2008-10-07 12:54:16 -0700</bug_when>
    <thetext>(In reply to comment #8)
&gt; Well, I know Chrome reports &quot;location: about:blank&quot; so Selenium works.  I don&apos;t
&gt; know if there&apos;s a specific reason that Safari reports &quot;location: /&quot; instead, or
&gt; if it&apos;s just that nobody had a reason to care before.
&gt; 

Presumably it is a bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94419</commentid>
    <comment_count>10</comment_count>
    <who name="Pam Greene (IRC:pamg)">pam</who>
    <bug_when>2008-10-07 13:05:21 -0700</bug_when>
    <thetext>Is it acceptable to submit this test and expected result as they are, and file a separate bug to fix it? Or should I morph this report and keep the test pending until the behavior is fixed?  (I&apos;d selfishly prefer the former, but I recognize that the latter would be better practice.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94425</commentid>
    <comment_count>11</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2008-10-07 13:23:57 -0700</bug_when>
    <thetext>(In reply to comment #10)
&gt; Is it acceptable to submit this test and expected result as they are, and file
&gt; a separate bug to fix it? Or should I morph this report and keep the test
&gt; pending until the behavior is fixed?  (I&apos;d selfishly prefer the former, but I
&gt; recognize that the latter would be better practice.)

Oh, no, please land as is and file a follow up bug.  The main point of tests is to test for changes in behavior, so having them in the trees is the most important thing.  My point was only that any new tests would be preferred in the other format, to solve a dual purpose.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95253</commentid>
    <comment_count>12</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2008-10-14 01:16:00 -0700</bug_when>
    <thetext>Will land.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95274</commentid>
    <comment_count>13</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2008-10-14 03:01:20 -0700</bug_when>
    <thetext>My Mac Mini died in the middle of testing this patch.  I&apos;m going to take it into the store tomorrow.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95334</commentid>
    <comment_count>14</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2008-10-14 12:28:06 -0700</bug_when>
    <thetext>It&apos;s going to be a week before I get my Mac Mini back.  Unassigning.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95338</commentid>
    <comment_count>15</comment_count>
    <who name="Pam Greene (IRC:pamg)">pam</who>
    <bug_when>2008-10-14 12:37:48 -0700</bug_when>
    <thetext>I&apos;ll land it, now that I have cred.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95368</commentid>
    <comment_count>16</comment_count>
    <who name="Pam Greene (IRC:pamg)">pam</who>
    <bug_when>2008-10-14 15:49:57 -0700</bug_when>
    <thetext>Submitted r37595.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>24131</attachid>
            <date>2008-10-06 17:06:19 -0700</date>
            <delta_ts>2008-10-07 00:56:34 -0700</delta_ts>
            <desc>Layout test and expected result</desc>
            <filename>window-url.txt</filename>
            <type>text/plain</type>
            <size>1657</size>
            <attacher name="Pam Greene (IRC:pamg)">pam</attacher>
            
              <data encoding="base64">SW5kZXg6IENoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBDaGFuZ2VMb2cJKHJldmlzaW9uIDM3MzUz
KQorKysgQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMTAgQEAKKzIwMDgtMTAt
MDYgIFBhbWVsYSBHcmVlbmUgIDxwYW1AY2hyb21pdW0ub3JnPgorCisgICAgICAgIFJldmlld2Vk
IGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAgICogZmFzdC9kb20vV2luZG93L3dpbmRvdy1v
cGVuLXBlbmRpbmctdXJsLWV4cGVjdGVkLnR4dDogQWRkZWQuCisgICAgICAgICogZmFzdC9kb20v
V2luZG93L3dpbmRvdy1vcGVuLXBlbmRpbmctdXJsLmh0bWw6IEFkZGVkLgorCiAyMDA4LTEwLTA0
ICBFcmljIFNlaWRlbCAgPGVyaWNAd2Via2l0Lm9yZz4KIAogICAgICAgICBSZXZpZXdlZCBieSBE
YXJpbiBBZGxlci4KSW5kZXg6IGZhc3QvZG9tL1dpbmRvdy93aW5kb3ctb3Blbi1wZW5kaW5nLXVy
bC1leHBlY3RlZC50eHQKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gZmFzdC9kb20vV2luZG93L3dpbmRvdy1vcGVu
LXBlbmRpbmctdXJsLWV4cGVjdGVkLnR4dAkocmV2aXNpb24gMCkKKysrIGZhc3QvZG9tL1dpbmRv
dy93aW5kb3ctb3Blbi1wZW5kaW5nLXVybC1leHBlY3RlZC50eHQJKHJldmlzaW9uIDApCkBAIC0w
LDAgKzEsMTAgQEAKK2xvY2F0aW9uOiAvCitocmVmOiAvCitwYXRobmFtZTogLworaG9zdDogCito
b3N0bmFtZTogCitoYXNoOiAKK3BvcnQ6IAorcHJvdG9jb2w6IDoKK3NlYXJjaDogCisKSW5kZXg6
IGZhc3QvZG9tL1dpbmRvdy93aW5kb3ctb3Blbi1wZW5kaW5nLXVybC5odG1sCj09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0K
LS0tIGZhc3QvZG9tL1dpbmRvdy93aW5kb3ctb3Blbi1wZW5kaW5nLXVybC5odG1sCShyZXZpc2lv
biAwKQorKysgZmFzdC9kb20vV2luZG93L3dpbmRvdy1vcGVuLXBlbmRpbmctdXJsLmh0bWwJKHJl
dmlzaW9uIDApCkBAIC0wLDAgKzEsMTYgQEAKKzxzY3JpcHQ+CitpZiAod2luZG93LmxheW91dFRl
c3RDb250cm9sbGVyKSB7CisgICAgbGF5b3V0VGVzdENvbnRyb2xsZXIuZHVtcEFzVGV4dCgpOwor
ICAgIGxheW91dFRlc3RDb250cm9sbGVyLnNldENhbk9wZW5XaW5kb3dzKCk7CisgICAgbGF5b3V0
VGVzdENvbnRyb2xsZXIud2FpdFVudGlsRG9uZSgpOworfQorCit2YXIgcG9wdXAgPSB3aW5kb3cu
b3BlbigncmVzb3VyY2VzL2Rlc3RpbmF0aW9uLmh0bWwnKTsKK2RvY3VtZW50LndyaXRlKCdsb2Nh
dGlvbjogJyArIHBvcHVwLmxvY2F0aW9uICsgJzxici8+Jyk7Cit2YXIgcHJvcHMgPSBbJ2hyZWYn
LCAncGF0aG5hbWUnLCAnaG9zdCcsICdob3N0bmFtZScsICdoYXNoJywgJ3BvcnQnLAorICAgICAg
ICAgICAgICdwcm90b2NvbCcsICdzZWFyY2gnXTsKK2ZvciAodmFyIGkgPSAwOyBpIDwgcHJvcHMu
bGVuZ3RoOyArK2kpIHsKKyAgdmFyIHByb3AgPSBwcm9wc1tpXTsKKyAgZG9jdW1lbnQud3JpdGUo
cHJvcCArICc6ICcgKyBwb3B1cC5sb2NhdGlvbltwcm9wXSArICc8YnIvPicpOworfQorPC9zY3Jp
cHQ+Cg==
</data>
<flag name="review"
          id="10954"
          type_id="1"
          status="+"
          setter="eric"
    />
          </attachment>
      

    </bug>

</bugzilla>