Bug 1515942 - Enable ESLint for gfx/ (manual fixes). r=kats

Differential Revision: https://phabricator.services.mozilla.com/D15206

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mark Banner 2018-12-27 09:45:01 +00:00
parent 4388f2968a
commit ce668e4afd
13 changed files with 61 additions and 67 deletions

View file

@ -20,10 +20,6 @@ docshell/test/mochitest/**
extensions/cookie/** extensions/cookie/**
extensions/spellcheck/** extensions/spellcheck/**
extensions/universalchardet/** extensions/universalchardet/**
gfx/layers/**
gfx/tests/browser/**
gfx/tests/chrome/**
gfx/tests/mochitest/**
image/** image/**
layout/** layout/**
modules/** modules/**

View file

@ -46,5 +46,11 @@ module.exports = {
"rules": { "rules": {
"mozilla/reject-importGlobalProperties": "off", "mozilla/reject-importGlobalProperties": "off",
} }
}, {
// TODO: Bug 1515949. Enable no-undef for gfx/
"files": "gfx/layers/apz/test/mochitest/**",
"rules": {
"no-undef": "off",
}
}] }]
}; };

View file

@ -1,3 +1,6 @@
// ownerGlobal isn't defined in content privileged windows.
/* eslint-disable mozilla/use-ownerGlobal */
// Utilities for synthesizing of native events. // Utilities for synthesizing of native events.
function getResolution() { function getResolution() {
@ -265,7 +268,7 @@ function* synthesizeNativeTouchSequences(aTarget, aPositions, aObserver = null,
// will be the last one we make, so that we can register aObserver on it. // will be the last one we make, so that we can register aObserver on it.
var lastNonNullValue = -1; var lastNonNullValue = -1;
var yields = 0; var yields = 0;
for (var i = 0; i < aPositions.length; i++) { for (let i = 0; i < aPositions.length; i++) {
if (aPositions[i] == null) { if (aPositions[i] == null) {
yields++; yields++;
continue; continue;
@ -273,7 +276,7 @@ function* synthesizeNativeTouchSequences(aTarget, aPositions, aObserver = null,
if (aPositions[i].length != aTouchIds.length) { if (aPositions[i].length != aTouchIds.length) {
throw "aPositions[" + i + "] did not have the expected number of positions; expected " + aTouchIds.length + " touch points but found " + aPositions[i].length; throw "aPositions[" + i + "] did not have the expected number of positions; expected " + aTouchIds.length + " touch points but found " + aPositions[i].length;
} }
for (var j = 0; j < aTouchIds.length; j++) { for (let j = 0; j < aTouchIds.length; j++) {
if (aPositions[i][j] != null) { if (aPositions[i][j] != null) {
lastNonNullValue = ((i - yields) * aTouchIds.length) + j; lastNonNullValue = ((i - yields) * aTouchIds.length) + j;
} }
@ -300,13 +303,13 @@ function* synthesizeNativeTouchSequences(aTarget, aPositions, aObserver = null,
// Iterate over the position data now, and generate the touches requested // Iterate over the position data now, and generate the touches requested
yields = 0; yields = 0;
for (var i = 0; i < aPositions.length; i++) { for (let i = 0; i < aPositions.length; i++) {
if (aPositions[i] == null) { if (aPositions[i] == null) {
yields++; yields++;
yield i; yield i;
continue; continue;
} }
for (var j = 0; j < aTouchIds.length; j++) { for (let j = 0; j < aTouchIds.length; j++) {
if (aPositions[i][j] == null) { if (aPositions[i][j] == null) {
// null means lift the finger // null means lift the finger
if (currentPositions[j] == null) { if (currentPositions[j] == null) {
@ -333,8 +336,7 @@ function* synthesizeNativeTouchSequences(aTarget, aPositions, aObserver = null,
// consumed to overcome the panning threshold. // consumed to overcome the panning threshold.
function synthesizeNativeTouchDrag(aTarget, aX, aY, aDeltaX, aDeltaY, aObserver = null, aTouchId = 0) { function synthesizeNativeTouchDrag(aTarget, aX, aY, aDeltaX, aDeltaY, aObserver = null, aTouchId = 0) {
var steps = Math.max(Math.abs(aDeltaX), Math.abs(aDeltaY)); var steps = Math.max(Math.abs(aDeltaX), Math.abs(aDeltaY));
var positions = new Array(); var positions = [[{ x: aX, y: aY }]];
positions.push([{ x: aX, y: aY }]);
for (var i = 1; i < steps; i++) { for (var i = 1; i < steps; i++) {
var dx = i * (aDeltaX / steps); var dx = i * (aDeltaX / steps);
var dy = i * (aDeltaY / steps); var dy = i * (aDeltaY / steps);

View file

@ -8,6 +8,9 @@
// we really want, but we can't express in directly in WebIDL.) // we really want, but we can't express in directly in WebIDL.)
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// getHitTestConfig() expects apz_test_native_event_utils.js to be loaded as well.
/* import-globals-from apz_test_native_event_utils.js */
function convertEntries(entries) { function convertEntries(entries) {
var result = {}; var result = {};
for (var i = 0; i < entries.length; ++i) { for (var i = 0; i < entries.length; ++i) {
@ -87,11 +90,11 @@ function buildApzcTree(paint) {
// so we invent a node that is the parent of all roots. // so we invent a node that is the parent of all roots.
// This 'root' does not correspond to an APZC. // This 'root' does not correspond to an APZC.
var root = {scrollId: -1, children: []}; var root = {scrollId: -1, children: []};
for (var scrollId in paint) { for (let scrollId in paint) {
paint[scrollId].children = []; paint[scrollId].children = [];
paint[scrollId].scrollId = scrollId; paint[scrollId].scrollId = scrollId;
} }
for (var scrollId in paint) { for (let scrollId in paint) {
var parentNode = null; var parentNode = null;
if ("hasNoParentWithSameLayersId" in paint[scrollId]) { if ("hasNoParentWithSameLayersId" in paint[scrollId]) {
parentNode = root; parentNode = root;
@ -298,7 +301,7 @@ function runSubtestsSeriallyInFreshWindows(aSubtests) {
SimpleTest.ok(false, "Subtest URL " + subtestUrl + " does not resolve. " + SimpleTest.ok(false, "Subtest URL " + subtestUrl + " does not resolve. " +
"Be sure it's present in the support-files section of mochitest.ini."); "Be sure it's present in the support-files section of mochitest.ini.");
reject(); reject();
return; return undefined;
} }
w.location = subtestUrl; w.location = subtestUrl;
return w; return w;
@ -335,6 +338,7 @@ async function waitUntilApzStable() {
// Sadly this helper function cannot reuse any code from other places because // Sadly this helper function cannot reuse any code from other places because
// it must be totally self-contained to be shipped over to the parent process. // it must be totally self-contained to be shipped over to the parent process.
/* eslint-env mozilla/frame-script */
function parentProcessFlush() { function parentProcessFlush() {
addMessageListener("apz-flush", function() { addMessageListener("apz-flush", function() {
ChromeUtils.import("resource://gre/modules/Services.jsm"); ChromeUtils.import("resource://gre/modules/Services.jsm");
@ -481,7 +485,7 @@ function runContinuation(testFunction) {
// The snapshot is returned in the form of a data URL. // The snapshot is returned in the form of a data URL.
function getSnapshot(rect) { function getSnapshot(rect) {
function parentProcessSnapshot() { function parentProcessSnapshot() {
addMessageListener("snapshot", function(rect) { addMessageListener("snapshot", function(parentRect) {
ChromeUtils.import("resource://gre/modules/Services.jsm"); ChromeUtils.import("resource://gre/modules/Services.jsm");
var topWin = Services.wm.getMostRecentWindow("navigator:browser"); var topWin = Services.wm.getMostRecentWindow("navigator:browser");
if (!topWin) { if (!topWin) {
@ -489,16 +493,18 @@ function getSnapshot(rect) {
} }
// reposition the rect relative to the top-level browser window // reposition the rect relative to the top-level browser window
rect = JSON.parse(rect); parentRect = JSON.parse(parentRect);
rect.x -= topWin.mozInnerScreenX; parentRect.x -= topWin.mozInnerScreenX;
rect.y -= topWin.mozInnerScreenY; parentRect.y -= topWin.mozInnerScreenY;
// take the snapshot // take the snapshot
var canvas = topWin.document.createElementNS("http://www.w3.org/1999/xhtml", "canvas"); var canvas = topWin.document.createElementNS("http://www.w3.org/1999/xhtml", "canvas");
canvas.width = rect.w; canvas.width = parentRect.w;
canvas.height = rect.h; canvas.height = parentRect.h;
var ctx = canvas.getContext("2d"); var ctx = canvas.getContext("2d");
ctx.drawWindow(topWin, rect.x, rect.y, rect.w, rect.h, "rgb(255,255,255)", ctx.DRAWWINDOW_DRAW_VIEW | ctx.DRAWWINDOW_USE_WIDGET_LAYERS | ctx.DRAWWINDOW_DRAW_CARET); ctx.drawWindow(topWin, parentRect.x, parentRect.y, parentRect.w, parentRect.h,
"rgb(255,255,255)",
ctx.DRAWWINDOW_DRAW_VIEW | ctx.DRAWWINDOW_USE_WIDGET_LAYERS | ctx.DRAWWINDOW_DRAW_CARET);
return canvas.toDataURL(); return canvas.toDataURL();
}); });
} }

View file

@ -53,7 +53,7 @@ function* test(testDriver) {
var subframeViewId = config.utils.getViewId(subframe); var subframeViewId = config.utils.getViewId(subframe);
var {hitInfo, scrollId} = hitTest(centerOf(subframe)); var {scrollId} = hitTest(centerOf(subframe));
is(scrollId, subframeViewId, is(scrollId, subframeViewId,
"hit the scroll frame behind the backface-visibility:hidden element"); "hit the scroll frame behind the backface-visibility:hidden element");

View file

@ -15,7 +15,6 @@
function* test(testDriver) { function* test(testDriver) {
var iframe = document.getElementById("scroll"); var iframe = document.getElementById("scroll");
var iframeWindow = iframe.contentWindow; var iframeWindow = iframe.contentWindow;
var iframeContent = iframeWindow.document.documentElement;
// scroll the iframe to the bottom, such that a subsequent scroll on it // scroll the iframe to the bottom, such that a subsequent scroll on it
// _would_ hand off to the page if overscroll-behavior allowed it // _would_ hand off to the page if overscroll-behavior allowed it

View file

@ -30,6 +30,7 @@ function listener(callback) {
// (in JSON string format) containing the counters. // (in JSON string format) containing the counters.
// The 'end' invocation tears down the listeners, and should be invoked once // The 'end' invocation tears down the listeners, and should be invoked once
// at the end to clean up. Returns true on success, false on failure. // at the end to clean up. Returns true on success, false on failure.
/* eslint-env mozilla/frame-script */
function chromeTouchEventCounter(operation) { function chromeTouchEventCounter(operation) {
function chromeProcessCounter() { function chromeProcessCounter() {
addMessageListener("start", function() { addMessageListener("start", function() {
@ -181,7 +182,7 @@ function* test(testDriver) {
var scroller = document.getElementById("scroller"); var scroller = document.getElementById("scroller");
synthesizeNativeTouch(scroller, 10, 110, SpecialPowers.DOMWindowUtils.TOUCH_CONTACT, null, 0); synthesizeNativeTouch(scroller, 10, 110, SpecialPowers.DOMWindowUtils.TOUCH_CONTACT, null, 0);
RunAfterProcessedQueuedInputEvents(testDriver); RunAfterProcessedQueuedInputEvents(testDriver);
for (var i = 1; i < 10; i++) { for (let i = 1; i < 10; i++) {
synthesizeNativeTouch(scroller, 10, 110 - (i * 10), SpecialPowers.DOMWindowUtils.TOUCH_CONTACT, null, 0); synthesizeNativeTouch(scroller, 10, 110 - (i * 10), SpecialPowers.DOMWindowUtils.TOUCH_CONTACT, null, 0);
RunAfterProcessedQueuedInputEvents(testDriver); RunAfterProcessedQueuedInputEvents(testDriver);
} }
@ -200,7 +201,7 @@ function* test(testDriver) {
ok(waitFor("touchstart", 1), "Touchstart processed in chrome process"); ok(waitFor("touchstart", 1), "Touchstart processed in chrome process");
// Loop through the touchmove events // Loop through the touchmove events
for (var i = 1; i < 10; i++) { for (let i = 1; i < 10; i++) {
yield; yield;
ok(waitFor("touchmove", i), "Touchmove processed in chrome process"); ok(waitFor("touchmove", i), "Touchmove processed in chrome process");

View file

@ -79,10 +79,9 @@ document.getElementById("scrollbox").addEventListener("wheel", function(e) {
function* test(testDriver) { function* test(testDriver) {
var content = document.getElementById("content"); var content = document.getElementById("content");
for (i = 0; i < 300; i++) { // enough iterations that we would scroll to the bottom of 'content' for (let i = 0; i < 300; i++) { // enough iterations that we would scroll to the bottom of 'content'
yield synthesizeNativeWheelAndWaitForWheelEvent(content, 100, 150, 0, -5, testDriver); yield synthesizeNativeWheelAndWaitForWheelEvent(content, 100, 150, 0, -5, testDriver);
} }
var scrollbox = document.getElementById("scrollbox");
is(content.scrollTop > 0, true, "We should have scrolled down somewhat"); is(content.scrollTop > 0, true, "We should have scrolled down somewhat");
is(content.scrollTop < content.scrollTopMax, true, "We should not have scrolled to the bottom of the scrollframe"); is(content.scrollTop < content.scrollTopMax, true, "We should not have scrolled to the bottom of the scrollframe");
is(rotationAdjusted, true, "The rotation should have been adjusted"); is(rotationAdjusted, true, "The rotation should have been adjusted");

View file

@ -70,11 +70,9 @@ function parseDisplayList(lines) {
// the content node name doesn't have a prefix, this makes the parsing easier // the content node name doesn't have a prefix, this makes the parsing easier
rest = "content" + rest; rest = "content" + rest;
var fields = {};
var nesting = 0; var nesting = 0;
var startIndex; var startIndex;
var lastSpace = -1; var lastSpace = -1;
var lastFieldStart = -1;
for (var j = 0; j < rest.length; j++) { for (var j = 0; j < rest.length; j++) {
if (rest.charAt(j) == "(") { if (rest.charAt(j) == "(") {
nesting++; nesting++;
@ -141,7 +139,10 @@ function getDataURI(str) {
var ctxt = canvas.getContext("2d"); var ctxt = canvas.getContext("2d");
var out = ctxt.createImageData(w, h); var out = ctxt.createImageData(w, h);
buffer = LZ4_uncompressChunk(bytes, decoded); // This is actually undefined throughout the tree and it isn't clear what it
// should be. Since this is only development code, leave it alone for now.
// eslint-disable-next-line no-undef
LZ4_uncompressChunk(bytes, decoded);
for (var x = 0; x < w; x++) { for (var x = 0; x < w; x++) {
for (var y = 0; y < h; y++) { for (var y = 0; y < h; y++) {
@ -252,11 +253,11 @@ function parseLayers(layersDumpLines) {
var tileMatches = line.match("(\\s*)Tile \\(x=(.*), y=(.*)\\): (.*)"); var tileMatches = line.match("(\\s*)Tile \\(x=(.*), y=(.*)\\): (.*)");
if (tileMatches) { if (tileMatches) {
var indentation = Math.floor(matches[1].length / 2); let indentation = Math.floor(matches[1].length / 2);
var x = tileMatches[2]; var x = tileMatches[2];
var y = tileMatches[3]; var y = tileMatches[3];
var dataUri = tileMatches[4]; var dataUri = tileMatches[4];
var parent = objectAtIndentation[indentation - 1]; let parent = objectAtIndentation[indentation - 1];
var tiles = parent.tiles || {}; var tiles = parent.tiles || {};
tiles[x] = tiles[x] || {}; tiles[x] = tiles[x] || {};
@ -269,8 +270,8 @@ function parseLayers(layersDumpLines) {
var surfaceMatches = line.match("(\\s*)Surface: (.*)"); var surfaceMatches = line.match("(\\s*)Surface: (.*)");
if (surfaceMatches) { if (surfaceMatches) {
var indentation = Math.floor(matches[1].length / 2); let indentation = Math.floor(matches[1].length / 2);
var parent = objectAtIndentation[indentation - 1] || objectAtIndentation[indentation - 2]; let parent = objectAtIndentation[indentation - 1] || objectAtIndentation[indentation - 2];
var surfaceURI = surfaceMatches[2]; var surfaceURI = surfaceMatches[2];
if (parent.surfaceURI != null) { if (parent.surfaceURI != null) {
@ -280,7 +281,7 @@ function parseLayers(layersDumpLines) {
// Look for the buffer-rect offset // Look for the buffer-rect offset
var contentHostLine = layersDumpLines[i - 2].name || layersDumpLines[i - 2]; var contentHostLine = layersDumpLines[i - 2].name || layersDumpLines[i - 2];
var matches = contentHostLine.match(LAYERS_LINE_REGEX); let matches = contentHostLine.match(LAYERS_LINE_REGEX);
if (matches) { if (matches) {
var contentHostRest = matches[4]; var contentHostRest = matches[4];
parent.contentHostProp = {}; parent.contentHostProp = {};
@ -298,7 +299,7 @@ function parseLayers(layersDumpLines) {
root = layerObject; root = layerObject;
} }
var matches = line.match(LAYERS_LINE_REGEX); let matches = line.match(LAYERS_LINE_REGEX);
if (!matches) { if (!matches) {
continue; // Something like a texturehost dump. Safe to ignore continue; // Something like a texturehost dump. Safe to ignore
} }
@ -335,7 +336,7 @@ function parseLayers(layersDumpLines) {
var fields = []; var fields = [];
var nesting = 0; var nesting = 0;
var startIndex; var startIndex;
for (var j = 0; j < rest.length; j++) { for (let j = 0; j < rest.length; j++) {
if (rest.charAt(j) == "[") { if (rest.charAt(j) == "[") {
nesting++; nesting++;
if (nesting == 1) { if (nesting == 1) {
@ -349,13 +350,13 @@ function parseLayers(layersDumpLines) {
} }
} }
for (var j = 0; j < fields.length; j++) { for (let j = 0; j < fields.length; j++) {
// Something like 'valid=< (x=0, y=0, w=1920, h=2218); >' or 'opaqueContent' // Something like 'valid=< (x=0, y=0, w=1920, h=2218); >' or 'opaqueContent'
var field = fields[j]; var field = fields[j];
// dump("FIELD: " + field + "\n"); // dump("FIELD: " + field + "\n");
var parts = field.split("=", 2); var parts = field.split("=", 2);
var fieldName = parts[0]; var fieldName = parts[0];
var rest = field.substring(fieldName.length + 1); rest = field.substring(fieldName.length + 1);
if (parts.length == 1) { if (parts.length == 1) {
layerObject[fieldName] = "true"; layerObject[fieldName] = "true";
layerObject[fieldName].type = "bool"; layerObject[fieldName].type = "bool";
@ -446,7 +447,7 @@ function populateLayers(root, displayList, pane, previewParent, hasSeenRoot, con
} }
for (var i = 0; i < displayList.children.length; i++) { for (var i = 0; i < displayList.children.length; i++) {
var subDisplayItems = getDisplayItemForLayer(displayList.children[i]); var subDisplayItems = getDisplayItemForLayer(displayList.children[i]);
for (var j = 0; j < subDisplayItems.length; j++) { for (let j = 0; j < subDisplayItems.length; j++) {
items.push(subDisplayItems[j]); items.push(subDisplayItems[j]);
} }
} }
@ -521,7 +522,7 @@ function populateLayers(root, displayList, pane, previewParent, hasSeenRoot, con
}); });
layerViewportMatrix[4] += -clip[0]; layerViewportMatrix[4] += -clip[0];
layerViewportMatrix[5] += -clip[1]; layerViewportMatrix[5] += -clip[1];
layerViewport.style.transform = "translate(-" + clip[0] + "px, -" + clip[1] + "px" + ")"; layerViewport.style.transform = "translate(-" + clip[0] + "px, -" + clip[1] + "px)";
} }
if (root["shadow-transform"] || root.transform) { if (root["shadow-transform"] || root.transform) {
var matrix = root["shadow-transform"] || root.transform; var matrix = root["shadow-transform"] || root.transform;
@ -544,8 +545,8 @@ function populateLayers(root, displayList, pane, previewParent, hasSeenRoot, con
previewParent.appendChild(layerViewport); previewParent.appendChild(layerViewport);
} }
previewParent = layerViewport; previewParent = layerViewport;
for (var i = 0; i < visibleRegion.length; i++) { for (let i = 0; i < visibleRegion.length; i++) {
var rect2d = visibleRegion[i]; let rect2d = visibleRegion[i];
var layerPreview = createElement("div", { var layerPreview = createElement("div", {
id: root.address + "_visible_part" + i + "-" + visibleRegion.length, id: root.address + "_visible_part" + i + "-" + visibleRegion.length,
className: "layerPreview", className: "layerPreview",
@ -629,7 +630,7 @@ function populateLayers(root, displayList, pane, previewParent, hasSeenRoot, con
} }
var layerDisplayItems = getDisplayItemForLayer(displayList); var layerDisplayItems = getDisplayItemForLayer(displayList);
for (var i = 0; i < layerDisplayItems.length; i++) { for (let i = 0; i < layerDisplayItems.length; i++) {
var displayItem = layerDisplayItems[i]; var displayItem = layerDisplayItems[i];
var displayElem = createElement("div", { var displayElem = createElement("div", {
className: "layerObjectDescription", className: "layerObjectDescription",
@ -666,7 +667,6 @@ function populateLayers(root, displayList, pane, previewParent, hasSeenRoot, con
} }
var box = this.diPreview.getBoundingClientRect(); var box = this.diPreview.getBoundingClientRect();
var pageBox = document.body.getBoundingClientRect();
this.diPreview.tooltip = createElement("div", { this.diPreview.tooltip = createElement("div", {
className: "csstooltip", className: "csstooltip",
innerHTML: description, innerHTML: description,
@ -687,7 +687,7 @@ function populateLayers(root, displayList, pane, previewParent, hasSeenRoot, con
}, },
}); });
var icon = createElement("img", { icon = createElement("img", {
style: { style: {
width: "12px", width: "12px",
height: "12px", height: "12px",
@ -699,10 +699,10 @@ function populateLayers(root, displayList, pane, previewParent, hasSeenRoot, con
pane.appendChild(displayElem); pane.appendChild(displayElem);
// bounds doesn't adjust for within the layer. It's not a bad fallback but // bounds doesn't adjust for within the layer. It's not a bad fallback but
// will have the wrong offset // will have the wrong offset
var rect2d = displayItem.layerBounds || displayItem.bounds; let rect2d = displayItem.layerBounds || displayItem.bounds;
if (rect2d) { // This doesn't place them corectly if (rect2d) { // This doesn't place them corectly
var appUnitsToPixels = 60 / contentScale; var appUnitsToPixels = 60 / contentScale;
diPreview = createElement("div", { let diPreview = createElement("div", {
id: "displayitem_" + displayItem.content + "_" + displayItem.address, id: "displayitem_" + displayItem.content + "_" + displayItem.address,
className: "layerPreview", className: "layerPreview",
style: { style: {
@ -736,8 +736,6 @@ function populateLayers(root, displayList, pane, previewParent, hasSeenRoot, con
// This function takes a stdout snippet and finds the frames // This function takes a stdout snippet and finds the frames
function parseMultiLineDump(log) { function parseMultiLineDump(log) {
var lines = log.split("\n");
var container = createElement("div", { var container = createElement("div", {
style: { style: {
height: "100%", height: "100%",
@ -874,11 +872,3 @@ function parseDump(log, displayList, compositeTitle, compositeTime) {
populateLayers(root, displayList, layerListPane, previewDiv); populateLayers(root, displayList, layerListPane, previewDiv);
return container; return container;
} }
function tab_showLayersDump(layersDumpLines, compositeTitle, compositeTime) {
var container = parseDump(layersDumpLines, compositeTitle, compositeTime);
gTabWidget.addTab("LayerTree", container);
gTabWidget.selectTab("LayerTree");
}

View file

@ -14,11 +14,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1274663
<script> <script>
var importObj = {}; var importObj = {};
var Cc = SpecialPowers.Cc;
var Ci = SpecialPowers.Ci;
var sysInfo = Cc["@mozilla.org/system-info;1"].getService(Ci.nsIPropertyBag2); var sysInfo = Cc["@mozilla.org/system-info;1"].getService(Ci.nsIPropertyBag2);
var xr = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime);
var windows = SpecialPowers.Services.ww.getWindowEnumerator(); var windows = SpecialPowers.Services.ww.getWindowEnumerator();
var windowutils; var windowutils;

View file

@ -29,7 +29,7 @@ function runTest() {
var Ci = SpecialPowers.Ci; var Ci = SpecialPowers.Ci;
var sysInfo = Cc["@mozilla.org/system-info;1"].getService(Ci.nsIPropertyBag2); var sysInfo = Cc["@mozilla.org/system-info;1"].getService(Ci.nsIPropertyBag2);
var xr = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime); var xr = SpecialPowers.Services.appinfo;
var windows = SpecialPowers.Services.ww.getWindowEnumerator(); var windows = SpecialPowers.Services.ww.getWindowEnumerator();
var windowutils; var windowutils;

View file

@ -31,9 +31,7 @@ text.style.fontFamily = "sans-serif";
flush(); flush();
// flush cache // flush cache
var os = SpecialPowers.Cc["@mozilla.org/observer-service;1"] SpecialPowers.Services.obs.notifyObservers(null, "memory-pressure", "heap-minimize");
.getService(SpecialPowers.Ci.nsIObserverService);
os.notifyObservers(null, "memory-pressure", "heap-minimize");
// reuse font that was flushed from cache // reuse font that was flushed from cache
text.style.fontFamily = "monospace"; text.style.fontFamily = "monospace";

View file

@ -25,6 +25,7 @@ const simpleTestFiles = [
"MockObjects.js", "MockObjects.js",
"SimpleTest.js", "SimpleTest.js",
"WindowSnapshot.js", "WindowSnapshot.js",
"paint_listener.js",
]; ];
const simpleTestPath = "testing/mochitest/tests/SimpleTest"; const simpleTestPath = "testing/mochitest/tests/SimpleTest";