Platform/JS Compartments Mochitest: Difference between revisions

 
(24 intermediate revisions by 4 users not shown)
Line 14: Line 14:


= Known issues still being worked on =
= Known issues still being worked on =
* check whether compartment is right for JS_Rewrap of T_JSVAL and variants
* don't enable the xray bypass for universal xpc for chrome
* named-frames-on-xray is wrong, customize xray with another flag
* only do the .wrappedJSObject hack for chrome windows, not content


= QA =
= QA =


Started build for QA to test.
Started build for QA to test.
Fixed:
* Adblock doesn't seem to filter (tries to call a function on undefined).
* Adblock crashes.


= xpcshell =
= xpcshell =
Line 48: Line 48:
= Mochitest =
= Mochitest =


Run with <code>python runtests.py --total-chunks=20 --this-chunk=n --autorun --debugger=gdb</code> where <code>n</code> is the chunk you want to examine.
Pass.


== Remaining large-ish items ==
== Remaining large-ish items ==
Line 55: Line 55:
* document.domain (we currently don't revoke access to the document's original domain, we probably should do that).
* document.domain (we currently don't revoke access to the document's original domain, we probably should do that).
* Error hacks?
* Error hacks?
* XPCSafeJSObjectWrapper::WrapObject() fails<br>    -> remove XPCSafeJSObjectWrapper
* Fix error messages for property access denied. Old message included two origins, new one doesn't, and it looks like we're not using any of the localization that the old message had. Error console should show both origins, exception message probably (?) shouldn't.
* Fix error messages for property access denied. Old message included two origins, new one doesn't, and it looks like we're not using any of the localization that the old message had. Error console should show both origins, exception message probably (?) shouldn't.
* Confirm that the fix in docshell/test/chrome/test_bug454235.xul is appropriate.
* Confirm that the fix in docshell/test/chrome/test_bug454235.xul is appropriate.
Line 76: Line 75:


<pre>
<pre>
http://mochi.test:8888/tests/toolkit/components/passwordmgr/test/test_prompt.html
</pre>
</pre>


== Chunk 1 ==
Asserts to death:


pass, 22848 tests
<pre>
</pre>


== Chunk 2 ==
= Mochichrome =


pass, 11244 tests:
<pre>
</pre>


== Chunk 3 ==
chrome://mochikit/content/chrome/js/src/xpconnect/tests/chrome/test_wrappers-2.xul


pass, 14532 tests
Lots of different issues:


== Chunk 4 ==
7257 ERROR TEST-UNEXPECTED-FAIL | chrome://mochikit/content/chrome/js/src/xpconnect/tests/chrome/test_wrappers-2.xul | enumeration over XOWs walks the prototype chain - got "host,hostname,port", expected "assign,foopy,hash,host,hostname,href,pathname,port,protocol,reload,replace,search"


passed, 19311 tests
Enumeration bug. "for (e in location)" doesn't walk the prototype chain.


* test_play_twice.html is notoriously rando-orange, see {{bug|558812}} and {{bug|573232}}
7259 ERROR TEST-UNEXPECTED-FAIL | chrome://mochikit/content/chrome/js/src/xpconnect/tests/chrome/test_wrappers-2.xul | wrapper iterators are properly iterators - got "object", expected "function,function,function,number,string,string,string,string,string,string,string,string"


== Chunk 5 ==
Enumeration bug. "Iterator(new XPCNativeWrapper(location))" is busted. I will look into this further.


pass, 4977 tests
7261 ERROR TEST-UNEXPECTED-FAIL | chrome://mochikit/content/chrome/js/src/xpconnect/tests/chrome/test_wrappers-2.xul | enumeration over SJOWs walks the prototype chain and works over XOWs - got "", expected "assign,foopy,hash,host,hostname,href,pathname,port,protocol,reload,replace,search"


== Chunk 6 ==
Enumeration bug. Same kind of problem but here we're trying to iterate over iwin.wrappedObject.location.


pass, 4825 tests
7268 ERROR TEST-UNEXPECTED-FAIL | chrome://mochikit/content/chrome/js/src/xpconnect/tests/chrome/test_wrappers-2.xul | cyclic proto value allowed


== Chunk 7 ==
We do iwin.__proto__ = iwin and expect it to fail, but this just creates a new ordinary data property called __proto__ on the holder.


pass, 194 tests
7269 ERROR TEST-UNEXPECTED-FAIL | chrome://mochikit/content/chrome/js/src/xpconnect/tests/chrome/test_wrappers-2.xul | iwin.eval does not throw an exception


== Chunk 8 ==
iwin.eval("'PASS'") is supposed to succeed, but iwin.eval is undefined.


