Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Performance interface's timing member to an attribute #23367

Closed
wants to merge 1 commit into from

Conversation

@garyemerson
Copy link

garyemerson commented May 11, 2019

Change Performance interface's timing member to an attribute


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #23330 (GitHub issue number if applicable)
  • These changes do not require tests because ___
  • There are tests for these changes OR

This change is Reviewable

@highfive
Copy link

highfive commented May 11, 2019

Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @jdm (or someone else) soon.

@highfive
Copy link

highfive commented May 11, 2019

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/webidls/Performance.webidl
  • @KiChjang: components/script/dom/webidls/Performance.webidl
@highfive
Copy link

highfive commented May 11, 2019

warning Warning warning

  • These commits modify script code, but no tests are modified. Please consider adding a test!
@jdm
Copy link
Member

jdm commented May 13, 2019

@bors-servo try=wpt

@bors-servo
Copy link
Contributor

bors-servo commented May 13, 2019

Trying commit b1bcd97 with merge ddf1b8e...

bors-servo added a commit that referenced this pull request May 13, 2019
Change Performance interface's timing member to an attribute

<!-- Please describe your changes on the following line: -->
Change Performance interface's timing member to an attribute

---
<!-- 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] These changes fix #23330 (GitHub issue number if applicable)

<!-- Either: -->
- [ ] These changes do not require tests because ___
- [ ] There are tests for these changes OR

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23367)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented May 13, 2019

💔 Test failed - linux-rel-css

@jdm
Copy link
Member

jdm commented May 13, 2019

Looks like we'll need to figure out why the code at line 372 of components/script/dom/performance.rs is triggering in this case! You can run this test locally with ./mach test-wpt tests/wpt/web-platform-tests/workers/worker-performance.worker.html.

  ▶ CRASH [expected OK] /workers/worker-performance.worker.html
  │ internal error: entered unreachable code: Are we trying to expose Performance.timing in workers? (thread WebWorker for http://web-platform.test:8000/workers/worker-performance.worker.js, at components/script/dom/performance.rs:372)
  │ stack backtrace:
  │    0:     0x5642f23cfead - backtrace::backtrace::trace::h669a3feab6d0ae0a
  │    1:     0x5642f23ced12 - backtrace::capture::Backtrace::new::hb7eb6d6563d22995
  │    2:     0x5642ef34105f - servo::main::{{closure}}::ha99dd51ed1550095
  │    3:     0x5642f25ba108 - rust_panic_with_hook
  │                         at src/libstd/panicking.rs:478
  │    4:     0x5642f25b9ba1 - continue_panic_fmt
  │                         at src/libstd/panicking.rs:381
  │    5:     0x5642f25b9aee - begin_panic_fmt
  │                         at src/libstd/panicking.rs:336
  │    6:     0x5642efa8d3f0 - <script::dom::performance::Performance as script::dom::bindings::codegen::Bindings::PerformanceBinding::PerformanceBinding::PerformanceMethods>::Timing::he8263976ee2342e9
  │    7:     0x5642efd9561e - <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::hb2b57fe17724f95a
  │    8:     0x5642f0674d2f - _ZN3std9panicking3try7do_call17h9d244b4a57076db7E.llvm.17322854875324407395
  │    9:     0x5642f25c4349 - __rust_maybe_catch_panic
  │                         at src/libpanic_unwind/lib.rs:85
  │   10:     0x5642f02ef9ae - script::dom::bindings::codegen::Bindings::PerformanceBinding::PerformanceBinding::get_timing::he21bd280d2d85ce3
  │   11:     0x5642f05aa91b - script::dom::bindings::utils::generic_call::h87e28b171cec6661
  │   12:     0x5642f05aacae - script::dom::bindings::utils::generic_getter::h7319cb2739d32350
  │   13:     0x5642f0f0f580 - _Z12CallJSNativeP9JSContextPFbS0_jPN2JS5ValueEERKNS1_8CallArgsE
  │                         at /home/servo/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/bf26953/mozjs/js/src/vm/Interpreter.cpp:441
  │                          - _ZN2js23InternalCallOrConstructEP9JSContextRKN2JS8CallArgsENS_14MaybeConstructE
  │                         at /home/servo/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/bf26953/mozjs/js/src/vm/Interpreter.cpp:533
  │   14:     0x5642f0f1039a - _ZL12InternalCallP9JSContextRKN2js13AnyInvokeArgsE
  │                         at /home/servo/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/bf26953/mozjs/js/src/vm/Interpreter.cpp:588
  │                          - _ZN2js4CallEP9JSContextN2JS6HandleINS2_5ValueEEES5_RKNS_13AnyInvokeArgsENS2_13MutableHandleIS4_EE
  │                         at /home/servo/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/bf26953/mozjs/js/src/vm/Interpreter.cpp:604
  │                          - _ZN2js10CallGetterEP9JSContextN2JS6HandleINS2_5ValueEEES5_NS2_13MutableHandleIS4_EE
  │                         at /home/servo/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/bf26953/mozjs/js/src/vm/Interpreter.cpp:728
  │   15:     0x5642f0965f9b - _ZL10CallGetterP9JSContextN2JS6HandleIP8JSObjectEENS2_INS1_5ValueEEENS2_IPN2js5ShapeEEENS1_13MutableHandleIS6_EE
  │                         at /home/servo/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/bf26953/mozjs/js/src/vm/NativeObject.cpp:2232
  │                          - _ZL19GetExistingPropertyILN2js7AllowGCE1EEbP9JSContextNS0_11MaybeRootedIN2JS5ValueEXT_EE10HandleTypeENS4_IPNS0_12NativeObjectEXT_EE10HandleTypeENS4_IPNS0_5ShapeEXT_EE10HandleTypeENS7_17MutableHandleTypeE
  │                         at /home/servo/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/bf26953/mozjs/js/src/vm/NativeObject.cpp:2284
  │                          - _ZL23NativeGetPropertyInlineILN2js7AllowGCE1EEbP9JSContextNS0_11MaybeRootedIPNS0_12NativeObjectEXT_EE10HandleTypeENS4_IN2JS5ValueEXT_EE10HandleTypeENS4_INS9_11PropertyKeyEXT_EE10HandleTypeE12IsNameLookupNSB_17MutableHandleTypeE
  │                         at /home/servo/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/bf26953/mozjs/js/src/vm/NativeObject.cpp:2533
  │                          - _ZN2js17NativeGetPropertyEP9JSContextN2JS6HandleIPNS_12NativeObjectEEENS3_INS2_5ValueEEENS3_INS2_11PropertyKeyEEENS2_13MutableHandleIS7_EE
  │                         at /home/servo/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/bf26953/mozjs/js/src/vm/NativeObject.cpp:2570
  │   16:     0x5642f0f12233 - _ZN2js11GetPropertyEP9JSContextN2JS6HandleIP8JSObjectEENS3_INS2_5ValueEEENS3_INS2_11PropertyKeyEEENS2_13MutableHandleIS7_EE
  │                         at /home/servo/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/bf26953/mozjs/js/src/vm/ObjectOperations-inl.h:117
  │                          - _ZN2js11GetPropertyEP9JSContextN2JS6HandleIP8JSObjectEENS3_INS2_5ValueEEEPNS_12PropertyNameENS2_13MutableHandleIS7_EE
  │                         at /home/servo/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/bf26953/mozjs/js/src/vm/ObjectOperations-inl.h:124
  │                          - _ZN2js11GetPropertyEP9JSContextN2JS6HandleINS2_5ValueEEENS3_IPNS_12PropertyNameEEENS2_13MutableHandleIS4_EE
  │                         at /home/servo/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/bf26953/mozjs/js/src/vm/Interpreter.cpp:4477
  │   17:     0x5642f0f068d5 - _ZL20GetPropertyOperationP9JSContextPN2js16InterpreterFrameEN2JS6HandleIP8JSScriptEEPhNS4_13MutableHandleINS4_5ValueEEESC_
  │                         at /home/servo/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/bf26953/mozjs/js/src/vm/Interpreter.cpp:217
  │                          - _ZL9InterpretP9JSContextRN2js8RunStateE
  │                         at /home/servo/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/bf26953/mozjs/js/src/vm/Interpreter.cpp:2770
  │   18:     0x5642f0f008d8 - _ZN2js9RunScriptEP9JSContextRNS_8RunStateE
  │                         at /home/servo/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/bf26953/mozjs/js/src/vm/Interpreter.cpp:421
  │   19:     0x5642f0f0f84d - _ZN2js23InternalCallOrConstructEP9JSContextRKN2JS8CallArgsENS_14MaybeConstructE
  │                         at /home/servo/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/bf26953/mozjs/js/src/vm/Interpreter.cpp:561
  │   20:     0x5642f0f0fce5 - _ZN2js4CallEP9JSContextN2JS6HandleINS2_5ValueEEES5_RKNS_13AnyInvokeArgsENS2_13MutableHandleIS4_EE
  │                         at /home/servo/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/bf26953/mozjs/js/src/vm/Interpreter.cpp:604
  │   21:     0x5642f092a4c9 - _ZN2js9fun_applyEP9JSContextjPN2JS5ValueE
  │                         at /home/servo/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/e21c05b/mozjs/js/src/vm/JSFunction.cpp:1218
  │   22:     0x5642f0f0f580 - _Z12CallJSNativeP9JSContextPFbS0_jPN2JS5ValueEERKNS1_8CallArgsE
  │                         at /home/servo/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/bf26953/mozjs/js/src/vm/Interpreter.cpp:441
  │                          - _ZN2js23InternalCallOrConstructEP9JSContextRKN2JS8CallArgsENS_14MaybeConstructE
  │                         at /home/servo/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/bf26953/mozjs/js/src/vm/Interpreter.cpp:533
  │   23:     0x5642f0bd31d8 - _ZN2js3jitL14DoCallFallbackEP9JSContextPNS0_13BaselineFrameEPNS0_15ICCall_FallbackEjPN2JS5ValueENS7_13MutableHandleIS8_EE
  │                         at /home/servo/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/bf26953/mozjs/js/src/jit/BaselineIC.cpp:3881
  │   24:      0xab0b1a3fde7 - <unknown>
  │   25:     0x7f522802ddc7 - <unknown>
  │   26:      0xab0b1a3b4de - <unknown>
  │   27:     0x5642f0d3db94 - _ZL8EnterJitP9JSContextRN2js8RunStateEPh
  │                         at /home/servo/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/bf26953/mozjs/js/src/jit/Jit.cpp:103
  │                          - _ZN2js3jit13MaybeEnterJitEP9JSContextRNS_8RunStateE
  │                         at /home/servo/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/bf26953/mozjs/js/src/jit/Jit.cpp:168
  │   28:     0x5642f0a00e91 - _ZN2js24EnsureTrackPropertyTypesEP9JSContextP8JSObjectN2JS11PropertyKeyE
  │                         at /home/servo/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/bf26953/mozjs/js/src/vm/TypeInference.cpp:1399
  │   29:     0x5642f0be65ae - _ZN2js3jitL17TryAttachCallStubEP9JSContextPNS0_15ICCall_FallbackEN2JS6HandleIP8JSScriptEEPh4JSOpjPNS5_5ValueEbbbPb
  │                         at /home/servo/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/bf26953/mozjs/js/src/jit/BaselineIC.cpp:3625
  │   30:                0x0 - <unknown>
@garyemerson
Copy link
Author

garyemerson commented May 14, 2019

I think I'm able to see the same thing:

output
┌[17:42:45] root:~/servo
└☻ ./mach test-wpt tests/wpt/web-platform-tests/workers/worker-performance.worker.js
 0:02.41 INFO Using 48 client processes
 0:02.49 INFO Starting http server on 127.0.0.1:8001
 0:02.52 INFO Starting http server on 127.0.0.1:8000
 0:02.53 INFO Starting https server on 127.0.0.1:8443
 0:02.53 SUITE_START: web-platform-test - running 1 tests
 0:02.53 INFO Running reftest tests
 0:02.54 INFO No reftest tests to run
 0:02.54 INFO Running wdspec tests
 0:02.54 INFO No wdspec tests to run
 0:02.54 INFO Running testharness tests
 0:02.54 INFO No more tests
 0:02.54 INFO No more tests
 0:02.55 INFO No more tests
 0:02.55 INFO Starting runner
 0:02.56 INFO No more tests
 0:02.56 INFO No more tests
 0:02.56 INFO No more tests
 0:02.57 INFO No more tests
 0:02.57 INFO No more tests
 0:02.57 TEST_START: /workers/worker-performance.worker.html
 0:02.57 INFO No more tests
 0:02.58 INFO No more tests
 0:02.58 INFO No more tests
 0:02.58 INFO No more tests
 0:02.58 WARNING Got command init_succeeded in state running
 0:02.59 INFO No more tests
 0:02.59 INFO No more tests
 0:02.59 INFO No more tests
 0:02.59 INFO No more tests
 0:02.60 INFO No more tests
 0:02.60 INFO No more tests
 0:02.60 INFO No more tests
 0:02.60 INFO No more tests
 0:02.60 INFO No more tests
 0:02.60 INFO No more tests
 0:02.61 INFO No more tests
 0:02.61 INFO No more tests
 0:02.61 INFO No more tests
 0:02.61 INFO No more tests
 0:02.62 INFO No more tests
 0:02.62 INFO No more tests
 0:02.62 INFO No more tests
 0:02.62 INFO No more tests
 0:02.62 INFO No more tests
 0:02.62 INFO No more tests
 0:02.62 INFO No more tests
 0:02.63 pid:10408 Full command: /root/servo/target/debug/servo --hard-fail -u Servo/wptrunner -Z replace-surrogates http://web-platform.test:8000/workers/worker-performance.worker.html --user-stylesheet /root/servo/resources/ahem.css --certificate-path /root/servo/tests/wpt/web-platform-tests/tools/certs/cacert.pem
pid:10408 Failed to initialize any backend! Wayland status: NoCompositorListening X11 status: XOpenDisplayFailed (thread main, at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.18.0/src/platform/linux/mod.rs:437)
 0:02.63 INFO No more tests
 0:02.63 INFO No more tests
 0:02.63 INFO No more tests
 0:02.64 INFO No more tests
 0:02.64 INFO No more tests
 0:02.64 INFO No more tests
 0:02.64 INFO No more tests
 0:02.64 INFO No more tests
 0:02.64 INFO No more tests
 0:02.65 INFO No more tests
 0:02.65 INFO No more tests
 0:02.65 INFO No more tests
 0:02.65 INFO No more tests
 0:02.65 INFO No more tests
 0:05.73 pid:10408 stack backtrace:
 0:05.73 pid:10408    0:     0x5599b299ae66 - <no info>
 0:05.73 pid:10408    1:     0x5599b29958b3 - <no info>
 0:05.73 pid:10408    2:     0x5599b299580d - <no info>
 0:05.73 pid:10408    3:     0x5599aa73d6d1 - <no info>
 0:05.73 pid:10408    4:     0x5599b33c91a8 - <no info>
 0:05.73 pid:10408    5:     0x5599b0b88f05 - <no info>
 0:05.73 pid:10408    6:     0x5599b0b6b134 - <no info>
 0:05.73 pid:10408    7:     0x5599b0be43bf - <no info>
 0:05.73 pid:10408    8:     0x5599aa696c7f - <no info>
 0:05.73 pid:10408    9:     0x5599aa72a1c1 - <no info>
 0:05.73 pid:10408   10:     0x5599aa758eaa - <no info>
 0:05.73 pid:10408   11:     0x5599aa73cddf - <no info>
 0:05.73 pid:10408   12:     0x5599b33c8ac2 - <no info>
 0:05.73 pid:10408   13:     0x5599b33d33e9 - <no info>
 0:05.73 pid:10408   14:     0x5599b33c968c - <no info>
 0:05.73 pid:10408   15:     0x5599aa73cdb8 - <no info>
 0:05.73 pid:10408   16:     0x5599aa7591f9 - <no info>
 0:05.73 pid:10408   17:     0x7f7fdda71b96 - <no info>
 0:05.73 pid:10408   18:     0x5599aa633ce9 - <no info>
 0:05.77 TEST_END: CRASH, expected OK
 0:05.77 INFO No more tests
 0:05.78 INFO Closing logging queue
 0:05.78 INFO queue closed
 0:05.78 INFO Got 1 unexpected results
 0:05.78 SUITE_END

web-platform-test
~~~~~~~~~~~~~~~~~
Ran 1 checks (1 tests)
Expected results: 0
Unexpected results: 1
  test: 1 (1 crash)

Unexpected Results
------------------
CRASH /workers/worker-performance.worker.html
 0:05.84 INFO Closing logging queue
 0:05.84 INFO queue closed

Doing some digging now. Also, I've built and run the project on a linode server and the test seems to be printing an error about x11/wayland which makes sense since there's no display manager running. Should I be concerned about that? Is there a supported way to run tests in a sorta headless mode?

@jdm
Copy link
Member

jdm commented May 14, 2019

Unfortunately that's a very different error: Failed to initialize any backend! Wayland status: NoCompositorListening X11 status: XOpenDisplayFailed (thread main, at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.18.0/src/platform/linux/mod.rs:437)

You could try running with --headless to see if the output is any different.

@garyemerson
Copy link
Author

garyemerson commented May 14, 2019

Ok cool, looks like with --headless it fails with the more expected error:

output
┌[18:29:43] root:~/servo
└☻ ./mach test-wpt --headless tests/wpt/web-platform-tests/workers/worker-performance.worker.js
 0:02.43 INFO Using 48 client processes
 0:02.50 INFO Starting http server on 127.0.0.1:8000
 0:02.51 INFO Starting http server on 127.0.0.1:8001
 0:02.55 INFO Starting https server on 127.0.0.1:8443
 0:02.55 SUITE_START: web-platform-test - running 1 tests
 0:02.55 INFO Running reftest tests
 0:02.55 INFO No reftest tests to run
 0:02.55 INFO Running wdspec tests
 0:02.55 INFO No wdspec tests to run
 0:02.55 INFO Running testharness tests
 0:02.56 INFO No more tests
 0:02.56 INFO Starting runner
 0:02.57 INFO No more tests
 0:02.57 INFO No more tests
 0:02.58 INFO No more tests
 0:02.58 INFO No more tests
 0:02.58 TEST_START: /workers/worker-performance.worker.html
 0:02.58 INFO No more tests
 0:02.58 INFO No more tests
 0:02.58 WARNING Got command init_succeeded in state running
 0:02.58 INFO No more tests
 0:02.59 INFO No more tests
 0:02.59 INFO No more tests
 0:02.59 INFO No more tests
 0:02.59 INFO No more tests
 0:02.59 INFO No more tests
 0:02.60 INFO No more tests
 0:02.60 INFO No more tests
 0:02.60 INFO No more tests
 0:02.60 INFO No more tests
 0:02.60 INFO No more tests
 0:02.60 INFO No more tests
 0:02.60 INFO No more tests
 0:02.61 INFO No more tests
 0:02.61 INFO No more tests
 0:02.61 INFO No more tests
 0:02.61 INFO No more tests
 0:02.61 INFO No more tests
 0:02.62 INFO No more tests
 0:02.62 INFO No more tests
 0:02.62 INFO No more tests
 0:02.62 INFO No more tests
 0:02.62 INFO No more tests
 0:02.62 INFO No more tests
 0:02.62 INFO No more tests
 0:02.63 INFO No more tests
 0:02.63 INFO No more tests
 0:02.63 INFO No more tests
 0:02.63 INFO No more tests
 0:02.63 INFO No more tests
 0:02.63 INFO No more tests
 0:02.63 INFO No more tests
 0:02.63 INFO No more tests
 0:02.64 INFO No more tests
 0:02.64 INFO No more tests
 0:02.64 INFO No more tests
 0:02.64 INFO No more tests
 0:02.64 INFO No more tests
 0:02.65 INFO No more tests
 0:02.65 INFO No more tests
 0:02.66 pid:18318 Full command: /root/servo/target/debug/servo --hard-fail -u Servo/wptrunner -Z replace-surrogates -z http://web-platform.test:8000/workers/worker-performance.worker.html --user-stylesheet /root/servo/resources/ahem.css --certificate-path /root/servo/tests/wpt/web-platform-tests/tools/certs/cacert.pem
pid:18318 VMware, Inc.
 0:02.66 pid:18318 softpipe
 0:02.66 pid:18318 3.3 (Core Profile) Mesa 18.3.0-devel
 0:04.81 pid:18318 internal error: entered unreachable code: Are we trying to expose Performance.timing in workers? (thread WebWorker for http://web-platform.test:8000/workers/worker-performance.worker.js, at components/script/dom/performance.rs:372)
 0:14.39 TEST_END: Test TIMEOUT, expected OK. Subtests passed 6/11. Unexpected 1
TIMEOUT performance.timing is not available in workers - Test timed outTIMEOUT /workers/worker-performance.worker.html
 0:14.39 INFO No more tests
 0:14.41 INFO Closing logging queue
 0:14.41 INFO queue closed
 0:14.41 INFO Got 2 unexpected results
 0:14.41 SUITE_END

web-platform-test
~~~~~~~~~~~~~~~~~
Ran 12 checks (11 subtests, 1 tests)
Expected results: 10
Unexpected results: 2
  test: 1 (1 timeout)
  subtest: 1 (1 timeout)

Unexpected Results
------------------
/workers/worker-performance.worker.html
  TIMEOUT performance.timing is not available in workers - Test timed out
  TIMEOUT /workers/worker-performance.worker.html
 0:14.48 INFO Closing logging queue
 0:14.48 INFO queue closed
@garyemerson
Copy link
Author

garyemerson commented May 15, 2019

Hmm actually I'm a bit confused. Where is the file worker-performance.worker.html? I've been running

./mach test-wpt tests/wpt/web-platform-tests/workers/worker-performance.worker.js
instead of
./mach test-wpt tests/wpt/web-platform-tests/workers/worker-performance.worker.html

since I can't seem to find that worker-performance.worker.html file. If I'm understanding correctly, when I run with the .js file it doesn't actually run in the context of a worker and so some performance APIs are available that shouldn't be. I see some examples like responseXML-unavailable-in-worker.html that do run tests in the context of a worker, should I copy that?

@jdm
Copy link
Member

jdm commented May 16, 2019

You have been doing the right thing. The test harness server has special logic to handle URLS ending in .worker.js that turns them into HTML files that run a worker and handle all the test harness integration.

@CYBAI
Copy link
Collaborator

CYBAI commented May 16, 2019

@garyemerson As @jdm said, you have been doing the right thing.

For .worker.js, it means a standalone worker test.

As described in the documentation example, the test is written in .worker.js but it will be run in .worker.html.

You can read its documentation here.

@garyemerson
Copy link
Author

garyemerson commented May 27, 2019

Ah I see, thanks for the clarification. That documentation link was helpful too.

Could someone help me understand how the Exposed attributes in .webidl files work? My current understanding (mostly from reading this) is that the members in these interfaces are available only in the contexts that are listed in the attribute. However, I added a dummy partial interface to Performance.webidl like so:

[Exposed=(Window)]
partial interface Performance {
  void foobar();
};

as well as fn Foobar(&self) {} to the impl PerformanceMethods for Performance { block in performance.rs and was able to get a the below test passing in worker-performance.worker.js. I expected it to fail bc the above interface should only be exposed in a Window context.

assert_equals(typeof(performance.foobar), "function", "foobar is function");
@CYBAI
Copy link
Collaborator

CYBAI commented May 27, 2019

that the members in these interfaces are available only in the contexts that are listed in the attribute

Yes, so if there's an interface [Exposed=(Window,Worker)], it means it can be accessed in window context and worker context.

So, for the foobar example, you can only access it in window and you should fail the test in .worker.js.

@garyemerson
Copy link
Author

garyemerson commented May 27, 2019

So, for the foobar example, you can only access it in window and you should fail the test in .worker.js.

Yeah that's what's confusing, the test should fail but it doesn't, it passes.

@jdm
Copy link
Member

jdm commented May 27, 2019

Yes, that is a known issue that I stumbled across recently: #23332

@garyemerson
Copy link
Author

garyemerson commented May 28, 2019

Should we move forward with this PR (perhaps comment out/remove test for now) or just hang back until #23332 is resolved?

@jdm
Copy link
Member

jdm commented May 28, 2019

Yes, let's go ahead and make the expected results for that test CRASH (like this other test, for example). This will allow us to notice when #23332 fixes it.

@jdm
Copy link
Member

jdm commented Jul 4, 2019

@garyemerson Are you planning to finish this work?

@jdm
Copy link
Member

jdm commented Jul 12, 2019

Closing due to lack of activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

5 participants
You can’t perform that action at this time.