Skip to content

Added wpt tests for same-origin iframe parentage. - #11476

Merged
bors-servo merged 1 commit into
servo:masterfrom
asajeffrey:add-tests-for-iframe-parentage
Jun 2, 2016
Merged

bors-servo merged 1 commit into
servo:masterfrom
asajeffrey:add-tests-for-iframe-parentage

Conversation

@asajeffrey

@asajeffrey asajeffrey commented May 27, 2016 •

Copy link
Copy Markdown
Contributor

Added some wpt tests to make sure same-origin iframes have the right parentage.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • There are tests for these changes OR

This change is Reviewable

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label May 27, 2016
@asajeffrey

Copy link
Copy Markdown
Contributor Author

r? @jdm

@jdm

jdm commented May 30, 2016

Copy link
Copy Markdown
Member

-S-awaiting-review +S-needs-code-changes

Previously, asajeffrey (Alan Jeffrey) wrote…

r? @jdm


Reviewed 6 of 6 files at r1, 1 of 1 files at r2.
Review status: all files reviewed at latest revision, 11 unresolved discussions, some commit checks failed.


tests/wpt/mozilla/tests/mozilla/iframe/iframe_harness.js, line 3 [r1] (raw file):

function get_test_results(id) {
    async_test(function(test) {
        var timer = window.setInterval(loop, 100);

setInterval(test.step_func(loop), 100)


tests/wpt/mozilla/tests/mozilla/iframe/iframe_harness.js, line 6 [r1] (raw file):

  function loop() {
      var xhr = new XMLHttpRequest();
      xhr.open('GET', '/_mozilla/mozilla/iframe/stash.py?id=' + id);

I this this can be 'stash.py' without any path.


tests/wpt/mozilla/tests/mozilla/iframe/iframe_harness.js, line 16 [r1] (raw file):

      });
      xhr.send();
  }

nit: remove the tabs in this file.


tests/wpt/mozilla/tests/mozilla/iframe/iframe_harness.js, line 24 [r1] (raw file):

    for (result in results) { ok = ok && results[result]; }
    var xhr = new XMLHttpRequest();
    xhr.open('POST', '/_mozilla/mozilla/iframe/stash.py?id=' + results.id);

We should be able to use 'stash.py' without any explicit path.


tests/wpt/mozilla/tests/mozilla/iframe/iframe_harness.js, line 24 [r1] (raw file):

    for (result in results) { ok = ok && results[result]; }
    var xhr = new XMLHttpRequest();
    xhr.open('POST', '/_mozilla/mozilla/iframe/stash.py?id=' + results.id);

If we make this a synchronous XHR we don't need the looping timer.


tests/wpt/mozilla/tests/mozilla/iframe/iframe_harness.js, line 25 [r1] (raw file):

    var xhr = new XMLHttpRequest();
    xhr.open('POST', '/_mozilla/mozilla/iframe/stash.py?id=' + results.id);
    xhr.send(ok? "OK": "FAIL: " + JSON.stringify(results));;

nit: remove the extra ; and add a space before ?


tests/wpt/mozilla/tests/mozilla/iframe/same_origin_child.html, line 9 [r1] (raw file):

        "id": '08782f28-e313-47ae-8cd7-419f3e194b0a',
  "parent": window.parent != window,
  "grandparent": window.parent.parent == window.parent,

Should these be ===?


tests/wpt/mozilla/tests/mozilla/iframe/same_origin_child.html, line 10 [r1] (raw file):

  "parent": window.parent != window,
  "grandparent": window.parent.parent == window.parent,
  "top": window.top == window.parent,

nit: tabs


tests/wpt/mozilla/tests/mozilla/iframe/same_origin_grandchild.html, line 9 [r1] (raw file):

  "parent": window.parent != window,
  "grandparent": window.parent.parent != window.parent,
  "top": window.top == window.parent.parent,

nit: tabs


tests/wpt/mozilla/tests/mozilla/iframe/same_origin_parentage.html, line 13 [r1] (raw file):

    get_test_results('17381dae-9c3e-4661-9f2b-28eb07a5f2fc');
    get_test_results('08782f28-e313-47ae-8cd7-419f3e194b0a');
    get_test_results('66de8d44-7da7-47c7-9a52-41cba4f22bfe');

These should be in an onload handler for the iframe.


tests/wpt/mozilla/tests/mozilla/iframe/same_origin_parentage.html, line 17 [r1] (raw file):

        "id": '17381dae-9c3e-4661-9f2b-28eb07a5f2fc',
  "parent": window.parent == window,
  "top": window.top == window,

nit: tabs


Comments from Reviewable

@jdm jdm added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-review There is new code that needs to be reviewed. labels May 30, 2016
@highfive highfive removed the S-needs-code-changes Changes have not yet been made that were requested by a reviewer. label May 31, 2016
@asajeffrey

Copy link
Copy Markdown
Contributor Author

Review status: all files reviewed at latest revision, 11 unresolved discussions, some commit checks failed.


tests/wpt/mozilla/tests/mozilla/iframe/iframe_harness.js, line 3 [r1] (raw file):

Previously, jdm (Josh Matthews) wrote…

setInterval(test.step_func(loop), 100)

Done.

tests/wpt/mozilla/tests/mozilla/iframe/iframe_harness.js, line 6 [r1] (raw file):

Previously, jdm (Josh Matthews) wrote…

I this this can be 'stash.py' without any path.

Done.

tests/wpt/mozilla/tests/mozilla/iframe/iframe_harness.js, line 16 [r1] (raw file):

Previously, jdm (Josh Matthews) wrote…

nit: remove the tabs in this file.

Done. Grr, emacs.

tests/wpt/mozilla/tests/mozilla/iframe/iframe_harness.js, line 24 [r1] (raw file):

Previously, jdm (Josh Matthews) wrote…

We should be able to use 'stash.py' without any explicit path.

Done.

tests/wpt/mozilla/tests/mozilla/iframe/iframe_harness.js, line 24 [r1] (raw file):

Previously, jdm (Josh Matthews) wrote…

If we make this a synchronous XHR we don't need the looping timer.

True, but I prefer async code where possible.

tests/wpt/mozilla/tests/mozilla/iframe/iframe_harness.js, line 25 [r1] (raw file):

Previously, jdm (Josh Matthews) wrote…

nit: remove the extra ; and add a space before ?

Done.

tests/wpt/mozilla/tests/mozilla/iframe/same_origin_child.html, line 9 [r1] (raw file):

Previously, jdm (Josh Matthews) wrote…

Should these be ===?

Done.

tests/wpt/mozilla/tests/mozilla/iframe/same_origin_child.html, line 10 [r1] (raw file):

Previously, jdm (Josh Matthews) wrote…

nit: tabs

Done.

tests/wpt/mozilla/tests/mozilla/iframe/same_origin_grandchild.html, line 9 [r1] (raw file):

Previously, jdm (Josh Matthews) wrote…

nit: tabs

Done.

tests/wpt/mozilla/tests/mozilla/iframe/same_origin_parentage.html, line 13 [r1] (raw file):

Previously, jdm (Josh Matthews) wrote…

These should be in an onload handler for the iframe.

Should they? We're polling `stash.py` anyway, checking a bit early doesn't actually cause any problems does it?

tests/wpt/mozilla/tests/mozilla/iframe/same_origin_parentage.html, line 17 [r1] (raw file):

Previously, jdm (Josh Matthews) wrote…

nit: tabs

Done.

Comments from Reviewable

@highfive

Copy link
Copy Markdown

New code was committed to pull request.

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label May 31, 2016
@asajeffrey asajeffrey added the S-needs-squash Some (or all) of the commits in the PR should be combined. label May 31, 2016
@jdm

jdm commented May 31, 2016

Copy link
Copy Markdown
Member

-S-awaiting-review

Previously, highfive wrote…

New code was committed to pull request.


Reviewed 4 of 4 files at r3.
Review status: all files reviewed at latest revision, 1 unresolved discussion, some commit checks failed.


tests/wpt/mozilla/tests/mozilla/iframe/same_origin_parentage.html, line 13 [r1] (raw file):

Previously, asajeffrey (Alan Jeffrey) wrote…

Should they? We're polling stash.py anyway, checking a bit early doesn't actually cause any problems does it?

This suggestion was based on the premise that sync XHR would be in use.

Comments from Reviewable

@jdm jdm removed the S-awaiting-review There is new code that needs to be reviewed. label May 31, 2016
@asajeffrey

Copy link
Copy Markdown
Contributor Author

Review status: all files reviewed at latest revision, all discussions resolved, some commit checks failed.


tests/wpt/mozilla/tests/mozilla/iframe/same_origin_parentage.html, line 13 [r1] (raw file):

Previously, jdm (Josh Matthews) wrote…

This suggestion was based on the premise that sync XHR would be in use.

Ah I see, all the more reason to use async XHR :)

