Bug 1337432 - browser_new_content_window_chromeflags.js should test the new CHROME_SUPPRESS_ANIMATION flag. r?jaws
Before
bug 1336230 landed, we were successfully testing the CHROME_MAC_SUPPRESS_ANIMATION
flag. Then we renamed the flag to CHROME_SUPPRESS_ANIMATION, but didn't update the test.
The test continued to pass though, since we ended up doing bitwise AND on undefined,
which produced the 0 value that the test expected.
This patch makes sure that the flag is non-zero-ish before doing the bitwise
operation. It also updates the flag to be CHROME_SUPPRESS_ANIMATION.
MozReview-Commit-ID: 2ztJ7oqlQMe
--- a/toolkit/components/windowwatcher/test/browser_new_content_window_chromeflags.js
+++ b/toolkit/components/windowwatcher/test/browser_new_content_window_chromeflags.js
@@ -84,17 +84,17 @@ const DISALLOWED = {
flag: Ci.nsIWebBrowserChrome.CHROME_WINDOW_LOWERED, // Renamed to alwaysLowered
defaults_to: false,
},
"alwaysRaised": {
flag: Ci.nsIWebBrowserChrome.CHROME_WINDOW_RAISED,
defaults_to: false,
},
"suppressanimation": {
- flag: Ci.nsIWebBrowserChrome.CHROME_MAC_SUPPRESS_ANIMATION,
+ flag: Ci.nsIWebBrowserChrome.CHROME_SUPPRESS_ANIMATION,
defaults_to: false,
},
"extrachrome": {
flag: Ci.nsIWebBrowserChrome.CHROME_EXTRA,
defaults_to: false,
},
"centerscreen": {
flag: Ci.nsIWebBrowserChrome.CHROME_CENTER_SCREEN,
@@ -187,16 +187,17 @@ function assertContentFlags(chromeFlags)
// have been able to flip it on.
Assert.ok((chromeFlags & flag),
`Expected feature ${feature} to be enabled`);
}
}
for (let feature in DISALLOWED) {
let flag = DISALLOWED[feature].flag;
+ Assert.ok(flag, "Expected flag to be a non-zeroish value");
if (DISALLOWED[feature].defaults_to) {
// The feature is supposed to default to true, so it should
// stay true.
Assert.ok((chromeFlags & flag),
`Expected feature ${feature} to be unchanged`);
} else {
// The feature is supposed to default to false, so it should
// stay false.