pass, 346 tests
7271 ERROR TEST-UNEXPECTED-FAIL | chrome://mochikit/content/chrome/js/src/xpconnect/tests/chrome/test_wrappers-2.xul | Unable to wrap a primitive, even without 'new'
== Chunk 9 ==


pass, 159 tests
An old feature we didn't retain.  XPCNativeWrapper("") is expected to return
"". Maybe we can just remove the test.


== Chunk 10 ==
7276 ERROR TEST-UNEXPECTED-FAIL | chrome://mochikit/content/chrome/js/src/xpconnect/tests/chrome/test_wrappers-2.xul | XPCNativeWrappers allow expandos through
7284 ERROR TEST-UNEXPECTED-FAIL | chrome://mochikit/content/chrome/js/src/xpconnect/tests/chrome/test_wrappers-2.xul | delete doesn't delete underlying properties - got undefined, expected 5
    let iwin = $('ifr').contentWindow;
    let (w = new XPCNativeWrapper($('ifr').contentWindow)) {
        w.foopybar = 5;
        ok(!("foopybar" in iwin), "XPCNativeWrappers allow expandos through");
        ...
        iwin.foopy = 5;
        ok(delete w.foopy, "delete returns true");
        is(iwin.foopy, 5, "delete doesn't delete underlying properties");


pass, 396 tests
We create an explicit XPCNativeWrapper ''w'' around ''iwin'', a wrapper of an outer window. Expandos of ''w'' must not affect ''iwin'' and vice versa.


== Chunk 11 ==
I think the basic story here is "there are no same-compartment X-ray wrappers".


pass, 234 tests
7288 ERROR TEST-UNEXPECTED-FAIL | chrome://mochikit/content/chrome/js/src/xpconnect/tests/chrome/test_wrappers-2.xul | allowed to update iwin.__proto__ to null - got [], expected null


== Chunk 12 ==
Possibly just noise. If I comment out the cyclic-__proto__ test, this one
passes.


pass, 396 tests
But I can't imagine why iwin.__proto__ appears to be [] here. I looked, and the
value we eventually return is a cross-compartment XrayWrapper of an
OuterWindowProxy. The value should be null.


== Chunk 13 ==
-jorendorff, 10/5/2010


pass, 458 tests
= Browserchrome =


== Chunk 14 ==
Pass.


pass, 482 tests
= make check =
 
== Chunk 15 ==
 
pass, 491 tests
 
== Chunk 16 ==
 
pass, 7163 tests
 
== Chunk 17 ==
 
pass, 573 tests (sloooooooooow to run)
 
== Chunk 18 ==
 
pass, 5073 tests
 
== Chunk 19 ==
 
pass, 89415 tests
 
* bent: I fixed test_pluginstream_newstream.html so that it will work, but the underlying cause is a change in our access denied exception messages, which needs to get fixed. Followup bug?
 
== Chunk 20 ==
 
pass, 17909 tests
 
= Mochichrome =
 
35 failing tests out of 13605, in these files:
 
<pre>
chrome://mochikit/content/chrome/js/src/xpconnect/tests/chrome/test_cows.xul
chrome://mochikit/content/chrome/js/src/xpconnect/tests/chrome/test_evalInSandbox.xul
-> add a function that the sandbox can call which forwards to getClassName
chrome://mochikit/content/chrome/js/src/xpconnect/tests/chrome/test_wrappers-2.xul
  -> enumeration?
</pre>


The first problem in test_cows.xul is simply that the error message isn't what's expected. I tried fixing this by calling DoThrowException, just like the existing XPCChromeObjectWrapper code did -- but strangely this caused the exception not to be readable at all. I can see why why the exception thrown by DoThrowException would be rewrapped so that the caller couldn't read it, but I don't understand why exceptions thrown by JS_ReportError aren't affected in the same way. --jto, 10/4/2010
Pass.


= Browserchrome =
= make jstestbrowser (jsreftest) =
 
Failures:
 
<pre>
chrome://mochikit/content/browser/toolkit/components/console/hudservice/tests/browser/browser_webconsole_netlogging.js
chrome://mochikit/content/browser/browser/components/sessionstore/test/browser/browser_461743.js
chrome://mochikit/content/browser/browser/components/privatebrowsing/test/browser/browser_privatebrowser_newwindow_stopcmd.js
chrome://mochikit/content/browser/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_forgetthissite.js
chrome://mochikit/content/browser/browser/components/preferences/tests/browser/browser_privacypane_1.js
chrome://mochikit/content/browser/browser/components/places/tests/browser/browser_sidebarpanels_click.js
chrome://mochikit/content/browser/browser/components/places/tests/browser/browser_library_middleclick.js
</pre>
 
= make check =


Passes
Pass.
Confirmed users
839

edits