Comments from Reviewable

@asajeffrey
asajeffrey force-pushed the add-tests-for-iframe-parentage branch from 574af26 to fa6fa62 Compare June 2, 2016 15:11
@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jun 2, 2016
@highfive

highfive commented Jun 2, 2016

Copy link
Copy Markdown

New code was committed to pull request.

@asajeffrey

Copy link
Copy Markdown
Contributor Author

Squashed.

@asajeffrey asajeffrey removed the S-needs-squash Some (or all) of the commits in the PR should be combined. label Jun 2, 2016
@jdm

jdm commented Jun 2, 2016

Copy link
Copy Markdown
Member

@bors-servo: r+

Previously, asajeffrey (Alan Jeffrey) wrote…

Squashed.


Review status: :shipit: all files reviewed at latest revision, all discussions resolved, all commit checks successful.


Comments from Reviewable

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit fa6fa62 has been approved by jdm

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Jun 2, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit fa6fa62 with merge a0ce5bd...

bors-servo pushed a commit that referenced this pull request Jun 2, 2016
Added wpt tests for same-origin iframe parentage.

<!-- Please describe your changes on the following line: -->
Added some wpt tests to make sure same-origin iframes have the right parentage.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] There are tests for these changes OR

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11476)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - linux-rel

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Jun 2, 2016
@highfive

