Last Comment Bug 628974 - Every dom-level1-core mochitest loads http://www.w3.org/StyleSheets/activity-home.css over the network
: Every dom-level1-core mochitest loads http://www.w3.org/StyleSheets/activity-...
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla2.0b12
Assigned To: Phil Ringnalda (:philor)
:
Mentors:
: 627011 (view as bug list)
Depends on:
Blocks: 360998 626999
  Show dependency treegraph
 
Reported: 2011-01-26 06:04 PST by Ted Mielczarek [:ted.mielczarek]
Modified: 2011-03-04 10:14 PST (History)
5 users (show)
philringnalda: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
.17-fixed
.19-fixed


Attachments
Removes the stylesheet (145 bytes, text/plain)
2011-01-26 06:45 PST, Mounir Lamouri (:mounir)
no flags Details
switch to relative URI (691.59 KB, patch)
2011-02-07 00:25 PST, Phil Ringnalda (:philor)
bzbarsky: review+
Details | Diff | Review

Description Ted Mielczarek [:ted.mielczarek] 2011-01-26 06:04:06 PST
Running mochitest-2/5 with Wireshark running, I caught this test making a network request:

GET /StyleSheets/activity-home.css HTTP/1.1
Host: www.w3.org
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b9pre) Gecko/20110105 Firefox/4.0b9pre
Accept: text/css,*/*;q=0.1
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Referer: http://mochi.test:8888/tests/dom/tests/mochitest/dom-level1-core/test_PIsetdatanomodificationallowederrEE.html

Looks like it's loading a stylesheet from w3.org. We should fix this to not hit the network.
Comment 1 Boris Zbarsky [:bz] 2011-01-26 06:36:08 PST
Can we also report this to the W3C?  Their test suite should really be self-contained....
Comment 2 Ted Mielczarek [:ted.mielczarek] 2011-01-26 06:41:20 PST
Sure. Do you have any idea where I'd report it?
Comment 3 Boris Zbarsky [:bz] 2011-01-26 06:43:00 PST
I guess the webapps working group, since the DOM WG is no more?
Comment 4 Olli Pettay [:smaug] 2011-01-26 06:45:19 PST
"The WebApps WG Drives DOM Specifications. The W3C Web Applications Working Group has taken over responsibility for the Document Object Model specifications, including a new revision of DOM Level 3 Events, a new DOM Core specification, and potentially any errata on older DOM specifications. Discussion can be directed to either the public-webapps@w3.org or the www-dom@w3.org mailing lists. "
Comment 5 Mounir Lamouri (:mounir) 2011-01-26 06:45:47 PST
Created attachment 507108 [details]
Removes the stylesheet

The stylesheet doesn't seem to be needed here, does it?
Comment 6 Boris Zbarsky [:bz] 2011-01-26 06:51:55 PST
Probably not, but:

1)  The patch doesn't take it out
2)  http://mxr.mozilla.org/mozilla-central/search?string=activity-home says there
    are 526 other files that load this stylesheet.  Think "every single test in
    the DOM L1 test suite".  Maybe none of them need it (pretty likely, in
    fact).  But maybe the right fix here is to have the proxy mochitests run
    against proxy this stylesheet to something, instead of hacking all the tests?
Comment 7 Mounir Lamouri (:mounir) 2011-01-26 06:58:01 PST
(In reply to comment #6)
> Probably not, but:
> 
> 1)  The patch doesn't take it out

Damn, again! I think I should have a script attaching my patches and make sure they are not empty :(

> 2)  http://mxr.mozilla.org/mozilla-central/search?string=activity-home says
> there
>     are 526 other files that load this stylesheet.  Think "every single test in
>     the DOM L1 test suite".  Maybe none of them need it (pretty likely, in
>     fact).  But maybe the right fix here is to have the proxy mochitests run
>     against proxy this stylesheet to something, instead of hacking all the
> tests?

Indeed, I didn't check if it was used by other tests. I assumed it wasn't, given that this bug was specific, but it seemed weird.
A solution could be to update all the tests in a batch. Easy to do but a little annoying to review. Do we already have such a system to proxy the stylesheet?
Comment 8 Boris Zbarsky [:bz] 2011-01-26 07:05:02 PST
We already proxy other domains (mochi.test, say); there's no reason we couldn't proxy www.w3.org, I assume.
Comment 9 Ted Mielczarek [:ted.mielczarek] 2011-01-26 07:50:19 PST
server-locations.txt lists all the hosts we proxy through the Mochitest httpd.js:
http://mxr.mozilla.org/mozilla-central/source/build/pgo/server-locations.txt
Comment 10 Mounir Lamouri (:mounir) 2011-01-26 07:55:49 PST
(In reply to comment #9)
> server-locations.txt lists all the hosts we proxy through the Mochitest
> httpd.js:
> http://mxr.mozilla.org/mozilla-central/source/build/pgo/server-locations.txt

Ted, can we easily redirect a specific path (say www.w3.org/StyleSheets/) to a specific local directory?
Comment 11 Ted Mielczarek [:ted.mielczarek] 2011-01-26 08:26:41 PST
All hosts get proxied to the same place, which is like $objdir/_tests/testing/mochitest if you run from the objdir. (We may have renamed that recently, but you'll find server.js there.)
Comment 12 Phil Ringnalda (:philor) 2011-02-07 00:25:08 PST
Created attachment 510227 [details] [diff] [review]
switch to relative URI

Proxying would be reasonable if we were running unmodified tests, but we aren't, we've already made all sorts of changes and additions to make them work with the mochitest harness. This patch just makes one more, loading the (unnecessary, vaguely horrifying, and with trailing whitespace preserved) stylesheet from a relative URI.

Rather than actually looking at the patch, I recommend reviewing the oneliner that produced it, find dom/tests/mochitest/dom-level1-core/ -type f | xargs perl -pi -e 's!http://www.w3.org/StyleSheets/!!'
Comment 13 Ted Mielczarek [:ted.mielczarek] 2011-02-07 05:48:41 PST
*** Bug 627011 has been marked as a duplicate of this bug. ***
Comment 14 Boris Zbarsky [:bz] 2011-02-07 07:23:44 PST
Comment on attachment 510227 [details] [diff] [review]
switch to relative URI

I guess....
Comment 15 Phil Ringnalda (:philor) 2011-02-07 19:27:11 PST
http://hg.mozilla.org/mozilla-central/rev/3001bf0ba0a3
Comment 17 Daniel Veditz [:dveditz] 2011-03-04 10:14:50 PST
The "3.6.15" we're releasing today does not fix this bug, the release containing this bug fix has been renamed to "3.6.16" and the bugzilla flags will be updated to reflect that soon. Today's release is a re-release of 3.6.14 plus a fix for a bug that prevented many Java applets from starting up.

Note You need to log in before you can comment on or make changes to this bug.