зеркало из https://github.com/mozilla/gecko-dev.git
Bug 751739 - Scratchpad could identify itself; r=harth
This commit is contained in:
Родитель
dfea5c6e00
Коммит
fa2eb6dd91
|
@ -268,6 +268,7 @@ var Scratchpad = {
|
|||
this._contentSandbox = new Cu.Sandbox(contentWindow,
|
||||
{ sandboxPrototype: contentWindow, wantXrays: false,
|
||||
sandboxName: 'scratchpad-content'});
|
||||
this._contentSandbox.__SCRATCHPAD__ = this;
|
||||
|
||||
this._previousBrowserWindow = this.browserWindow;
|
||||
this._previousBrowser = this.gBrowser.selectedBrowser;
|
||||
|
@ -302,6 +303,7 @@ var Scratchpad = {
|
|||
this._chromeSandbox = new Cu.Sandbox(this.browserWindow,
|
||||
{ sandboxPrototype: this.browserWindow, wantXrays: false,
|
||||
sandboxName: 'scratchpad-chrome'});
|
||||
this._chromeSandbox.__SCRATCHPAD__ = this;
|
||||
addDebuggerToGlobal(this._chromeSandbox);
|
||||
|
||||
this._previousBrowserWindow = this.browserWindow;
|
||||
|
|
|
@ -41,6 +41,14 @@ function runTests()
|
|||
ok(!notificationBox.currentNotification,
|
||||
"there is no notification in content context");
|
||||
|
||||
let dsp = sp.contentSandbox.__SCRATCHPAD__;
|
||||
|
||||
ok(sp.contentSandbox.__SCRATCHPAD__,
|
||||
"there is a variable named __SCRATCHPAD__");
|
||||
|
||||
ok(sp.contentSandbox.__SCRATCHPAD__.editor,
|
||||
"scratchpad is actually an instance of Scratchpad");
|
||||
|
||||
sp.setText("window.foobarBug636725 = 'aloha';");
|
||||
|
||||
ok(!content.wrappedJSObject.foobarBug636725,
|
||||
|
@ -62,6 +70,12 @@ function runTests()
|
|||
isnot(contentMenu.getAttribute("checked"), "true",
|
||||
"content menuitem is not checked");
|
||||
|
||||
ok(sp.chromeSandbox.__SCRATCHPAD__,
|
||||
"there is a variable named __SCRATCHPAD__");
|
||||
|
||||
ok(sp.chromeSandbox.__SCRATCHPAD__.editor,
|
||||
"scratchpad is actually an instance of Scratchpad");
|
||||
|
||||
ok(notificationBox.currentNotification,
|
||||
"there is a notification in browser context");
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче