Code Monkey home page Code Monkey logo

Comments (6)

yutak avatar yutak commented on May 18, 2024

I made a glance at the tests, and I noticed one suspicious point: in these tests, iframe has an onload handler that calls a function, and test() is used in that function. Is this allowed? I guess async_test() should be used in such cases.

from wpt.

yutak avatar yutak commented on May 18, 2024

Well, to be clear, I think the test should use the following pattern:

var test = async_test(...);
var iframe = document.createElement('iframe');
// Set iframe's attributes, attach to document...
iframe.onload = test.step_func(function (evt) {
    // assert_whatever...
    test.done();
});

from wpt.

aogilvie avatar aogilvie commented on May 18, 2024

This git issue serves as a reminder that the event.*.htm tests were not working when I last tried them as the postMessage from testharness.js was mistakenly assumed in the test to carry the expected test data.

@yutak I don't think initiating the iFrame from JS or using the iFrame tag really matters, if we are discussing syntax and code style for example, I would more concerned about;

https://github.com/w3c/web-platform-tests/blob/master/webmessaging/event.data.htm

  • var DATA is using ALL CAPS, WHY!?
  • var ExpectedResult Uses Unexpected Caps someTimes On the First letter of a Variable name Instead of camelCase
  • ==, should be ===, always.
    ... anyway. No one is perfect when it comes to code style, and there is no style guide for writing W3C tests (yet?).

This week it will make it my duty to finish off the minimum required work to get these tests to not fail.
Would be interested to know why testharness.js needs to use postMessages...

from wpt.

yutak avatar yutak commented on May 18, 2024

@aogilvie OK, I think I understand your problem. I'm not sure about why testharness.js is using postMessage, either.

FYI, see https://github.com/w3c/web-platform-tests/blob/master/webmessaging/postMessage_ArrayBuffer.htm for the problem I talked about; this test calls test() function inside the onload event handler, and I'm not sure if this is legitimate.

from wpt.

dontcallmedom avatar dontcallmedom commented on May 18, 2024

testharness.js uses postMessage to collect results cross-origin, see w3c/testharness.js#8

from wpt.

foolip avatar foolip commented on May 18, 2024

Sounds like this was about bugs in the tests at https://wpt.fyi/webmessaging to begin with? I've taken a look at it seems like all tests pass in at least one browser, which is better than expected. Are there still bugs to be fixed here?

@mdittmer @lukebjerring this is a typical case where the interop view would have come in handy :)

from wpt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.