VulpesOS/gaia/tests/jsmarionette/plugins/reflow_helper.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

39 lines
952 B
JavaScript
Executable file

'use strict';
/* global require, module */
/*
* You need the following pref for this to work.
* 'devtools.debugger.forbid-certified-apps': false
*
* And also the follow settings.
* 'devtools.overlay': true
* 'hud.reflows': true
*/
var fs = require('fs');
var atom = fs.readFileSync('./tests/atoms/reflow.js', {encoding: 'utf-8'});
var ReflowHelper = function(client) {
var chrome = client.scope({ context: 'chrome' });
chrome.executeScript(atom);
client.setContext('content');
this.startTracking = function(manifestURL) {
chrome.executeScript(function(url) {
window.MozReflowAtom.startTracking(url);
}, [manifestURL]);
};
this.stopTracking = function() {
chrome.executeScript(function() {
window.MozReflowAtom.stopTracking();
});
};
this.getCount = function() {
return chrome.executeScript(function() {
return window.MozReflowAtom.count;
});
};
};
module.exports = ReflowHelper;