Platform/JS Compartments Mochitest: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
 
(124 intermediate revisions by 7 users not shown)
Line 12: Line 12:


Then go into .hg/patches and hg pull, hg up and then go back to ../../ and do hg qpush -a. Build. Every time we update the queue you have to do qpop -a in the repository, then pull and update the patch queue, and then go back and do qpush -a to get the patches applied again.
Then go into .hg/patches and hg pull, hg up and then go back to ../../ and do hg qpush -a. Build. Every time we update the queue you have to do qpop -a in the repository, then pull and update the patch queue, and then go back and do qpush -a to get the patches applied again.
= Known issues still being worked on =
= QA =
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 17: Line 28:
== default compartment leaks ==
== default compartment leaks ==


bug 599761 (_newJSDContext), landed
=== todo ===
 
=== done ===


bug 599762 (js::ctypes::CClosure::ClosureStub), landed
bug 599761 (_newJSDContext)


bug 600022 (XPCShellEnvironment::Init()), landed
bug 599762 (js::ctypes::CClosure::ClosureStub)


bug 600032 (JetpackChild::Init()), landed
bug 600022 (XPCShellEnvironment::Init())


bug 600173 (atoms should always be in the default compartment), ready to land
bug 600032 (JetpackChild::Init())


bug 600402 (don't copy strings for the same compartment), patch in bug
bug 600173 (atoms should always be in the default compartment)


bug 600580 (_newJSDContext, part 2), backed out, fixed, landed
bug 600580 (_newJSDContext, part 2)
 
bug 600402 (don't copy strings for the same compartment)


= 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 ==


* XPCSafeJSObjectWrapper::WrapObject() fails
Post b7:
  -> remove XPCSafeJSObjectWrapper
* document.domain (we currently don't revoke access to the document's original domain, we probably should do that).
* XPCNW holder objects vs JS_ClearScope()
  -> In nsJSEnvironment.cpp call JS_ClearScope on wrapper->getProxyExtra()
* Fix up XrayWrappers
* IndexedDB and DOM worker tests, need cross compartment structured clone (jorendorff/bent)
 
Minor
* Error hacks?
* Error hacks?
* 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.
* We no longer support .wrappedJSObject on location and XMLHttpRequest. Confirm that it was ok to remove those from tests/js/src/xpconnect/tests/mochitest/test_bug553407.html.


FIXED issues:
FIXED issues:
* I allow named frames to be created on xray wrappers so parent[name] works.
* Fix up XrayWrappers
* Make chrome wrappers expose nothing by default
* Make chrome wrappers expose nothing by default
* added scriptOnly check to chrome object and make all XOWs script only
* added scriptOnly check to chrome object and make all XOWs script only
Line 55: Line 69:
* DocShell navigation tests
* DocShell navigation tests
* XPCNativeWrapper.unwrap() different compartments
* XPCNativeWrapper.unwrap() different compartments
* IndexedDB and DOM worker tests, need cross compartment structured clone (jorendorff/bent)
* XPCNW holder objects vs JS_ClearScope()


failing tests:
== Remaining test failures ==


<pre>
<pre>
http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/test_updatingManifest.html
http://mochi.test:8888/tests/dom/tests/mochitest/bugs/test_bug396843.html
http://mochi.test:8888/tests/dom/src/tests/threads/test/test_json.html (crash in js engine code)
http://mochi.test:8888/tests/content/base/test/test_bug574596.html
</pre>
</pre>


assert-to-death tests:
Asserts to death:


<pre>
<pre>
/tests/toolkit/components/passwordmgr/test/test_basic_form_observer_autofillForms.html
/tests/toolkit/components/passwordmgr/test/test_basic_form_observer_foundLogins.html
</pre>
</pre>


Make chrome tests:
= Mochichrome =


<pre>
<pre>
[TODO] http://mochi.test:8888/tests/js/src/xpconnect/tests/mochitest/test_cows.html
[Done] /tests/js/src/xpconnect/tests/mochitest/test_bug484459.html (XPCSafeJSObjectWrapper)
[Done but real failures] /tests/js/src/xpconnect/tests/mochitest/test_wrappers.html (XPCSafeJSObjectWrapper)
</pre>
</pre>


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


pass, 22848 tests
Lots of different issues:


== Chunk 2 ==
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"


pass
Enumeration bug. "for (e in location)" doesn't walk the prototype chain.


== Chunk 3 ==
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"


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


== Chunk 4 ==
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"


pass, 19244 tests
Enumeration bug. Same kind of problem but here we're trying to iterate over iwin.wrappedObject.location.
== Chunk 5 ==


pass, with the exception of the tests listed above (two worker tests).
7268 ERROR TEST-UNEXPECTED-FAIL | chrome://mochikit/content/chrome/js/src/xpconnect/tests/chrome/test_wrappers-2.xul | cyclic proto value allowed


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


fail, 4701 tests. 12 failures, all listed up top.
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 7 ==
iwin.eval("'PASS'") is supposed to succeed, but iwin.eval is undefined.


pass, 194 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 8 ==
An old feature we didn't retain.  XPCNativeWrapper("") is expected to return
"". Maybe we can just remove the test.


pass, 346 tests
7276 ERROR TEST-UNEXPECTED-FAIL | chrome://mochikit/content/chrome/js/src/xpconnect/tests/chrome/test_wrappers-2.xul | XPCNativeWrappers allow expandos through
== Chunk 9 ==
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, 159 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 10 ==
I think the basic story here is "there are no same-compartment X-ray wrappers".


pass, 396 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 11 ==
Possibly just noise. If I comment out the cyclic-__proto__ test, this one
passes.


pass, 234 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 12 ==
-jorendorff, 10/5/2010


pass, ~300ish tests
= Browserchrome =


== Chunk 13 ==
Pass.


pass, 458 tests
= make check =


== Chunk 14 ==
Pass.


pass, 482 tests
= make jstestbrowser (jsreftest) =


== Chunk 15 ==
Pass.
 
pass, 491 tests
 
== Chunk 16 ==
 
gets stuck on test_postMessage.html. Used to pass :(
 
== Chunk 17 ==
 
pass, 573 tests (sloooooooooow to run)
 
== Chunk 18 ==
 
pass, 5073 tests
 
== Chunk 19 ==
 
pass
 
== Chunk 20 ==
 
pass, 17850 tests, with the exception of the passwrd manager failures listed up top.
 
= Mochichrome =
 
35 failing tests, in these files:
 
<pre>
chrome://mochikit/content/chrome/docshell/test/chrome/test_bug454235.xul
chrome://mochikit/content/chrome/js/src/xpconnect/tests/chrome/test_bug500931.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/layout/base/test/chrome/test_printpreview.xul
chrome://mochikit/content/chrome/toolkit/content/tests/chrome/test_browser_drop.xul
chrome://mochikit/content/chrome/widget/tests/test_input_events_on_deactive_window.xul
</pre>
 
= Browserchrome =

Latest revision as of 02:10, 14 October 2010

This page is a tracking page for getting the JS compartments work to pass xpcshell tests and Mochitests and other automated test suites.

How to get the patch queue

Install hg queues.

Then add to .hg/patches/.hg/hgrc

[paths]

default = http://hg.mozilla.org/users/mrbkap_mozilla.com/brain-transplants

Then go into .hg/patches and hg pull, hg up and then go back to ../../ and do hg qpush -a. Build. Every time we update the queue you have to do qpop -a in the repository, then pull and update the patch queue, and then go back and do qpush -a to get the patches applied again.

Known issues still being worked on

QA

Started build for QA to test.

Fixed:

  • Adblock doesn't seem to filter (tries to call a function on undefined).
  • Adblock crashes.

xpcshell

default compartment leaks

todo

done

bug 599761 (_newJSDContext)

bug 599762 (js::ctypes::CClosure::ClosureStub)

bug 600022 (XPCShellEnvironment::Init())

bug 600032 (JetpackChild::Init())

bug 600173 (atoms should always be in the default compartment)

bug 600580 (_newJSDContext, part 2)

bug 600402 (don't copy strings for the same compartment)

Mochitest

Pass.

Remaining large-ish items

Post b7:

  • document.domain (we currently don't revoke access to the document's original domain, we probably should do that).
  • Error hacks?
  • 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.
  • We no longer support .wrappedJSObject on location and XMLHttpRequest. Confirm that it was ok to remove those from tests/js/src/xpconnect/tests/mochitest/test_bug553407.html.

FIXED issues:

  • I allow named frames to be created on xray wrappers so parent[name] works.
  • Fix up XrayWrappers
  • Make chrome wrappers expose nothing by default
  • added scriptOnly check to chrome object and make all XOWs script only
  • Location object
  • nsJSContext::BindCompiledEventHandler(), target and funobj from
  • Components.utils.import() from non-chrome code.
  • DocShell navigation tests
  • XPCNativeWrapper.unwrap() different compartments
  • IndexedDB and DOM worker tests, need cross compartment structured clone (jorendorff/bent)
  • XPCNW holder objects vs JS_ClearScope()

Remaining test failures


Asserts to death:


Mochichrome


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

Lots of different issues:

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"

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

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"

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

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"

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

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

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

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

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

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'

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

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");

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

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

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

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

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.

-jorendorff, 10/5/2010

Browserchrome

Pass.

make check

Pass.

make jstestbrowser (jsreftest)

Pass.