chrome-mock
Advanced tools
Comparing version 0.0.2 to 0.0.3
var ContextMenus = require('./chrome/ContextMenus'); | ||
var Runtime = require('./chrome/Runtime'); | ||
var Tabs = require('./chrome/Tabs'); | ||
@@ -12,2 +13,3 @@ module.exports = Chrome; | ||
this.runtime = new Runtime(this); | ||
this.tabs = new Tabs(this); | ||
} |
var Event = require('../Event'); | ||
var sinon = require('sinon'); | ||
@@ -11,3 +12,73 @@ module.exports = Runtime; | ||
this.chrome = chrome; | ||
this.onInstalled = new Event(); | ||
this.onStartup = new Event(); | ||
this.onInstalled = new Event(); | ||
this.onSuspend = new Event(); | ||
this.onSuspendCanceled = new Event(); | ||
this.onUpdateAvailable = new Event(); | ||
this.onBrowserUpdateAvailable = new Event(); | ||
this.onConnect = new Event(); | ||
this.onConnectExternal = new Event(); | ||
this.onMessage = new Event(); | ||
this.onMessageExternal = new Event(); | ||
this.onRestartRequired = new Event(); | ||
this.getBackgroundPage = sinon.spy(this.getBackgroundPage.bind(this)); | ||
this.getManifest = sinon.spy(this.getManifest.bind(this)); | ||
this.getURL = sinon.spy(this.getURL.bind(this)); | ||
this.reload = sinon.spy(this.reload.bind(this)); | ||
} | ||
/** | ||
* This will be defined during an API method callback | ||
* if there was an error. | ||
* @property {object} | ||
*/ | ||
Runtime.prototype.lastError = null; | ||
/** | ||
* The ID of the extension/app. | ||
* @property {string} | ||
*/ | ||
Runtime.prototype.id = 'xxxxxxxxxxxxxxxx'; | ||
/** | ||
* Retrieves the JavaScript 'window' object for the background page | ||
* running inside the current extension/app. If the background page | ||
* is an event page, the system will ensure it is loaded before | ||
* calling the callback. If there is no background page, an error | ||
* is set. | ||
* @param {function} callback | ||
*/ | ||
Runtime.prototype.getBackgroundPage = function (callback) { | ||
if (typeof callback === 'function') { | ||
callback({}); | ||
} | ||
}; | ||
/** | ||
* Returns details about the app or extension from the manifest. | ||
* The object returned is a serialization of the full manifest file. | ||
* @returns {object} The manifest details | ||
*/ | ||
Runtime.prototype.getManifest = function () { | ||
return { | ||
version: '0.0.1' | ||
}; | ||
}; | ||
/** | ||
* Converts a relative path within an app/extension install directory | ||
* to a fully-qualified URL. | ||
* @param {string} path A path to a resource within an app/extension | ||
* expressed relative to its install directory. | ||
* @returns {string} | ||
*/ | ||
Runtime.prototype.getURL = function (path) { | ||
return ['chrome://', this.id, '/', path].join(''); | ||
}; | ||
/** | ||
* Reloads the app or extension. | ||
*/ | ||
Runtime.prototype.reload = function () {}; |
{ | ||
"name": "chrome-mock", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"author": "Steven Foote & Seth McLaughlin", | ||
@@ -11,3 +11,4 @@ "license": "MIT", | ||
"require-dir": "^0.1.0", | ||
"sinon": "^1.10.3" | ||
"sinon": "^1.10.3", | ||
"rfile": "~1.0.0" | ||
}, | ||
@@ -32,4 +33,5 @@ "devDependencies": { | ||
"grunt-browserify": "~2.1.4", | ||
"load-grunt-tasks": "~0.6.0" | ||
"load-grunt-tasks": "~0.6.0", | ||
"ejs": "~1.0.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
268814
42
7083
3
19
1
6
+ Addedrfile@~1.0.0
+ Addedcallsite@1.0.0(transitive)
+ Addedresolve@0.3.1(transitive)
+ Addedrfile@1.0.0(transitive)