Bug 718733 - Allow JSAPI tests to create compartments with principals. r=jorendorff
authorBlake Kaplan <mrbkap@gmail.com>
Tue, 17 Jan 2012 19:40:14 +0100
changeset 86697 04af5f29e0bff8da8ec48b82b0d0d003045deb68
parent 86696 8085a3fff93c00d655cafa394461174934a0c1e0
child 86698 ba57f7b6a2f3ed4202de5a6ce81ebc67dfd48cb2
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs718733
milestone12.0a1
Bug 718733 - Allow JSAPI tests to create compartments with principals. r=jorendorff
js/src/jsapi-tests/tests.h
--- a/js/src/jsapi-tests/tests.h
+++ b/js/src/jsapi-tests/tests.h
@@ -379,19 +379,19 @@ class JSAPITest
         JS_SetErrorReporter(cx, &reportError);
         return cx;
     }
 
     virtual JSClass * getGlobalClass() {
         return basicGlobalClass();
     }
 
-    virtual JSObject * createGlobal() {
+    virtual JSObject * createGlobal(JSPrincipals *principals = NULL) {
         /* Create the global object. */
-        JSObject *global = JS_NewCompartmentAndGlobalObject(cx, getGlobalClass(), NULL);
+        JSObject *global = JS_NewCompartmentAndGlobalObject(cx, getGlobalClass(), principals);
         if (!global)
             return NULL;
 
         JSAutoEnterCompartment ac;
         if (!ac.enter(cx, global))
             return NULL;
 
         /* Populate the global object with the standard globals,