RESOLVED FIXED 27963
Worker layout tests should be refactored to enable testing SharedWorkers also
https://bugs.webkit.org/show_bug.cgi?id=27963
Summary Worker layout tests should be refactored to enable testing SharedWorkers also
Andrew Wilson
Reported 2009-08-03 16:51:04 PDT
We have a bunch of worker layout tests - we should refactor them to enable running the same tests on SharedWorkers without duplicating lots of code.
Attachments
patch with updated layout tests (21.64 KB, patch)
2009-08-03 16:54 PDT, Andrew Wilson
levin: review+
Andrew Wilson
Comment 1 2009-08-03 16:54:14 PDT
Created attachment 34020 [details] patch with updated layout tests
David Levin
Comment 2 2009-08-04 08:59:28 PDT
Comment on attachment 34020 [details] patch with updated layout tests > diff --git a/LayoutTests/fast/workers/resources/shared-worker-common.js b/LayoutTests/fast/workers/resources/shared-worker-common.js > function handleMessage(event, port) { > if (event.data == "ping") > port.postMessage("PASS: Received ping message"); > else if (event.data == "done") > port.postMessage("DONE"); > - else if (/eval.+/.test(evt.data)) { > + else if (/eval.+/.test(event.data)) { > try { > - port.postMessage(evt.data.substr(5) + ": " + eval(evt.data.substr(5))); > + port.postMessage(event.data.substr(5) + ": " + eval(event.data.substr(5))); > } catch (ex) { > - port.postMessage(evt.data.substr(5) + ": " + ex); > + port.postMessage(event.data.substr(5) + ": " + ex); It seems like it would have been better to fix this in https://bugs.webkit.org/show_bug.cgi?id=27927 where you are adding the file... but at this point not worth changing both patches (which is maybe what you thought as well). Note that this needs https://bugs.webkit.org/show_bug.cgi?id=27927 to land first since it changes files from that patch.
Eric Seidel (no email)
Comment 3 2009-08-04 09:03:11 PDT
Comment on attachment 34020 [details] patch with updated layout tests Do you know about the JS testing harness? fast/js/resources the TEMPLATE.html files make-js-test-wrappers Gives you a bunch of stuff, including debug() and shouldBe, shouldBeEqual, etc. In general we write most new tests using this framework (yes, it needs to be better documented and put in a better location than fast/js/resources).
Andrew Wilson
Comment 4 2009-08-04 10:14:58 PDT
(In reply to comment #2) > It seems like it would have been better to fix this in > https://bugs.webkit.org/show_bug.cgi?id=27927 where you are adding the file... > but at this point not worth changing both patches (which is maybe what you > thought as well). > Yeah, I figured it wasn't worth going back to fix code that wasn't used in any tests. > > Note that this needs https://bugs.webkit.org/show_bug.cgi?id=27927 to land > first since it changes files from that patch. Yeah, I put "Depends on: 27927" in the bug - should I do something more? >Do you know about the JS testing harness? I saw that code when I was working on some of the window global constructor tests. I'm happy to use it in future tests - are you saying new tests should include ../js/resources/xxxxx.js?
Andrew Wilson
Comment 5 2009-08-06 11:26:24 PDT
Committed as r46852.
Note You need to log in before you can comment on or make changes to this bug.