RESOLVED FIXED 54028
http/tests/media should be served over HTTP (not from local file)
https://bugs.webkit.org/show_bug.cgi?id=54028
Summary http/tests/media should be served over HTTP (not from local file)
Anna Cavender
Reported 2011-02-08 13:13:15 PST
All tests in http/tests/media have been special cased in layout tests to be run from a local file. They really should be tested over HTTP. As an example, http/tests/media/video-referer.html tests that the Referer header is set for media resources, but requests should not contain this type of information for any file:// URL for security reasons. This test cannot be accurately tested unless served over http://.
Attachments
Patch (11.11 KB, patch)
2011-02-08 13:35 PST, Anna Cavender
no flags
Patch (11.40 KB, patch)
2011-02-08 15:25 PST, Anna Cavender
no flags
Patch (95.91 KB, patch)
2011-02-14 13:00 PST, Anna Cavender
mihaip: review+
commit-queue: commit-queue-
Eric Carlson
Comment 1 2011-02-08 13:19:29 PST
(In reply to comment #0) > All tests in http/tests/media have been special cased in layout tests to be run from a local file. They really should be tested over HTTP. > > As an example, http/tests/media/video-referer.html tests that the Referer header is set for media resources, but requests should not contain this type of information for any file:// URL for security reasons. This test cannot be accurately tested unless served over http://. +1!
Anna Cavender
Comment 2 2011-02-08 13:35:20 PST
Anna Cavender
Comment 3 2011-02-08 13:50:20 PST
Because the local server will run in http/tests/ for these tests, I had to copy 2 .js files into http/tests/media. Feedback requested on a better solution than this. Thanks!
Eric Carlson
Comment 4 2011-02-08 13:52:20 PST
Comment on attachment 81684 [details] Patch video-tests.js is out of date, you need to update your sources!
Anna Cavender
Comment 5 2011-02-08 15:25:57 PST
Anna Cavender
Comment 6 2011-02-08 15:27:05 PST
OOPS, let's try that again. This time with updated files.
Eric Carlson
Comment 7 2011-02-08 15:45:24 PST
Comment on attachment 81706 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=81706&action=review I would definitely babysit the bots when this lands, it may break tests that don't run on the port(s) you tested. > Tools/Scripts/webkitpy/layout_tests/port/base.py:360 > # TODO(dpranke): remove the media reference and the SSL reference? > - if (port and not relative_path.startswith("local/") and > - not relative_path.startswith("media/")): > + if (port and not relative_path.startswith("local/")): Can this TODO be changed now?
Anna Cavender
Comment 8 2011-02-08 15:53:29 PST
Comment on attachment 81706 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=81706&action=review >> Tools/Scripts/webkitpy/layout_tests/port/base.py:360 >> + if (port and not relative_path.startswith("local/")): > > Can this TODO be changed now? I think so (keeping the SSL reference). I'll cc dpranke as well.
Alexey Proskuryakov
Comment 9 2011-02-08 23:42:51 PST
Hmm, I was always assuming that there was a very good reason to run these tests from local files. I guess not. Did you check which revision this behavior was introduced in, and how it was explained?
Eric Carlson
Comment 10 2011-02-09 05:59:59 PST
(In reply to comment #9) > Hmm, I was always assuming that there was a very good reason to run these tests from local files. I guess not. > > Did you check which revision this behavior was introduced in, and how it was explained? It was this way from when Antti added support for http media tests in r27757: Index: Tools/Scripts/run-webkit-tests =================================================================== --- Tools/Scripts/run-webkit-tests (revision 27584) +++ Tools/Scripts/run-webkit-tests (revision 27757) @@ -314,6 +314,7 @@ if (!$testMedia) { $ignoredDirectories{'media'} = 1; + $ignoredDirectories{'http/tests/media'} = 1; } if ($ignoreTests) { @@ -484,7 +485,7 @@ print OUT "$testPath\n"; } else { openHTTPDIfNeeded(); - if ($test !~ /^http\/tests\/local\// && $test !~ /^http\/tests\/ssl\//) { + if ($test !~ /^http\/tests\/local\// && $test !~ /^http\/tests\/ssl\// && $test !~ /^http\/tests\/media\//) { my $path = canonpath($test); $path =~ s/^http\/tests\///; print OUT "http://127.0.0.1:$httpdPort/$path\n"; He doesn't remember why it was done that way.
Antti Koivisto
Comment 11 2011-02-09 12:09:25 PST
(In reply to comment #10) > He doesn't remember why it was done that way. I guess I just didn't consider loading the main document over http important and using local files was simpler.
Anna Cavender
Comment 12 2011-02-10 13:04:00 PST
Duplicate copies of video-test.js and media-file.js seems like a bad idea. Could we perhaps move LayoutTests/http/tests/media into LayoutTests/media? Is there a reason why these 15 tests are segregated from the rest of the media tests?
Mihai Parparita
Comment 13 2011-02-10 13:54:56 PST
(In reply to comment #12) > Duplicate copies of video-test.js and media-file.js seems like a bad idea. Could we perhaps move LayoutTests/http/tests/media into LayoutTests/media? Is there a reason why these 15 tests are segregated from the rest of the media tests? Presumably because they depend on some behavior that can only be tested by having an HTTP server running? Therefore I don't think moving them into LayoutTests/media is an option. Going in the other direction (moving LayoutTests/media into LayoutTests/http/tests/media) may be more feasible.
Alexey Proskuryakov
Comment 14 2011-02-10 15:00:41 PST
Generally, we only put things into http if they must be there.
Anna Cavender
Comment 15 2011-02-10 16:29:37 PST
Alright, how about we move video-test.js and media-file.js into http/tests/media and force the media/ tests to reach over and down to get them?
Anna Cavender
Comment 16 2011-02-14 13:00:29 PST
Anna Cavender
Comment 17 2011-02-14 13:02:39 PST
This looks like a much bigger patch than it is. Really just moving media-file.js and video-test.js into http/tests/media so that tests running from local server will be able to access them and then updating all the media tests to point to the new file locations.
WebKit Commit Bot
Comment 18 2011-02-16 16:19:02 PST
Comment on attachment 82355 [details] Patch Rejecting attachment 82355 [details] from commit-queue. Failed to run "['./Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '--bot-id=cr-jail-8', 'build-..." exit_code: 2 Last 500 characters of output: java/lc3/JSUndefined .......... java/lc3/JavaArray .... java/lc3/JavaClass .... java/lc3/JavaObject ..................................... java/lc3/StringMethods . java/lc3/forin . java/lc3/instanceof . loader .. mathml ....... mathml/presentation .................. media . media/adopt-node-crash.html -> failed Exiting early after 1 failures. 12974 tests run. 364.66s total testing time 12973 test cases (99%) succeeded 1 test case (<1%) had incorrect layout 9 test cases (<1%) had stderr output Full output: http://queues.webkit.org/results/7919518
Mihai Parparita
Comment 19 2011-02-16 18:37:27 PST
I patched this in locally, and all media tests failed. It looks like the move of media-file.js from the old to the new location isn't reflected in the patch (there's neither a delete nor an add). I'll fix up the patch and land it.
Alexey Proskuryakov
Comment 20 2011-02-16 19:08:08 PST
Sorry if I'm just stating the obvious, but please be sure to move with svn mv, so that commit history is preserved.
Anna Cavender
Comment 21 2011-02-16 19:34:17 PST
Shoot, missed that. I moved with git mv on my git repo, not svn. Won't forget next time! Thank everyone for your help.
Mihai Parparita
Comment 22 2011-02-16 19:38:45 PST
(In reply to comment #21) > Shoot, missed that. I moved with git mv on my git repo, not svn. Won't forget next time! Thank everyone for your help. git mv should work too. How did you upload your patch (this could be a bug with webkit-patch upload)?
Mihai Parparita
Comment 23 2011-02-16 19:41:39 PST
Anna Cavender
Comment 24 2011-02-16 20:28:08 PST
Here's what I did, let me know if there is a better way! # find the hash of the change right before my last commit (<hash>) git log # prep changelog from the diff between that commit and the head of this branch Tools/Scripts/prepare-ChangeLog --git-commit <hash>..HEAD # reset the git log, but keep all modifications git reset --soft <hash> # find ChangeLogs that were modified but not added to the patch (and modify) git status # add all modified ChangeLogs to the patch with git add git add Path/To/Whatever/ChangeLog (repeat for all changelogs) # upload patch! Tools/Scripts/webkit-patch upload Thanks again!
Eric Seidel (no email)
Comment 25 2011-02-16 20:46:14 PST
Nah, you just ran into bug 49154.
Eric Seidel (no email)
Comment 26 2011-02-22 21:08:19 PST
This is failing on the Snow Leopard bot.
Eric Seidel (no email)
Comment 27 2011-02-22 21:11:44 PST
Actually, this has been failing since it was originally added! SUCCESS: Build 8605 (r78741) was the first to show failures: set([u'media/controls-without-preload.html']) Suspect revisions: r78741: http://trac.webkit.org/changeset/78741 Bug: None (None) Author: "Martin Robinson" <mrobinson@webkit.org> Reviewer: None Committer: "Martin Robinson" <mrobinson@webkit.org> Explained all results for SnowLeopard Intel Release (WebKit2 Tests)
Martin Robinson
Comment 28 2011-02-22 21:16:14 PST
CCing Philippe, who converted the test.
Philippe Normand
Comment 29 2011-02-23 01:09:29 PST
I haven't worked on mac WebKit recently, so please bear with me :) We did various rebaselines of this test, but depending on the bot where we took the results it started failing elsewhere. So I think it now needs different baselines for WebKit2 on mac, SL and Leopard, possibly.
Note You need to log in before you can comment on or make changes to this bug.