Closed
Bug 765890
Opened 12 years ago
Closed 12 years ago
Make tests pass when javascript.options.xml.content is off by default
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: jorendorff, Unassigned)
References
Details
(Whiteboard: [js:t])
Attachments
(3 files, 6 obsolete files)
151.93 KB,
patch
|
jorendorff
:
review+
|
Details | Diff | Splinter Review |
4.66 KB,
patch
|
Details | Diff | Splinter Review | |
3.66 KB,
patch
|
Details | Diff | Splinter Review |
This mostly requires some test suite work.
Updated•12 years ago
|
Whiteboard: [js:t]
Comment 1•12 years ago
|
||
Fixes most of mochitest. Omits jstests for e4x (need to add target to testing makefile) Working through obvious errors in other js reftests
Comment 2•12 years ago
|
||
-Change to testing/testsuites-targets.mk to run e4x tests as a second pass (Concerned about the error reporting on the try servers) -jsreftests changed to pass as many syntax related e4x calls as possible. There are errors. See attachement UnexpectedChanges.text
Attachment #642506 -
Attachment is obsolete: true
Comment 3•12 years ago
|
||
Comment 4•12 years ago
|
||
Interesting observations: // 1) Crash when trying to resetPrefs() from javascript (may only happen in testing) // While trying to save an alternate preference set and reload it // Discovered this can make things crash Services.prefs.savePrefFile(null); Services.prefs.readUserPrefs(null); Services.prefs.resetPrefs(); // Crashes on this line // Not sure that the save and read are needed // 2) runreftests.py parameter has strange behavior // extra-profile-file did not work unless the file is user.js runreftests.py --extra-profile-file=
Comment 5•12 years ago
|
||
Attachment #642794 -
Attachment is obsolete: true
Attachment #642795 -
Attachment is obsolete: true
Comment 6•12 years ago
|
||
(root)/js/src/tests/js1_6/Regress/regress-314887.js fails. Needs work.
Attachment #643710 -
Attachment is obsolete: true
Updated•12 years ago
|
Attachment #643984 -
Flags: review?(jorendorff)
Comment 7•12 years ago
|
||
Ted, can you please make sure you patches have the needed metadata so that they're easier to eventually check in? Thanks! https://developer.mozilla.org/en/Creating_a_patch_that_can_be_checked_in
Comment 8•12 years ago
|
||
Ryan, I think this patch has the metadata you needed for easier checkin.
Attachment #643984 -
Attachment is obsolete: true
Attachment #643984 -
Flags: review?(jorendorff)
Attachment #644413 -
Flags: review?
Updated•12 years ago
|
Attachment #644413 -
Flags: review? → review?(jorendorff)
Comment 9•12 years ago
|
||
(In reply to ted shroyer from comment #8) > Created attachment 644413 [details] [diff] [review] > Patch with metadata for easier checkin > > Ryan, I think this patch has the metadata you needed for easier checkin. Much better, thanks! One note, this patch is pretty self-explanatory based on the bug title, but typically you'll want a commit message that's succinctly describing what the patch is doing. You don't need to worry about that for this one, though.
Reporter | ||
Comment 10•12 years ago
|
||
Comment on attachment 644413 [details] [diff] [review] Patch with metadata for easier checkin Review of attachment 644413 [details] [diff] [review]: ----------------------------------------------------------------- r=me with a few minor changes, described below. In these three files: content/xslt/tests/mochitest/test_bug427060.html content/xslt/tests/mochitest/test_bug440974.html content/xslt/tests/mochitest/test_bug453441.html please use \n\ instead of plain \. These are tests we are not going to delete when E4X goes, so I have a feeling it'd be rude of us to change the meaning of the code in these tests any more than we have to. (The only way this would ever matter practically is that if the test ever suddenly started failing with a parse error, the parse error line number would be something meaningful instead of just always being 1. So not a huge deal. It might never happen.) In js/src/tests/js1_6/Regress/regress-314887.js: >+// E4X NEEDS WORK >+// javascript.options.xml.content = false causes this test to fail Oops. This doesn't need debugging, it just needs the E4X pref turned on. (I told you it didn't, but I was wrong.) > var BUGNUMBER = 314887; > var summary = 'Do not crash when morons embed script tags in external script files'; Still my favorite bug summary ever. ::: js/src/tests/e4x/Regress/regress-474319.js @@ +1,1 @@ > +// |reftest| pref(javascript.options.xml.content,true) skip-if(Android) Huh, you added one more space character here than in the other files. I don't care about the space, as long as it works. ::: js/xpconnect/tests/mochitest/test_bug618017.html @@ +31,5 @@ > + setAllowXML(default_allow_xml); > +} > + > +setAllowXML(true); > +var uneval_xml = uneval(eval('<test />')); So gross. But this is one of the tests we *do* want to delete, so it'll be all right. If you want we can debug this and figure out why the pref doesn't take effect when we expected. I'm not super worried about it, but I'd like to know. ::: modules/libpref/src/init/all.js @@ +682,4 @@ > pref("javascript.options.pccounts.content", false); > pref("javascript.options.pccounts.chrome", false); > pref("javascript.options.methodjit_always", false); > +pref("javascript.options.xml.content", false); This change shouldn't be landed at the same time as all the test fixes. The test fixes should land first, without toggling this pref. So please take it out of the patch. Tomorrow or Tuesday we can send an updated patch to the Try server.
Attachment #644413 -
Flags: review?(jorendorff) → review+
Reporter | ||
Comment 11•12 years ago
|
||
Ted mentioned that using pref() in js-tests causes js/src/tests/lib/manifest.py to spit out a few warnings. The parser in there needs to be updated to cope with pref(). Regexp hacking. :-P
Comment 12•12 years ago
|
||
Should contain changes for jorendorff's comments and deal with recent removal of some test cases
Attachment #644413 -
Attachment is obsolete: true
Attachment #645120 -
Flags: review?(jorendorff)
Reporter | ||
Comment 13•12 years ago
|
||
Very pretty green Try Server run you probably can't see: https://tbpl.mozilla.org/?tree=Try&rev=eccf29eab7ab
Reporter | ||
Comment 14•12 years ago
|
||
This patch shows that two existing tests can be made to pass even if the pref is off by default. You just have to turn it on first. However it's really fragile and unpredictable. I think there's something wrong with the pref. The next patch will show one strange way to make the tests fail.
Reporter | ||
Comment 15•12 years ago
|
||
Just switching from enablePrivilege to SpecialPowers is enough to make the pref not take effect. Very strange.
Reporter | ||
Comment 16•12 years ago
|
||
OK. There are multiple parts to the strangeness. One weird thing is that `eval('<x/>')` is different from plain `<x/>`. From just a plain sanity standpoint this Should Not Be. The bug is that overrideVersion stomps on the language version and options. For direct eval code, that stuff should be inherited from the calling script regardless of what else is on the stack. That's a bug. To me versionOverride is crazy from top to bottom; I can't imagine what that is supposed to be for. But I say we land this patch and fix versionOverride later, perhaps after deleting E4X.
Reporter | ||
Comment 17•12 years ago
|
||
Comment on attachment 645120 [details] [diff] [review] Alter mochitests/jsreftests to pass when javascript.options.xml.content defaults to false The technique this patch uses to fix the two js/xpconnect mochitests is definitely sketchy. I don't see a better way, though, only other equally ugly workarounds. Let's do it. r=me.
Attachment #645120 -
Flags: review?(jorendorff) → review+
Reporter | ||
Comment 18•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/baffbb5841f3
Reporter | ||
Comment 19•12 years ago
|
||
OK, this bug is about the test suite. The patch has landed. Filed bug 778851 for the rest.
Reporter | ||
Comment 20•12 years ago
|
||
Follow-up fix: https://hg.mozilla.org/integration/mozilla-inbound/rev/2ed8be848b93
Comment 21•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/baffbb5841f3 https://hg.mozilla.org/mozilla-central/rev/2ed8be848b93
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
Reporter | ||
Updated•12 years ago
|
Summary: Turn javascript.options.xml.content off by default → Make tests pass when javascript.options.xml.content is off by default
Target Milestone: mozilla17 → ---
You need to log in
before you can comment on or make changes to this bug.
Description
•