diff options
author | Daniel Narvaez <dwnarvaez@gmail.com> | 2013-02-06 13:49:14 (GMT) |
---|---|---|
committer | Daniel Narvaez <dwnarvaez@gmail.com> | 2013-02-06 13:49:14 (GMT) |
commit | 821413607a0718156f9d25d895e89b1c3d37aa8b (patch) | |
tree | 01c285af734ed5bba64b73b489e1e0226a94a262 /apps/system/test/unit/mock_applications.js | |
parent | c110fb485b3af0066c6df7aeac8c055e9d767efa (diff) |
Copy various bits from gaia
Diffstat (limited to 'apps/system/test/unit/mock_applications.js')
-rw-r--r-- | apps/system/test/unit/mock_applications.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/apps/system/test/unit/mock_applications.js b/apps/system/test/unit/mock_applications.js new file mode 100644 index 0000000..8b3e765 --- /dev/null +++ b/apps/system/test/unit/mock_applications.js @@ -0,0 +1,26 @@ +var MockApplications = (function() { + var mockApps = {}; + + function getByManifestURL(url) { + return mockApps[url]; + } + + function mRegisterMockApp(mockApp) { + mockApps[mockApp.manifestURL] = mockApp; + } + + function mUnregisterMockApp(mockApp) { + mockApps[mockApp.manifestURL] = null; + } + + function mTeardown() { + mockApps = {}; + } + + return { + getByManifestURL: getByManifestURL, + mRegisterMockApp: mRegisterMockApp, + mUnregisterMockApp: mUnregisterMockApp, + mTeardown: mTeardown + }; +})(); |