highfive commented Jun 2, 2016

Copy link
Copy Markdown
  ▶ TIMEOUT [expected PASS] /css-backgrounds-3_dev/html4/background-paint-order-001.htm
  │ 
  │ Xlib:  extension &#34;XFree86-VidModeExtension&#34; missing on display &#34;:0&#34;.
  │ Shutting down the Constellation after generating an output file or exit flag specified
  │ Xlib:  extension &#34;XFree86-VidModeExtension&#34; missing on display &#34;:0&#34;.
  │ thread &#39;LayoutWorker worker 9/12&#39; panicked at &#39;called `Result::unwrap()` on an `Err` value: IoError(Error { repr: Os { code: 104, message: &#34;Connection reset by peer&#34; } })&#39;, ../src/libcore/result.rs:785
  │ stack backtrace:
  │    1:     0x7f11ccdd01c0 - std::sys::backtrace::tracing::imp::write::h9fb600083204ae7f
  │    2:     0x7f11ccdd7deb - std::panicking::default_hook::_$u7b$$u7b$closure$u7d$$u7d$::hca543c34f11229ac
  │    3:     0x7f11ccdd7a53 - std::panicking::default_hook::hc2c969e7453d080c
  │    4:     0x7f11cca55277 - util::panicking::initiate_panic_hook::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::he2b22674ad1748f3
  │    5:     0x7f11ccdbddac - std::panicking::rust_panic_with_hook::hfe203e3083c2b544
  │    6:     0x7f11ccdd8031 - std::panicking::begin_panic::h4889569716505182
  │    7:     0x7f11ccdbf80a - std::panicking::begin_panic_fmt::h484cd47786497f03
  │    8:     0x7f11ccdd7fce - rust_begin_unwind
  │    9:     0x7f11cce0e5cf - core::panicking::panic_fmt::h257ceb0aa351d801
  │   10:     0x7f11cc635d43 - core::result::unwrap_failed::h1d94443d858a91df
  │   11:     0x7f11cc659884 - gfx::font_cache_thread::FontCacheThread::find_font_template::h5b87de1d4383ad19
  │   12:     0x7f11cc65e7d4 - gfx::font_context::FontContext::layout_font_group_for_style::habc798e1e1f378d1
  │   13:     0x7f11cb4f6642 - layout::text::font_metrics_for_style::h47d9ef1163e2ab90
  │   14:     0x7f11cb4f6598 - layout::fragment::Fragment::calculate_line_</span><span class="stdout">height::h2fd722b6e5d0ee10
  │   15:     0x7f11cb4f7f86 - layout::fragment::Fragment::inline_metrics::hb73a427b21f4f6d6
  │   16:     0x7f11cb4fcb60 - layout::inline::LineBreaker::new_block_size_for_line::hb4e8eab4e7d35075
  │   17:     0x7f11cb4ff0b6 - _&lt;layout..inline..InlineFlow as layout..flow..Flow&gt;::assign_block_size::hf126b56b43fc68dc
  │   18:     0x7f11cb5e1cc3 - _&lt;layout..traversal..AssignISizes&lt;&#39;a&gt; as layout..parallel..ParallelPreorderFlowTraversal&gt;::run_parallel::hc10616c74c94e0bf
  │   19:     0x7f11cb5e247f - layout::parallel::assign_inline_sizes::h917782c09b72a5f7
  │   20:     0x7f11cb529aa6 - std::panicking::try::call::ha4fefec3c980f4a5
  │   21:     0x7f11ccde222b - __rust_try
  │   22:     0x7f11ccde21ce - __rust_maybe_catch_panic
  │   23:     0x7f11cb52b337 - _&lt;F as alloc..boxed..FnBox&lt;A&gt;&gt;::call_box::h82fb0d1a3a0ebea9
  │   24:     0x7f11ccdd61d4 - std::sys::thread::Thread::new::thread_start::h6f266e069bf4ec2b
  │   25:     0x7f11c8c44181 - start_thread
  │   26:     0x7f11c875b47c - __clone
  └   27:                0x0 - &lt;unknown&gt;

@asajeffrey

Copy link
Copy Markdown
Contributor Author

bors-servo pushed a commit that referenced this pull request Jun 2, 2016
Added wpt tests for same-origin iframe parentage.

<!-- Please describe your changes on the following line: -->
Added some wpt tests to make sure same-origin iframes have the right parentage.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] There are tests for these changes OR

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11476)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit fa6fa62 with merge a99cd23...

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Jun 2, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, windows

@bors-servo
bors-servo merged commit fa6fa62 into servo:master Jun 2, 2016
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jun 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants