mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 893222 - Part 4: Tests. r=njn
This commit is contained in:
parent
fb5630ed11
commit
da6fd4c99d
@ -52,6 +52,26 @@
|
||||
let isImagesPresent = false;
|
||||
let isXptiWorkingSetPresent = false;
|
||||
let isAtomTablePresent = false;
|
||||
let isBigStringPresent = false;
|
||||
let isSmallString1Present = false;
|
||||
let isSmallString2Present = false;
|
||||
|
||||
// Generate a long, random string. We'll check that this string is
|
||||
// reported in at least one of the memory reporters.
|
||||
let bigString = "";
|
||||
while (bigString.length < 10000) {
|
||||
bigString += Math.random();
|
||||
}
|
||||
let bigStringPrefix = bigString.substring(0, 100);
|
||||
|
||||
// Generate many copies of two distinctive short strings, "!)(*&" and
|
||||
// "@)(*&". We'll check that these strings are reported in at least
|
||||
// one of the memory reporters.
|
||||
let shortStrings = [];
|
||||
for (let i = 0; i < 10000; i++) {
|
||||
let str = (Math.random() > 0.5 ? "!" : "@") + ")(*&";
|
||||
shortStrings.push(str);
|
||||
}
|
||||
|
||||
let mySandbox = Components.utils.Sandbox(document.nodePrincipal,
|
||||
{ sandboxName: "this-is-a-sandbox-name" });
|
||||
@ -87,6 +107,12 @@
|
||||
// A system compartment with a location (such as a sandbox) should
|
||||
// show that location.
|
||||
isSandboxLocationShown = true;
|
||||
} else if (aPath.contains(bigStringPrefix)) {
|
||||
isBigStringPresent = true;
|
||||
} else if (aPath.contains("!)(*&")) {
|
||||
isSmallString1Present = true;
|
||||
} else if (aPath.contains("@)(*&")) {
|
||||
isSmallString2Present = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -148,6 +174,9 @@
|
||||
ok(isImagesPresent, "images is present");
|
||||
ok(isXptiWorkingSetPresent, "xpti-working-set is present");
|
||||
ok(isAtomTablePresent, "atom-table is present");
|
||||
ok(isBigStringPresent, "large string is present");
|
||||
ok(isSmallString1Present, "small string 1 is present");
|
||||
ok(isSmallString2Present, "small string 2 is present");
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user