mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-17 12:47:30 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
37
addon-sdk/source/test/addons/main/main.js
Normal file
37
addon-sdk/source/test/addons/main/main.js
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
'use strict';
|
||||
|
||||
const { setTimeout } = require('sdk/timers');
|
||||
|
||||
var mainStarted = false;
|
||||
|
||||
exports.main = function main(options, callbacks) {
|
||||
mainStarted = true;
|
||||
|
||||
let tests = {};
|
||||
|
||||
tests.testMainArguments = function(assert) {
|
||||
assert.ok(!!options, 'options argument provided to main');
|
||||
assert.ok('loadReason' in options, 'loadReason is in options provided by main');
|
||||
assert.equal(typeof callbacks.print, 'function', 'callbacks.print is a function');
|
||||
assert.equal(typeof callbacks.quit, 'function', 'callbacks.quit is a function');
|
||||
|
||||
// Re-enable when bug 1251664 is fixed
|
||||
//assert.equal(options.loadReason, 'install', 'options.loadReason is install');
|
||||
}
|
||||
|
||||
require('sdk/test/runner').runTestsFromModule({exports: tests});
|
||||
}
|
||||
|
||||
// this causes a fail if main does not start
|
||||
setTimeout(function() {
|
||||
if (mainStarted)
|
||||
return;
|
||||
|
||||
// main didn't start, fail..
|
||||
require("sdk/test/runner").runTestsFromModule({exports: {
|
||||
testFail: assert => assert.fail('Main did not start..')
|
||||
}});
|
||||
}, 500);
|
||||
5
addon-sdk/source/test/addons/main/package.json
Normal file
5
addon-sdk/source/test/addons/main/package.json
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"id": "test-main@jetpack",
|
||||
"main": "./main.js",
|
||||
"version": "0.0.1"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue