VulpesOS/gaia/apps/system/test/unit/mock_activity_window.js
OverSu b38dea0597 Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
2026-09-30 23:13:03 +02:00

60 lines
2 KiB
JavaScript
Executable file

'use strict';
(function(exports) {
var MockActivityWindowHelper = {
mInstances: [],
mLatest: null
};
var MockActivityWindow = function ActivityWindow(config) {
this.instanceID = 'mock-activity-' +
MockActivityWindowHelper.mInstances.length;
this.open = function() {};
this.close = function() {};
this.kill = function() {};
this.toggle = function() {};
this.ready = function() {};
this.isActive = function() {};
this.changeURL = function() {};
this.resize = function() {};
this.setVisible = function() {};
this.blur = function() {};
this.publish = function() {};
this.broadcast = function() {};
this.fadeIn = function() {};
this.fadeOut = function() {};
this.setOrientation = function() {};
this.focus = function() {};
this.blur = function() {};
this.debug = function() {};
this.waitForNextPaint = function() {};
this.forward = function() {};
this.canGoForward = function() {};
this.canGoBack = function() {};
this.back = function() {};
this.reload = function() {};
this.isFullScreen = function() {};
this.isHomescreen = false;
this.config = config;
this.origin = config.origin;
this.manifestURL = config.manifestURL;
this.manifest = config.manifest;
this.url = config.url;
this.element = document.createElement('div');
this.browser = {
element: document.createElement('iframe')
};
this.determineClosingRotationDegree = function() { return 0; };
this.isTransitioning = function() { return false; };
this.calibratedHeight = function() { return false; };
this.isOOP = function() { return true; };
this.isDead = function() { return false; };
MockActivityWindowHelper.mInstances.push(this);
MockActivityWindowHelper.mLatest = this;
};
MockActivityWindow.mTeardown = function() {
MockActivityWindowHelper.mInstances = [];
MockActivityWindowHelper.mLatest = null;
};
exports.MockActivityWindow = MockActivityWindow;
}(window));