forked from rnewman/services-central-old
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 735280 - Part 3: Components object specific wrapper. r=bholley
- Loading branch information
Showing
11 changed files
with
136 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
function run_test() { | ||
var Cu = Components.utils; | ||
var sb1 = Cu.Sandbox("http://www.blah.com"); | ||
var sb2 = Cu.Sandbox("http://www.blah.com"); | ||
var sb3 = Cu.Sandbox(this); | ||
var sb4 = Cu.Sandbox("http://www.other.com"); | ||
var rv; | ||
|
||
// non-chrome accessing chrome Components | ||
sb1.C = Components; | ||
rv = Cu.evalInSandbox("C.utils", sb1); | ||
do_check_eq(rv, undefined); | ||
rv = Cu.evalInSandbox("C.interfaces", sb1); | ||
do_check_neq(rv, undefined); | ||
|
||
// non-chrome accessing own Components | ||
rv = Cu.evalInSandbox("Components.utils", sb1); | ||
do_check_eq(rv, undefined); | ||
rv = Cu.evalInSandbox("Components.interfaces", sb1); | ||
do_check_neq(rv, undefined); | ||
|
||
// non-chrome same origin | ||
var C2 = Cu.evalInSandbox("Components", sb2); | ||
do_check_neq(rv, C2.utils); | ||
sb1.C2 = C2; | ||
rv = Cu.evalInSandbox("C2.utils", sb1); | ||
do_check_eq(rv, undefined); | ||
rv = Cu.evalInSandbox("C2.interfaces", sb1); | ||
do_check_neq(rv, undefined); | ||
|
||
// chrome accessing chrome | ||
sb3.C = Components; | ||
rv = Cu.evalInSandbox("C.utils", sb3); | ||
do_check_eq(rv, Cu); | ||
|
||
// non-chrome cross origin | ||
sb4.C2 = C2; | ||
rv = Cu.evalInSandbox("C2.interfaces", sb1); | ||
do_check_neq(rv, undefined); | ||
rv = Cu.evalInSandbox("C2.utils", sb1); | ||
do_check_eq(rv, undefined); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,3 +25,4 @@ fail-if = os == "android" | |
[test_unload.js] | ||
[test_attributes.js] | ||
[test_params.js] | ||
[test_components.js] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters