Bug 1154275 - Remove ise() in favor of is(); r=Ms2ger

This commit is contained in:
Ehsan Akhgari 2015-05-12 19:52:01 -04:00
parent e726492316
commit 382b6d4528
87 changed files with 520 additions and 528 deletions

View File

@ -11,13 +11,13 @@ const BASE_URL = Services.prefs.getCharPref("loop.server");
function* checkFxA401() { function* checkFxA401() {
let err = MozLoopService.errors.get("login"); let err = MozLoopService.errors.get("login");
ise(err.code, 401, "Check error code"); is(err.code, 401, "Check error code");
ise(err.friendlyMessage, getLoopString("could_not_authenticate"), is(err.friendlyMessage, getLoopString("could_not_authenticate"),
"Check friendlyMessage"); "Check friendlyMessage");
ise(err.friendlyDetails, getLoopString("password_changed_question"), is(err.friendlyDetails, getLoopString("password_changed_question"),
"Check friendlyDetails"); "Check friendlyDetails");
ise(err.friendlyDetailsButtonLabel, getLoopString("retry_button"), is(err.friendlyDetailsButtonLabel, getLoopString("retry_button"),
"Check friendlyDetailsButtonLabel"); "Check friendlyDetailsButtonLabel");
let loopButton = document.getElementById("loop-button"); let loopButton = document.getElementById("loop-button");
is(loopButton.getAttribute("state"), "error", is(loopButton.getAttribute("state"), "error",
"state of loop button should be error after a 401 with login"); "state of loop button should be error after a 401 with login");
@ -65,11 +65,11 @@ add_task(function* checkOAuthParams() {
yield promiseOAuthParamsSetup(BASE_URL, params); yield promiseOAuthParamsSetup(BASE_URL, params);
let client = yield MozLoopServiceInternal.promiseFxAOAuthClient(); let client = yield MozLoopServiceInternal.promiseFxAOAuthClient();
for (let key of Object.keys(params)) { for (let key of Object.keys(params)) {
ise(client.parameters[key], params[key], "Check " + key + " was passed to the OAuth client"); is(client.parameters[key], params[key], "Check " + key + " was passed to the OAuth client");
} }
let prefName = MozLoopServiceInternal.getSessionTokenPrefName(LOOP_SESSION_TYPE.FXA); let prefName = MozLoopServiceInternal.getSessionTokenPrefName(LOOP_SESSION_TYPE.FXA);
let padding = "X".repeat(HAWK_TOKEN_LENGTH - params.client_id.length); let padding = "X".repeat(HAWK_TOKEN_LENGTH - params.client_id.length);
ise(Services.prefs.getCharPref(prefName), params.client_id + padding, "Check FxA hawk token"); is(Services.prefs.getCharPref(prefName), params.client_id + padding, "Check FxA hawk token");
}); });
add_task(function* basicAuthorization() { add_task(function* basicAuthorization() {
@ -82,7 +82,7 @@ add_task(function* sameOAuthClientForTwoCalls() {
yield resetFxA(); yield resetFxA();
let client1 = yield MozLoopServiceInternal.promiseFxAOAuthClient(); let client1 = yield MozLoopServiceInternal.promiseFxAOAuthClient();
let client2 = yield MozLoopServiceInternal.promiseFxAOAuthClient(); let client2 = yield MozLoopServiceInternal.promiseFxAOAuthClient();
ise(client1, client2, "The same client should be returned"); is(client1, client2, "The same client should be returned");
}); });
add_task(function* paramsInvalid() { add_task(function* paramsInvalid() {
@ -120,9 +120,9 @@ add_task(function* params_no_hawk_session() {
}); });
ok(caught, "Should have caught the rejection"); ok(caught, "Should have caught the rejection");
let prefName = MozLoopServiceInternal.getSessionTokenPrefName(LOOP_SESSION_TYPE.FXA); let prefName = MozLoopServiceInternal.getSessionTokenPrefName(LOOP_SESSION_TYPE.FXA);
ise(Services.prefs.getPrefType(prefName), is(Services.prefs.getPrefType(prefName),
Services.prefs.PREF_INVALID, Services.prefs.PREF_INVALID,
"Check FxA hawk token is not set"); "Check FxA hawk token is not set");
}); });
add_task(function* params_nonJSON() { add_task(function* params_nonJSON() {
@ -299,9 +299,9 @@ add_task(function* basicAuthorizationAndRegistration() {
statusChangedPromise = promiseObserverNotified("loop-status-changed", "login"); statusChangedPromise = promiseObserverNotified("loop-status-changed", "login");
let tokenData = yield MozLoopService.logInToFxA(); let tokenData = yield MozLoopService.logInToFxA();
yield statusChangedPromise; yield statusChangedPromise;
ise(tokenData.access_token, "code1_access_token", "Check access_token"); is(tokenData.access_token, "code1_access_token", "Check access_token");
ise(tokenData.scope, "profile", "Check scope"); is(tokenData.scope, "profile", "Check scope");
ise(tokenData.token_type, "bearer", "Check token_type"); is(tokenData.token_type, "bearer", "Check token_type");
is(MozLoopService.userProfile.email, "test@example.com", "email should exist in the profile data"); is(MozLoopService.userProfile.email, "test@example.com", "email should exist in the profile data");
is(MozLoopService.userProfile.uid, "1234abcd", "uid should exist in the profile data"); is(MozLoopService.userProfile.uid, "1234abcd", "uid should exist in the profile data");
@ -309,10 +309,10 @@ add_task(function* basicAuthorizationAndRegistration() {
is(loopButton.getAttribute("state"), "active", "state of loop button should be active when logged in"); is(loopButton.getAttribute("state"), "active", "state of loop button should be active when logged in");
let registrationResponse = yield promiseOAuthGetRegistration(BASE_URL); let registrationResponse = yield promiseOAuthGetRegistration(BASE_URL);
ise(registrationResponse.response.simplePushURLs.calls, "https://localhost/pushUrl/fxa-calls", is(registrationResponse.response.simplePushURLs.calls, "https://localhost/pushUrl/fxa-calls",
"Check registered push URL"); "Check registered push URL");
ise(registrationResponse.response.simplePushURLs.rooms, "https://localhost/pushUrl/fxa-rooms", is(registrationResponse.response.simplePushURLs.rooms, "https://localhost/pushUrl/fxa-rooms",
"Check registered push URL"); "Check registered push URL");
let loopPanel = document.getElementById("loop-notification-panel"); let loopPanel = document.getElementById("loop-notification-panel");
loopPanel.hidePopup(); loopPanel.hidePopup();
@ -326,8 +326,8 @@ add_task(function* basicAuthorizationAndRegistration() {
yield MozLoopService.logOutFromFxA(); yield MozLoopService.logOutFromFxA();
checkLoggedOutState(); checkLoggedOutState();
registrationResponse = yield promiseOAuthGetRegistration(BASE_URL); registrationResponse = yield promiseOAuthGetRegistration(BASE_URL);
ise(registrationResponse.response, null, is(registrationResponse.response, null,
"Check registration was deleted on the server"); "Check registration was deleted on the server");
is(visibleEmail.textContent, "Guest", "Guest should be displayed on the panel again after logout"); is(visibleEmail.textContent, "Guest", "Guest should be displayed on the panel again after logout");
is(MozLoopService.userProfile, null, "userProfile should be null after logout"); is(MozLoopService.userProfile, null, "userProfile should be null after logout");
}); });
@ -350,7 +350,7 @@ add_task(function* loginWithParams401() {
ok(false, "Promise should have rejected"); ok(false, "Promise should have rejected");
}, },
error => { error => {
ise(error.code, 401, "Check error code"); is(error.code, 401, "Check error code");
checkFxAOAuthTokenData(null); checkFxAOAuthTokenData(null);
}); });
@ -365,7 +365,7 @@ add_task(function* logoutWithIncorrectPushURL() {
Services.prefs.setCharPref(fxASessionPref, "X".repeat(HAWK_TOKEN_LENGTH)); Services.prefs.setCharPref(fxASessionPref, "X".repeat(HAWK_TOKEN_LENGTH));
yield MozLoopServiceInternal.registerWithLoopServer(LOOP_SESSION_TYPE.FXA, "calls", pushURL); yield MozLoopServiceInternal.registerWithLoopServer(LOOP_SESSION_TYPE.FXA, "calls", pushURL);
let registrationResponse = yield promiseOAuthGetRegistration(BASE_URL); let registrationResponse = yield promiseOAuthGetRegistration(BASE_URL);
ise(registrationResponse.response.simplePushURLs.calls, pushURL, "Check registered push URL"); is(registrationResponse.response.simplePushURLs.calls, pushURL, "Check registered push URL");
MozLoopServiceInternal.pushURLs.get(LOOP_SESSION_TYPE.FXA).calls = "http://www.example.com/invalid"; MozLoopServiceInternal.pushURLs.get(LOOP_SESSION_TYPE.FXA).calls = "http://www.example.com/invalid";
let caught = false; let caught = false;
yield MozLoopService.logOutFromFxA().catch((error) => { yield MozLoopService.logOutFromFxA().catch((error) => {
@ -374,7 +374,7 @@ add_task(function* logoutWithIncorrectPushURL() {
ok(caught, "Should have caught an error logging out with a mismatched push URL"); ok(caught, "Should have caught an error logging out with a mismatched push URL");
checkLoggedOutState(); checkLoggedOutState();
registrationResponse = yield promiseOAuthGetRegistration(BASE_URL); registrationResponse = yield promiseOAuthGetRegistration(BASE_URL);
ise(registrationResponse.response.simplePushURLs.calls, pushURL, "Check registered push URL wasn't deleted"); is(registrationResponse.response.simplePushURLs.calls, pushURL, "Check registered push URL wasn't deleted");
}); });
add_task(function* logoutWithNoPushURL() { add_task(function* logoutWithNoPushURL() {
@ -386,12 +386,12 @@ add_task(function* logoutWithNoPushURL() {
yield MozLoopServiceInternal.registerWithLoopServer(LOOP_SESSION_TYPE.FXA, "calls", pushURL); yield MozLoopServiceInternal.registerWithLoopServer(LOOP_SESSION_TYPE.FXA, "calls", pushURL);
let registrationResponse = yield promiseOAuthGetRegistration(BASE_URL); let registrationResponse = yield promiseOAuthGetRegistration(BASE_URL);
ise(registrationResponse.response.simplePushURLs.calls, pushURL, "Check registered push URL"); is(registrationResponse.response.simplePushURLs.calls, pushURL, "Check registered push URL");
MozLoopServiceInternal.pushURLs.delete(LOOP_SESSION_TYPE.FXA); MozLoopServiceInternal.pushURLs.delete(LOOP_SESSION_TYPE.FXA);
yield MozLoopService.logOutFromFxA(); yield MozLoopService.logOutFromFxA();
checkLoggedOutState(); checkLoggedOutState();
registrationResponse = yield promiseOAuthGetRegistration(BASE_URL); registrationResponse = yield promiseOAuthGetRegistration(BASE_URL);
ise(registrationResponse.response.simplePushURLs.calls, pushURL, "Check registered push URL wasn't deleted"); is(registrationResponse.response.simplePushURLs.calls, pushURL, "Check registered push URL wasn't deleted");
}); });
add_task(function* loginWithRegistration401() { add_task(function* loginWithRegistration401() {
@ -411,7 +411,7 @@ add_task(function* loginWithRegistration401() {
ok(false, "Promise should have rejected"); ok(false, "Promise should have rejected");
}, },
error => { error => {
ise(error.code, 401, "Check error code"); is(error.code, 401, "Check error code");
checkFxAOAuthTokenData(null); checkFxAOAuthTokenData(null);
}); });

View File

@ -68,10 +68,10 @@ add_task(function* token_request() {
yield promiseOAuthParamsSetup(BASE_URL, params); yield promiseOAuthParamsSetup(BASE_URL, params);
let request = yield promiseToken("my_code", params.state); let request = yield promiseToken("my_code", params.state);
ise(request.status, 200, "Check token response status"); is(request.status, 200, "Check token response status");
ise(request.response.access_token, "my_code_access_token", "Check access_token"); is(request.response.access_token, "my_code_access_token", "Check access_token");
ise(request.response.scope, "profile", "Check scope"); is(request.response.scope, "profile", "Check scope");
ise(request.response.token_type, "bearer", "Check token_type"); is(request.response.token_type, "bearer", "Check token_type");
}); });
add_task(function* token_request_invalid_state() { add_task(function* token_request_invalid_state() {
@ -84,8 +84,8 @@ add_task(function* token_request_invalid_state() {
}; };
yield promiseOAuthParamsSetup(BASE_URL, params); yield promiseOAuthParamsSetup(BASE_URL, params);
let request = yield promiseToken("my_code", "my_state"); let request = yield promiseToken("my_code", "my_state");
ise(request.status, 400, "Check token response status"); is(request.status, 400, "Check token response status");
ise(request.response, null, "Check token response body"); is(request.response, null, "Check token response body");
}); });

View File

@ -157,18 +157,18 @@ function* resetFxA() {
} }
function checkFxAOAuthTokenData(aValue) { function checkFxAOAuthTokenData(aValue) {
ise(MozLoopServiceInternal.fxAOAuthTokenData, aValue, "fxAOAuthTokenData should be " + aValue); is(MozLoopServiceInternal.fxAOAuthTokenData, aValue, "fxAOAuthTokenData should be " + aValue);
} }
function checkLoggedOutState() { function checkLoggedOutState() {
let global = Cu.import("resource:///modules/loop/MozLoopService.jsm", {}); let global = Cu.import("resource:///modules/loop/MozLoopService.jsm", {});
ise(global.gFxAOAuthClientPromise, null, "gFxAOAuthClientPromise should be cleared"); is(global.gFxAOAuthClientPromise, null, "gFxAOAuthClientPromise should be cleared");
ise(MozLoopService.userProfile, null, "fxAOAuthProfile should be cleared"); is(MozLoopService.userProfile, null, "fxAOAuthProfile should be cleared");
ise(global.gFxAOAuthClient, null, "gFxAOAuthClient should be cleared"); is(global.gFxAOAuthClient, null, "gFxAOAuthClient should be cleared");
checkFxAOAuthTokenData(null); checkFxAOAuthTokenData(null);
const fxASessionPref = MozLoopServiceInternal.getSessionTokenPrefName(LOOP_SESSION_TYPE.FXA); const fxASessionPref = MozLoopServiceInternal.getSessionTokenPrefName(LOOP_SESSION_TYPE.FXA);
ise(Services.prefs.getPrefType(fxASessionPref), Services.prefs.PREF_INVALID, is(Services.prefs.getPrefType(fxASessionPref), Services.prefs.PREF_INVALID,
"FxA hawk session should be cleared anyways"); "FxA hawk session should be cleared anyways");
} }
function promiseDeletedOAuthParams(baseURL) { function promiseDeletedOAuthParams(baseURL) {

View File

@ -38,27 +38,27 @@ let gTests = [{
let dialog = yield dialogPromise; let dialog = yield dialogPromise;
// Check focus is in the textbox // Check focus is in the textbox
ise(dialog.document.activeElement.value, "Default text", "Textbox with correct text is focused"); is(dialog.document.activeElement.value, "Default text", "Textbox with correct text is focused");
// Titlebar // Titlebar
ise(content.document.getElementById("dialogTitle").textContent, "Sample sub-dialog", is(content.document.getElementById("dialogTitle").textContent, "Sample sub-dialog",
"Dialog title should be correct initially"); "Dialog title should be correct initially");
let receivedEvent = waitForEvent(gBrowser.selectedBrowser, "DOMTitleChanged"); let receivedEvent = waitForEvent(gBrowser.selectedBrowser, "DOMTitleChanged");
dialog.document.title = "Updated title"; dialog.document.title = "Updated title";
// Wait for the title change listener // Wait for the title change listener
yield receivedEvent; yield receivedEvent;
ise(content.document.getElementById("dialogTitle").textContent, "Updated title", is(content.document.getElementById("dialogTitle").textContent, "Updated title",
"Dialog title should be updated with changes"); "Dialog title should be updated with changes");
let closingPromise = promiseDialogClosing(dialog); let closingPromise = promiseDialogClosing(dialog);
// Accept the dialog // Accept the dialog
dialog.document.documentElement.acceptDialog(); dialog.document.documentElement.acceptDialog();
let closingEvent = yield closingPromise; let closingEvent = yield closingPromise;
ise(closingEvent.detail.button, "accept", "closing event should indicate button was 'accept'"); is(closingEvent.detail.button, "accept", "closing event should indicate button was 'accept'");
yield deferredClose.promise; yield deferredClose.promise;
ise(rv.acceptCount, 1, "return value should have been updated"); is(rv.acceptCount, 1, "return value should have been updated");
}, },
}, },
{ {
@ -76,10 +76,10 @@ let gTests = [{
dialog.document.documentElement.cancelDialog(); dialog.document.documentElement.cancelDialog();
let closingEvent = yield closingPromise; let closingEvent = yield closingPromise;
ise(closingEvent.detail.button, "cancel", "closing event should indicate button was 'cancel'"); is(closingEvent.detail.button, "cancel", "closing event should indicate button was 'cancel'");
yield deferredClose.promise; yield deferredClose.promise;
ise(rv.acceptCount, 0, "return value should NOT have been updated"); is(rv.acceptCount, 0, "return value should NOT have been updated");
}, },
}, },
{ {
@ -96,10 +96,10 @@ let gTests = [{
dialog.window.close(); dialog.window.close();
let closingEvent = yield closingPromise; let closingEvent = yield closingPromise;
ise(closingEvent.detail.button, null, "closing event should indicate no button was clicked"); is(closingEvent.detail.button, null, "closing event should indicate no button was clicked");
yield deferredClose.promise; yield deferredClose.promise;
ise(rv.acceptCount, 0, "return value should NOT have been updated"); is(rv.acceptCount, 0, "return value should NOT have been updated");
}, },
}, },
{ {
@ -115,7 +115,7 @@ let gTests = [{
content.window); content.window);
yield deferredClose.promise; yield deferredClose.promise;
ise(rv.acceptCount, 0, "return value should NOT have been updated"); is(rv.acceptCount, 0, "return value should NOT have been updated");
}, },
}, },
{ {
@ -131,7 +131,7 @@ let gTests = [{
content.gSubDialog._frame.goBack(); content.gSubDialog._frame.goBack();
yield deferredClose.promise; yield deferredClose.promise;
ise(rv.acceptCount, 0, "return value should NOT have been updated"); is(rv.acceptCount, 0, "return value should NOT have been updated");
}, },
}, },
{ {
@ -146,7 +146,7 @@ let gTests = [{
EventUtils.synthesizeKey("VK_ESCAPE", {}, content.window); EventUtils.synthesizeKey("VK_ESCAPE", {}, content.window);
yield deferredClose.promise; yield deferredClose.promise;
ise(rv.acceptCount, 0, "return value should NOT have been updated"); is(rv.acceptCount, 0, "return value should NOT have been updated");
}, },
}, },
{ {
@ -157,8 +157,8 @@ let gTests = [{
(aEvent) => dialogClosingCallback(deferredClose, aEvent)); (aEvent) => dialogClosingCallback(deferredClose, aEvent));
let dialog = yield dialogPromise; let dialog = yield dialogPromise;
ise(content.gSubDialog._frame.style.width, "32em", "Width should be set on the frame from the dialog"); is(content.gSubDialog._frame.style.width, "32em", "Width should be set on the frame from the dialog");
ise(content.gSubDialog._frame.style.height, "5em", "Height should be set on the frame from the dialog"); is(content.gSubDialog._frame.style.height, "5em", "Height should be set on the frame from the dialog");
content.gSubDialog.close(); content.gSubDialog.close();
yield deferredClose.promise; yield deferredClose.promise;
@ -194,10 +194,10 @@ let gTests = [{
let dialog = yield dialogPromise; let dialog = yield dialogPromise;
ise(content.gSubDialog._frame.style.width, "32em", "Width should be set on the frame from the dialog"); is(content.gSubDialog._frame.style.width, "32em", "Width should be set on the frame from the dialog");
let docEl = content.gSubDialog._frame.contentDocument.documentElement; let docEl = content.gSubDialog._frame.contentDocument.documentElement;
ok(docEl.scrollHeight > oldHeight, "Content height increased (from " + oldHeight + " to " + docEl.scrollHeight + ")."); ok(docEl.scrollHeight > oldHeight, "Content height increased (from " + oldHeight + " to " + docEl.scrollHeight + ").");
ise(content.gSubDialog._frame.style.height, docEl.scrollHeight + "px", "Height on the frame should be higher now"); is(content.gSubDialog._frame.style.height, docEl.scrollHeight + "px", "Height on the frame should be higher now");
content.gSubDialog.close(); content.gSubDialog.close();
yield deferredClose.promise; yield deferredClose.promise;
@ -217,7 +217,7 @@ let gTests = [{
let dialog = yield dialogPromise; let dialog = yield dialogPromise;
ise(content.gSubDialog._frame.style.width, "32em", "Width should be set on the frame from the dialog"); is(content.gSubDialog._frame.style.width, "32em", "Width should be set on the frame from the dialog");
let newHeight = content.gSubDialog._frame.contentDocument.documentElement.scrollHeight; let newHeight = content.gSubDialog._frame.contentDocument.documentElement.scrollHeight;
ok(parseInt(content.gSubDialog._frame.style.height) < window.innerHeight, ok(parseInt(content.gSubDialog._frame.style.height) < window.innerHeight,
"Height on the frame should be smaller than window's innerHeight"); "Height on the frame should be smaller than window's innerHeight");
@ -261,10 +261,10 @@ function dialogClosingCallback(aPromise, aEvent) {
waitForEvent(content.gSubDialog._frame, "load", 4000).then((aEvt) => { waitForEvent(content.gSubDialog._frame, "load", 4000).then((aEvt) => {
info("Load event happened: " + !(aEvt instanceof Error)); info("Load event happened: " + !(aEvt instanceof Error));
is_element_hidden(content.gSubDialog._overlay, "Overlay is not visible"); is_element_hidden(content.gSubDialog._overlay, "Overlay is not visible");
ise(content.gSubDialog._frame.getAttribute("style"), "", is(content.gSubDialog._frame.getAttribute("style"), "",
"Check that inline styles were cleared"); "Check that inline styles were cleared");
ise(content.gSubDialog._frame.contentWindow.location.toString(), "about:blank", is(content.gSubDialog._frame.contentWindow.location.toString(), "about:blank",
"Check the sub-dialog was unloaded"); "Check the sub-dialog was unloaded");
if (gTeardownAfterClose) { if (gTeardownAfterClose) {
content.close(); content.close();
finish(); finish();

View File

@ -51,8 +51,8 @@ function promiseLoadSubDialog(aURL) {
return; return;
content.gSubDialog._frame.removeEventListener("load", load); content.gSubDialog._frame.removeEventListener("load", load);
ise(content.gSubDialog._frame.contentWindow.location.toString(), aURL, is(content.gSubDialog._frame.contentWindow.location.toString(), aURL,
"Check the proper URL is loaded"); "Check the proper URL is loaded");
// Check visibility // Check visibility
is_element_visible(content.gSubDialog._overlay, "Overlay is visible"); is_element_visible(content.gSubDialog._overlay, "Overlay is visible");
@ -66,7 +66,7 @@ function promiseLoadSubDialog(aURL) {
expectedStyleSheetURLs.splice(i, 1); expectedStyleSheetURLs.splice(i, 1);
} }
} }
ise(expectedStyleSheetURLs.length, 0, "All expectedStyleSheetURLs should have been found"); is(expectedStyleSheetURLs.length, 0, "All expectedStyleSheetURLs should have been found");
resolve(content.gSubDialog._frame.contentWindow); resolve(content.gSubDialog._frame.contentWindow);
}); });

View File

@ -17,10 +17,10 @@ let tests = [
function test_untrusted_host(done) { function test_untrusted_host(done) {
loadUITourTestPage(function() { loadUITourTestPage(function() {
let bookmarksMenu = document.getElementById("bookmarks-menu-button"); let bookmarksMenu = document.getElementById("bookmarks-menu-button");
ise(bookmarksMenu.open, false, "Bookmark menu should initially be closed"); is(bookmarksMenu.open, false, "Bookmark menu should initially be closed");
gContentAPI.showMenu("bookmarks"); gContentAPI.showMenu("bookmarks");
ise(bookmarksMenu.open, false, "Bookmark menu should not open on a untrusted host"); is(bookmarksMenu.open, false, "Bookmark menu should not open on a untrusted host");
done(); done();
}, "http://mochi.test:8888/"); }, "http://mochi.test:8888/");
@ -45,10 +45,10 @@ let tests = [
function test_unsecure_host(done) { function test_unsecure_host(done) {
loadUITourTestPage(function() { loadUITourTestPage(function() {
let bookmarksMenu = document.getElementById("bookmarks-menu-button"); let bookmarksMenu = document.getElementById("bookmarks-menu-button");
ise(bookmarksMenu.open, false, "Bookmark menu should initially be closed"); is(bookmarksMenu.open, false, "Bookmark menu should initially be closed");
gContentAPI.showMenu("bookmarks"); gContentAPI.showMenu("bookmarks");
ise(bookmarksMenu.open, false, "Bookmark menu should not open on a unsecure host"); is(bookmarksMenu.open, false, "Bookmark menu should not open on a unsecure host");
done(); done();
}, "http://example.com/"); }, "http://example.com/");
@ -69,10 +69,10 @@ let tests = [
Services.prefs.setBoolPref("browser.uitour.enabled", false); Services.prefs.setBoolPref("browser.uitour.enabled", false);
let bookmarksMenu = document.getElementById("bookmarks-menu-button"); let bookmarksMenu = document.getElementById("bookmarks-menu-button");
ise(bookmarksMenu.open, false, "Bookmark menu should initially be closed"); is(bookmarksMenu.open, false, "Bookmark menu should initially be closed");
gContentAPI.showMenu("bookmarks"); gContentAPI.showMenu("bookmarks");
ise(bookmarksMenu.open, false, "Bookmark menu should not open when feature is disabled"); is(bookmarksMenu.open, false, "Bookmark menu should not open when feature is disabled");
Services.prefs.setBoolPref("browser.uitour.enabled", true); Services.prefs.setBoolPref("browser.uitour.enabled", true);
done(); done();

View File

@ -70,7 +70,7 @@ let tests = [
taskify(function* test_bookmarks_menu() { taskify(function* test_bookmarks_menu() {
let bookmarksMenuButton = document.getElementById("bookmarks-menu-button"); let bookmarksMenuButton = document.getElementById("bookmarks-menu-button");
ise(bookmarksMenuButton.open, false, "Menu should initially be closed"); is(bookmarksMenuButton.open, false, "Menu should initially be closed");
gContentAPI.showMenu("bookmarks"); gContentAPI.showMenu("bookmarks");
yield waitForConditionPromise(() => { yield waitForConditionPromise(() => {

View File

@ -26,8 +26,8 @@ let tests = [
gContentAPI.showHighlight("urlbar"); gContentAPI.showHighlight("urlbar");
waitForElementToBeVisible(highlight, function checkPanelAttributes() { waitForElementToBeVisible(highlight, function checkPanelAttributes() {
SimpleTest.executeSoon(() => { SimpleTest.executeSoon(() => {
ise(highlight.height, "", "Highlight panel should have no explicit height set"); is(highlight.height, "", "Highlight panel should have no explicit height set");
ise(highlight.width, "", "Highlight panel should have no explicit width set"); is(highlight.width, "", "Highlight panel should have no explicit width set");
done(); done();
}); });
}, "Highlight should be moved to the urlbar"); }, "Highlight should be moved to the urlbar");
@ -40,8 +40,8 @@ let tests = [
gContentAPI.showInfo("urlbar", "new title", "new text"); gContentAPI.showInfo("urlbar", "new title", "new text");
waitForElementToBeVisible(tooltip, function checkPanelAttributes() { waitForElementToBeVisible(tooltip, function checkPanelAttributes() {
SimpleTest.executeSoon(() => { SimpleTest.executeSoon(() => {
ise(tooltip.height, "", "Info panel should have no explicit height set"); is(tooltip.height, "", "Info panel should have no explicit height set");
ise(tooltip.width, "", "Info panel should have no explicit width set"); is(tooltip.width, "", "Info panel should have no explicit width set");
done(); done();
}); });
}, "Tooltip should be moved to the urlbar"); }, "Tooltip should be moved to the urlbar");

View File

@ -31,7 +31,7 @@ let tests = [
taskify(function* test_gettingStartedClicked_linkOpenedWithExpectedParams() { taskify(function* test_gettingStartedClicked_linkOpenedWithExpectedParams() {
Services.prefs.setBoolPref("loop.gettingStarted.seen", false); Services.prefs.setBoolPref("loop.gettingStarted.seen", false);
Services.prefs.setCharPref("loop.gettingStarted.url", "http://example.com"); Services.prefs.setCharPref("loop.gettingStarted.url", "http://example.com");
ise(loopButton.open, false, "Menu should initially be closed"); is(loopButton.open, false, "Menu should initially be closed");
loopButton.click(); loopButton.click();
yield waitForConditionPromise(() => { yield waitForConditionPromise(() => {
@ -69,7 +69,7 @@ let tests = [
UITour.pageIDsForSession.clear(); UITour.pageIDsForSession.clear();
Services.prefs.setCharPref("loop.gettingStarted.url", "http://example.com"); Services.prefs.setCharPref("loop.gettingStarted.url", "http://example.com");
ise(loopButton.open, false, "Menu should initially be closed"); is(loopButton.open, false, "Menu should initially be closed");
loopButton.click(); loopButton.click();
yield waitForConditionPromise(() => { yield waitForConditionPromise(() => {
@ -106,7 +106,7 @@ let tests = [
taskify(function* test_menu_show_hide() { taskify(function* test_menu_show_hide() {
// The targets to highlight only appear after getting started is launched. // The targets to highlight only appear after getting started is launched.
Services.prefs.setBoolPref("loop.gettingStarted.seen", true); Services.prefs.setBoolPref("loop.gettingStarted.seen", true);
ise(loopButton.open, false, "Menu should initially be closed"); is(loopButton.open, false, "Menu should initially be closed");
gContentAPI.showMenu("loop"); gContentAPI.showMenu("loop");
yield waitForConditionPromise(() => { yield waitForConditionPromise(() => {
@ -301,7 +301,7 @@ let tests = [
LoopRooms.open("fakeTourRoom"); LoopRooms.open("fakeTourRoom");
}), }),
taskify(function* test_arrow_panel_position() { taskify(function* test_arrow_panel_position() {
ise(loopButton.open, false, "Menu should initially be closed"); is(loopButton.open, false, "Menu should initially be closed");
let popup = document.getElementById("UITourTooltip"); let popup = document.getElementById("UITourTooltip");
yield showMenuPromise("loop"); yield showMenuPromise("loop");
@ -344,7 +344,7 @@ let tests = [
let observationPromise = new Promise((resolve) => { let observationPromise = new Promise((resolve) => {
gContentAPI.observe((event, params) => { gContentAPI.observe((event, params) => {
is(event, "Loop:IncomingConversation", "Page should have been notified about incoming conversation"); is(event, "Loop:IncomingConversation", "Page should have been notified about incoming conversation");
ise(params.conversationOpen, false, "conversationOpen should be false"); is(params.conversationOpen, false, "conversationOpen should be false");
is(gBrowser.selectedTab, gTestTab, "The same tab should be selected"); is(gBrowser.selectedTab, gTestTab, "The same tab should be selected");
resolve(); resolve();
}); });

View File

@ -50,9 +50,9 @@ let tests = [
tabBrowser.addEventListener("load", function onload(evt) { tabBrowser.addEventListener("load", function onload(evt) {
tabBrowser.removeEventListener("load", onload, true); tabBrowser.removeEventListener("load", onload, true);
ise(tabBrowser.contentDocument.location.href, is(tabBrowser.contentDocument.location.href,
"about:accounts?action=signup&entrypoint=uitour", "about:accounts?action=signup&entrypoint=uitour",
"about:accounts should have replaced the tab"); "about:accounts should have replaced the tab");
// the iframe in about:accounts will still be loading, so we stop // the iframe in about:accounts will still be loading, so we stop
// that before resetting the pref. // that before resetting the pref.

View File

@ -14,39 +14,39 @@ let { WebAudioFront } =
function* testTarget (client, target) { function* testTarget (client, target) {
yield target.makeRemote(); yield target.makeRemote();
ise(target.hasActor("timeline"), true, "target.hasActor() true when actor exists."); is(target.hasActor("timeline"), true, "target.hasActor() true when actor exists.");
ise(target.hasActor("webaudio"), true, "target.hasActor() true when actor exists."); is(target.hasActor("webaudio"), true, "target.hasActor() true when actor exists.");
ise(target.hasActor("notreal"), false, "target.hasActor() false when actor does not exist."); is(target.hasActor("notreal"), false, "target.hasActor() false when actor does not exist.");
// Create a front to ensure the actor is loaded // Create a front to ensure the actor is loaded
let front = new WebAudioFront(target.client, target.form); let front = new WebAudioFront(target.client, target.form);
let desc = yield target.getActorDescription("webaudio"); let desc = yield target.getActorDescription("webaudio");
ise(desc.typeName, "webaudio", is(desc.typeName, "webaudio",
"target.getActorDescription() returns definition data for corresponding actor"); "target.getActorDescription() returns definition data for corresponding actor");
ise(desc.events["start-context"]["type"], "startContext", is(desc.events["start-context"]["type"], "startContext",
"target.getActorDescription() returns event data for corresponding actor"); "target.getActorDescription() returns event data for corresponding actor");
desc = yield target.getActorDescription("nope"); desc = yield target.getActorDescription("nope");
ise(desc, undefined, "target.getActorDescription() returns undefined for non-existing actor"); is(desc, undefined, "target.getActorDescription() returns undefined for non-existing actor");
desc = yield target.getActorDescription(); desc = yield target.getActorDescription();
ise(desc, undefined, "target.getActorDescription() returns undefined for undefined actor"); is(desc, undefined, "target.getActorDescription() returns undefined for undefined actor");
let hasMethod = yield target.actorHasMethod("audionode", "getType"); let hasMethod = yield target.actorHasMethod("audionode", "getType");
ise(hasMethod, true, is(hasMethod, true,
"target.actorHasMethod() returns true for existing actor with method"); "target.actorHasMethod() returns true for existing actor with method");
hasMethod = yield target.actorHasMethod("audionode", "nope"); hasMethod = yield target.actorHasMethod("audionode", "nope");
ise(hasMethod, false, is(hasMethod, false,
"target.actorHasMethod() returns false for existing actor with no method"); "target.actorHasMethod() returns false for existing actor with no method");
hasMethod = yield target.actorHasMethod("nope", "nope"); hasMethod = yield target.actorHasMethod("nope", "nope");
ise(hasMethod, false, is(hasMethod, false,
"target.actorHasMethod() returns false for non-existing actor with no method"); "target.actorHasMethod() returns false for non-existing actor with no method");
hasMethod = yield target.actorHasMethod(); hasMethod = yield target.actorHasMethod();
ise(hasMethod, false, is(hasMethod, false,
"target.actorHasMethod() returns false for undefined params"); "target.actorHasMethod() returns false for undefined params");
ise(target.getTrait("customHighlighters"), true, is(target.getTrait("customHighlighters"), true,
"target.getTrait() returns boolean when trait exists"); "target.getTrait() returns boolean when trait exists");
ise(target.getTrait("giddyup"), undefined, is(target.getTrait("giddyup"), undefined,
"target.getTrait() returns undefined when trait does not exist"); "target.getTrait() returns undefined when trait does not exist");
close(target, client); close(target, client);

View File

@ -17,7 +17,7 @@ function spawnTest () {
"A `_profilerStartTime` property exists in the recording model."); "A `_profilerStartTime` property exists in the recording model.");
ok(startModel._timelineStartTime !== undefined, ok(startModel._timelineStartTime !== undefined,
"A `_timelineStartTime` property exists in the recording model."); "A `_timelineStartTime` property exists in the recording model.");
ise(startModel._memoryStartTime, 0, is(startModel._memoryStartTime, 0,
"A `_memoryStartTime` property exists in the recording model, but it's 0."); "A `_memoryStartTime` property exists in the recording model, but it's 0.");
yield busyWait(WAIT_TIME); yield busyWait(WAIT_TIME);

View File

@ -41,7 +41,7 @@ function compare (actual, expected, type) {
ok(expected[param](value), type + " has a passing value for " + param); ok(expected[param](value), type + " has a passing value for " + param);
} }
else { else {
ise(value, expected[param], type + " has correct default value and type for " + param); is(value, expected[param], type + " has correct default value and type for " + param);
} }
}); });

View File

@ -14,10 +14,10 @@ add_task(function*() {
let freq = yield oscNode.getParam("frequency"); let freq = yield oscNode.getParam("frequency");
info(typeof freq); info(typeof freq);
ise(freq, 440, "AudioNode:getParam correctly fetches AudioParam"); is(freq, 440, "AudioNode:getParam correctly fetches AudioParam");
let type = yield oscNode.getParam("type"); let type = yield oscNode.getParam("type");
ise(type, "sine", "AudioNode:getParam correctly fetches non-AudioParam"); is(type, "sine", "AudioNode:getParam correctly fetches non-AudioParam");
type = yield oscNode.getParam("not-a-valid-param"); type = yield oscNode.getParam("not-a-valid-param");
ok(type.type === "undefined", ok(type.type === "undefined",
@ -25,12 +25,12 @@ add_task(function*() {
let resSuccess = yield oscNode.setParam("frequency", 220); let resSuccess = yield oscNode.setParam("frequency", 220);
freq = yield oscNode.getParam("frequency"); freq = yield oscNode.getParam("frequency");
ise(freq, 220, "AudioNode:setParam correctly sets a `number` AudioParam"); is(freq, 220, "AudioNode:setParam correctly sets a `number` AudioParam");
is(resSuccess, undefined, "AudioNode:setParam returns undefined for correctly set AudioParam"); is(resSuccess, undefined, "AudioNode:setParam returns undefined for correctly set AudioParam");
resSuccess = yield oscNode.setParam("type", "square"); resSuccess = yield oscNode.setParam("type", "square");
type = yield oscNode.getParam("type"); type = yield oscNode.getParam("type");
ise(type, "square", "AudioNode:setParam correctly sets a `string` non-AudioParam"); is(type, "square", "AudioNode:setParam correctly sets a `string` non-AudioParam");
is(resSuccess, undefined, "AudioNode:setParam returns undefined for correctly set AudioParam"); is(resSuccess, undefined, "AudioNode:setParam returns undefined for correctly set AudioParam");
try { try {
@ -40,7 +40,7 @@ add_task(function*() {
ok(/is not a finite floating-point/.test(e.message), "AudioNode:setParam returns error with correct message when attempting an invalid assignment"); ok(/is not a finite floating-point/.test(e.message), "AudioNode:setParam returns error with correct message when attempting an invalid assignment");
is(e.type, "TypeError", "AudioNode:setParam returns error with correct type when attempting an invalid assignment"); is(e.type, "TypeError", "AudioNode:setParam returns error with correct type when attempting an invalid assignment");
freq = yield oscNode.getParam("frequency"); freq = yield oscNode.getParam("frequency");
ise(freq, 220, "AudioNode:setParam does not modify value when an error occurs"); is(freq, 220, "AudioNode:setParam does not modify value when an error occurs");
} }
yield removeTab(target.tab); yield removeTab(target.tab);

View File

@ -26,7 +26,7 @@ add_task(function*() {
is(error.name, "TypeError", "error has correct name"); is(error.name, "TypeError", "error has correct name");
is(error.message, "Argument 1 is not valid for any of the 2-argument overloads of AudioNode.connect.", "error has correct message"); is(error.message, "Argument 1 is not valid for any of the 2-argument overloads of AudioNode.connect.", "error has correct message");
is(error.stringified, "TypeError: Argument 1 is not valid for any of the 2-argument overloads of AudioNode.connect.", "error is stringified correctly"); is(error.stringified, "TypeError: Argument 1 is not valid for any of the 2-argument overloads of AudioNode.connect.", "error is stringified correctly");
ise(error.instanceof, true, "error is correctly an instanceof TypeError"); is(error.instanceof, true, "error is correctly an instanceof TypeError");
is(error.fileName, "http://example.com/browser/browser/devtools/webaudioeditor/test/doc_bug_1112378.html", "error has correct fileName"); is(error.fileName, "http://example.com/browser/browser/devtools/webaudioeditor/test/doc_bug_1112378.html", "error has correct fileName");
error = yield evalInDebuggee("throwDOMException()"); error = yield evalInDebuggee("throwDOMException()");
@ -37,7 +37,7 @@ add_task(function*() {
is(error.name, "NotSupportedError", "exception has correct name"); is(error.name, "NotSupportedError", "exception has correct name");
is(error.message, "Operation is not supported", "exception has correct message"); is(error.message, "Operation is not supported", "exception has correct message");
is(error.stringified, "NotSupportedError: Operation is not supported", "exception is stringified correctly"); is(error.stringified, "NotSupportedError: Operation is not supported", "exception is stringified correctly");
ise(error.instanceof, true, "exception is correctly an instance of DOMException"); is(error.instanceof, true, "exception is correctly an instance of DOMException");
is(error.filename, "http://example.com/browser/browser/devtools/webaudioeditor/test/doc_bug_1112378.html", "exception has correct filename"); is(error.filename, "http://example.com/browser/browser/devtools/webaudioeditor/test/doc_bug_1112378.html", "exception has correct filename");
yield teardown(target); yield teardown(target);

View File

@ -19,8 +19,8 @@ add_task(function*() {
]); ]);
var { nodes, edges } = countGraphObjects(panelWin); var { nodes, edges } = countGraphObjects(panelWin);
ise(nodes, 3, "should only be 3 nodes."); is(nodes, 3, "should only be 3 nodes.");
ise(edges, 2, "should only be 2 edges."); is(edges, 2, "should only be 2 edges.");
navigate(target, SIMPLE_NODES_URL); navigate(target, SIMPLE_NODES_URL);
@ -37,8 +37,8 @@ add_task(function*() {
"The tool's content should reappear without closing and reopening the toolbox."); "The tool's content should reappear without closing and reopening the toolbox.");
var { nodes, edges } = countGraphObjects(panelWin); var { nodes, edges } = countGraphObjects(panelWin);
ise(nodes, 15, "after navigation, should have 15 nodes"); is(nodes, 15, "after navigation, should have 15 nodes");
ise(edges, 0, "after navigation, should have 0 edges."); is(edges, 0, "after navigation, should have 0 edges.");
yield teardown(target); yield teardown(target);
}); });

View File

@ -19,8 +19,8 @@ add_task(function*() {
]); ]);
let { nodes, edges } = countGraphObjects(panelWin); let { nodes, edges } = countGraphObjects(panelWin);
ise(nodes, 3, "should only be 3 nodes."); is(nodes, 3, "should only be 3 nodes.");
ise(edges, 2, "should only be 2 edges."); is(edges, 2, "should only be 2 edges.");
reload(target); reload(target);
@ -30,8 +30,8 @@ add_task(function*() {
]); ]);
({ nodes, edges } = countGraphObjects(panelWin)); ({ nodes, edges } = countGraphObjects(panelWin));
ise(nodes, 3, "after reload, should only be 3 nodes."); is(nodes, 3, "after reload, should only be 3 nodes.");
ise(edges, 2, "after reload, should only be 2 edges."); is(edges, 2, "after reload, should only be 2 edges.");
yield teardown(target); yield teardown(target);
}); });

View File

@ -36,7 +36,7 @@ add_task(function*() {
nodeIds = actors.map(actor => actor.actorID); nodeIds = actors.map(actor => actor.actorID);
ok(!InspectorView.isVisible(), "InspectorView hidden on start."); ok(!InspectorView.isVisible(), "InspectorView hidden on start.");
ise(InspectorView.getCurrentAudioNode(), null, is(InspectorView.getCurrentAudioNode(), null,
"InspectorView has no current node set on reset."); "InspectorView has no current node set on reset.");
yield clickGraphNode(panelWin, nodeIds[2], true); yield clickGraphNode(panelWin, nodeIds[2], true);

View File

@ -278,7 +278,7 @@ function checkVariableView (view, index, hash, description = "") {
"Passing property value of " + value + " for " + variable + " " + description); "Passing property value of " + value + " for " + variable + " " + description);
} }
else { else {
ise(value, hash[variable], is(value, hash[variable],
"Correct property value of " + hash[variable] + " for " + variable + " " + description); "Correct property value of " + hash[variable] + " for " + variable + " " + description);
} }
}); });
@ -540,4 +540,4 @@ const NODE_CONSTRUCTORS = {
"DynamicsCompressorNode": "DynamicsCompressor", "DynamicsCompressorNode": "DynamicsCompressor",
"OscillatorNode": "Oscillator", "OscillatorNode": "Oscillator",
"StereoPannerNode": "StereoPanner" "StereoPannerNode": "StereoPanner"
}; };

View File

@ -1,7 +1,7 @@
/** /**
* Import common SimpleTest methods so that they're usable in this window. * Import common SimpleTest methods so that they're usable in this window.
*/ */
var imports = [ "SimpleTest", "is", "isnot", "ise", "ok", "onerror", "todo", var imports = [ "SimpleTest", "is", "isnot", "ok", "onerror", "todo",
"todo_is", "todo_isnot" ]; "todo_is", "todo_isnot" ];
for each (var name in imports) { for each (var name in imports) {
window[name] = window.opener.wrappedJSObject[name]; window[name] = window.opener.wrappedJSObject[name];

View File

@ -107,7 +107,7 @@ function checkResponseXMLAccessThrows(xhr) {
function checkSetResponseType(xhr, type) { function checkSetResponseType(xhr, type) {
var didthrow = false; var didthrow = false;
try { xhr.responseType = type; } catch (e) { didthrow = true; } try { xhr.responseType = type; } catch (e) { didthrow = true; }
ise(xhr.responseType, type, "responseType should be " + type); is(xhr.responseType, type, "responseType should be " + type);
ok(!didthrow, "should not have thrown when setting responseType"); ok(!didthrow, "should not have thrown when setting responseType");
} }
function checkSetResponseTypeThrows(xhr, type) { function checkSetResponseTypeThrows(xhr, type) {

View File

@ -46,7 +46,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1075702
test1.addEventListener("DOMAttrModified", mutationHandler, true); test1.addEventListener("DOMAttrModified", mutationHandler, true);
var removedNodeAccordingToRemoveNamedItemNS = test1.attributes.removeNamedItemNS(null, "x"); var removedNodeAccordingToRemoveNamedItemNS = test1.attributes.removeNamedItemNS(null, "x");
test1.removeEventListener("DOMAttrModified", mutationHandler, true); test1.removeEventListener("DOMAttrModified", mutationHandler, true);
ise(removedNodeAccordingToEvent, removedNodeAccordingToRemoveNamedItemNS, "Node removed according to event is not same as node removed by removeNamedItemNS."); is(removedNodeAccordingToEvent, removedNodeAccordingToRemoveNamedItemNS, "Node removed according to event is not same as node removed by removeNamedItemNS.");
} }
testremoveNamedItemNS(); testremoveNamedItemNS();
@ -59,7 +59,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1075702
test2.addEventListener("DOMAttrModified", mutationHandler, true); test2.addEventListener("DOMAttrModified", mutationHandler, true);
var removedNodeAccordingToRemoveNamedItem = test2.attributes.removeNamedItem("x"); var removedNodeAccordingToRemoveNamedItem = test2.attributes.removeNamedItem("x");
test2.removeEventListener("DOMAttrModified", mutationHandler, true); test2.removeEventListener("DOMAttrModified", mutationHandler, true);
ise(removedNodeAccordingToEvent, removedNodeAccordingToRemoveNamedItem, "Node removed according to event is not same as node removed by removeNamedItem."); is(removedNodeAccordingToEvent, removedNodeAccordingToRemoveNamedItem, "Node removed according to event is not same as node removed by removeNamedItem.");
} }
testremoveNamedItem(); testremoveNamedItem();

View File

@ -16,30 +16,30 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=891952
var all = document.all; var all = document.all;
is(all["content"], $("content"), "Should find the content"); is(all["content"], $("content"), "Should find the content");
ok(!("" in all), "Should not have an empty string prop on document.all"); ok(!("" in all), "Should not have an empty string prop on document.all");
ise(all[""], undefined, "Should not get empty string on document.all"); is(all[""], undefined, "Should not get empty string on document.all");
ise(all.namedItem(""), null, is(all.namedItem(""), null,
"namedItem for empty string should return null on document.all"); "namedItem for empty string should return null on document.all");
var divs = document.getElementsByTagName("div"); var divs = document.getElementsByTagName("div");
ok(!("" in divs), "Should not have an empty string prop on getElementsByTagName"); ok(!("" in divs), "Should not have an empty string prop on getElementsByTagName");
ise(divs[""], undefined, "Should not get empty string on getElementsByTagName"); is(divs[""], undefined, "Should not get empty string on getElementsByTagName");
ise(divs.namedItem(""), null, is(divs.namedItem(""), null,
"namedItem for empty string should return null on getElementsByTagName"); "namedItem for empty string should return null on getElementsByTagName");
var forms = document.forms; var forms = document.forms;
ok(!("" in forms), "Should not have an empty string prop on document.forms"); ok(!("" in forms), "Should not have an empty string prop on document.forms");
ise(forms[""], undefined, "Should not get empty string on document.forms"); is(forms[""], undefined, "Should not get empty string on document.forms");
ise(forms.namedItem(""), null, is(forms.namedItem(""), null,
"namedItem for empty string should return null on document.forms"); "namedItem for empty string should return null on document.forms");
var form = $("form"); var form = $("form");
ok(!("" in form), "Should not have an empty string prop on form"); ok(!("" in form), "Should not have an empty string prop on form");
ise(form[""], undefined, "Should not get empty string on form"); is(form[""], undefined, "Should not get empty string on form");
var formEls = $("form").elements; var formEls = $("form").elements;
ok(!("" in formEls), "Should not have an empty string prop on form.elements"); ok(!("" in formEls), "Should not have an empty string prop on form.elements");
ise(formEls[""], undefined, "Should not get empty string on form.elements"); is(formEls[""], undefined, "Should not get empty string on form.elements");
ise(formEls.namedItem(""), null, is(formEls.namedItem(""), null,
"namedItem for empty string should return null on form.elements"); "namedItem for empty string should return null on form.elements");
SimpleTest.finish(); SimpleTest.finish();
}); });

View File

@ -14,7 +14,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=999456
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
addEventListener("load", function (e) { addEventListener("load", function (e) {
ise(e.cancelable, false, "Load events should not be cancelable"); is(e.cancelable, false, "Load events should not be cancelable");
SimpleTest.finish(); SimpleTest.finish();
}); });

View File

@ -54,10 +54,10 @@ function testAPIs() {
}); });
Promise.all(promises).then(function(values) { Promise.all(promises).then(function(values) {
for (var i = 0; i < values.length; ++i) { for (var i = 0; i < values.length; ++i) {
ise(values[i], APIEndPoints[i].enabled, is(values[i], APIEndPoints[i].enabled,
"Endpoint " + APIEndPoints[i].name + " resolved with the correct value. " + "Endpoint " + APIEndPoints[i].name + " resolved with the correct value. " +
"If this is failing because you're changing how an API is exposed, you " + "If this is failing because you're changing how an API is exposed, you " +
"must contact the Marketplace team to let them know about the change."); "must contact the Marketplace team to let them know about the change.");
} }
SimpleTest.finish(); SimpleTest.finish();
}, function() { }, function() {

View File

@ -10,7 +10,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=949471
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript"> <script type="application/javascript">
/** Test for Bug 949471 **/ /** Test for Bug 949471 **/
ise(history.state, null, "history.state should be null by default"); is(history.state, null, "history.state should be null by default");
</script> </script>
</head> </head>
<body> <body>

View File

@ -26,27 +26,27 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=930450
var url = new URL('http://www.example.com:8080'); var url = new URL('http://www.example.com:8080');
is(url.port, '8080', 'URL.port is 8080'); is(url.port, '8080', 'URL.port is 8080');
url.port = ''; url.port = '';
ise(url.port, '', 'URL.port is \'\''); is(url.port, '', 'URL.port is \'\'');
url.port = 0; url.port = 0;
ise(url.port, '0', 'URL.port is 0'); is(url.port, '0', 'URL.port is 0');
var link = document.getElementById("link"); var link = document.getElementById("link");
is(link.port, '8080', 'URL.port is 8080'); is(link.port, '8080', 'URL.port is 8080');
link.port = ''; link.port = '';
is(link.href, 'http://www.example.com/', "link.href matches"); is(link.href, 'http://www.example.com/', "link.href matches");
ise(link.port, '', 'URL.port is \'\''); is(link.port, '', 'URL.port is \'\'');
link.port = 0; link.port = 0;
is(link.href, 'http://www.example.com:0/', "link.href matches"); is(link.href, 'http://www.example.com:0/', "link.href matches");
ise(link.port, '0', 'URL.port is 0'); is(link.port, '0', 'URL.port is 0');
var area = document.getElementById("area"); var area = document.getElementById("area");
is(area.port, '8080', 'URL.port is 8080'); is(area.port, '8080', 'URL.port is 8080');
area.port = ''; area.port = '';
is(area.href, 'http://www.example.com/', "area.href matches"); is(area.href, 'http://www.example.com/', "area.href matches");
ise(area.port, '', 'URL.port is \'\''); is(area.port, '', 'URL.port is \'\'');
area.port = 0; area.port = 0;
is(area.href, 'http://www.example.com:0/', "area.href matches"); is(area.href, 'http://www.example.com:0/', "area.href matches");
ise(area.port, '0', 'URL.port is 0'); is(area.port, '0', 'URL.port is 0');
</script> </script>
</body> </body>

View File

@ -15,19 +15,19 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1107443
Object.defineProperty(window, "nosuchprop", { value: 5 }); Object.defineProperty(window, "nosuchprop", { value: 5 });
throw "didn't throw"; throw "didn't throw";
} catch (e) { } catch (e) {
ise(e instanceof TypeError, true, is(e instanceof TypeError, true,
"defineProperty(window) with a non-configurable property should " + "defineProperty(window) with a non-configurable property should " +
"throw a TypeError, instead got: " + e); "throw a TypeError, instead got: " + e);
ise(Object.getOwnPropertyDescriptor(window, "nosuchprop"), undefined, is(Object.getOwnPropertyDescriptor(window, "nosuchprop"), undefined,
'Window should not have property after an attempt to define it failed'); 'Window should not have property after an attempt to define it failed');
} }
Object.defineProperty(window, "nosuchprop", { value: 7, configurable: true }); Object.defineProperty(window, "nosuchprop", { value: 7, configurable: true });
var desc = Object.getOwnPropertyDescriptor(window, "nosuchprop"); var desc = Object.getOwnPropertyDescriptor(window, "nosuchprop");
ise(typeof(desc), "object", "Should have a property now"); is(typeof(desc), "object", "Should have a property now");
ise(desc.configurable, true, "Property should be configurable"); is(desc.configurable, true, "Property should be configurable");
ise(desc.writable, false, "Property should be readonly"); is(desc.writable, false, "Property should be readonly");
ise(desc.value, 7, "Property should have the right value"); is(desc.value, 7, "Property should have the right value");
</script> </script>
</head> </head>
<body> <body>

View File

@ -58,8 +58,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1019417
is(names3.indexOf("crossorigin"), -1, is(names3.indexOf("crossorigin"), -1,
"Frame with cross-origin changed name should not be in GSP own prop list"); "Frame with cross-origin changed name should not be in GSP own prop list");
ise(Object.getOwnPropertyDescriptor(gsp, ""), undefined, is(Object.getOwnPropertyDescriptor(gsp, ""), undefined,
"Should not have empty string as a named frame"); "Should not have empty string as a named frame");
isnot(Object.getOwnPropertyDescriptor(gsp, "x"), undefined, isnot(Object.getOwnPropertyDescriptor(gsp, "x"), undefined,
"Should have about:blank subframe as a named frame"); "Should have about:blank subframe as a named frame");
isnot(Object.getOwnPropertyDescriptor(gsp, "y"), undefined, isnot(Object.getOwnPropertyDescriptor(gsp, "y"), undefined,
@ -68,8 +68,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1019417
"Should have cross-origin subframe as a named frame"); "Should have cross-origin subframe as a named frame");
isnot(Object.getOwnPropertyDescriptor(gsp, "sameorigin"), undefined, isnot(Object.getOwnPropertyDescriptor(gsp, "sameorigin"), undefined,
"Should have same-origin changed name as a named frame"); "Should have same-origin changed name as a named frame");
ise(Object.getOwnPropertyDescriptor(gsp, "crossorigin"), undefined, is(Object.getOwnPropertyDescriptor(gsp, "crossorigin"), undefined,
"Should not have cross-origin-origin changed name as a named frame"); "Should not have cross-origin-origin changed name as a named frame");
SimpleTest.finish(); SimpleTest.finish();
}); });
</script> </script>

View File

@ -28,7 +28,7 @@ function simplePostTest() {
var x = new XMLHttpRequest(); var x = new XMLHttpRequest();
x.open("POST", "echo.sjs"); x.open("POST", "echo.sjs");
x.onload = function() { x.onload = function() {
ise(x.responseText, "somedata", "Should have processed POST"); is(x.responseText, "somedata", "Should have processed POST");
undefinedPostTest(); undefinedPostTest();
} }
x.send({toString: function() { return "somedata"; }}); x.send({toString: function() { return "somedata"; }});
@ -38,7 +38,7 @@ function undefinedPostTest() {
var x = new XMLHttpRequest(); var x = new XMLHttpRequest();
x.open("POST", "echo.sjs"); x.open("POST", "echo.sjs");
x.onload = function() { x.onload = function() {
ise(x.responseText, "undefined", "Should have processed POST"); is(x.responseText, "undefined", "Should have processed POST");
nullPostTest(); nullPostTest();
} }
x.send({toString: function() { return undefined; }}); x.send({toString: function() { return undefined; }});
@ -48,7 +48,7 @@ function nullPostTest() {
var x = new XMLHttpRequest(); var x = new XMLHttpRequest();
x.open("POST", "echo.sjs"); x.open("POST", "echo.sjs");
x.onload = function() { x.onload = function() {
ise(x.responseText, "null", "Should have processed POST"); is(x.responseText, "null", "Should have processed POST");
testExceptionInToString(); testExceptionInToString();
} }
x.send({toString: function() { return null; }}); x.send({toString: function() { return null; }});
@ -64,7 +64,7 @@ function testExceptionInToString() {
try { try {
x.send({toString: function() { throw "dummy"; }}); x.send({toString: function() { throw "dummy"; }});
} catch(ex) { } catch(ex) {
ise(ex, "dummy"); is(ex, "dummy");
SimpleTest.finish(); SimpleTest.finish();
} }
} }

View File

@ -23,14 +23,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=707564
function test() function test()
{ {
var nav = document.getElementById("t1").contentWindow.navigator; var nav = document.getElementById("t1").contentWindow.navigator;
ise(nav.foopy, undefined, "We should have an Xray now"); is(nav.foopy, undefined, "We should have an Xray now");
is(nav.wrappedJSObject.foopy, 5, "We should have the right navigator object"); is(nav.wrappedJSObject.foopy, 5, "We should have the right navigator object");
var props = Object.getOwnPropertyNames(nav); var props = Object.getOwnPropertyNames(nav);
isnot(props.indexOf("mozApps"), -1, isnot(props.indexOf("mozApps"), -1,
"Should enumerate a mozApps property on navigator xray"); "Should enumerate a mozApps property on navigator xray");
var nav = document.getElementById("t2").contentWindow.navigator; var nav = document.getElementById("t2").contentWindow.navigator;
ise(nav.foopy, undefined, "We should have an Xray now again"); is(nav.foopy, undefined, "We should have an Xray now again");
is(nav.wrappedJSObject.foopy, 5, "We should have the right navigator object again"); is(nav.wrappedJSObject.foopy, 5, "We should have the right navigator object again");
var found = false; var found = false;
for (var name in nav) { for (var name in nav) {

View File

@ -15,7 +15,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=957929
function f() { function f() {
"use strict"; "use strict";
ise(this, undefined, "Should have undefined this value"); is(this, undefined, "Should have undefined this value");
SimpleTest.finish(); SimpleTest.finish();
} }

View File

@ -23,7 +23,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1041731
function test() function test()
{ {
var loc = document.getElementById("t").contentWindow.document.location; var loc = document.getElementById("t").contentWindow.document.location;
ise(loc.toString, loc.toString, "Unforgeable method on the Xray should be cached"); is(loc.toString, loc.toString, "Unforgeable method on the Xray should be cached");
SimpleTest.finish(); SimpleTest.finish();
} }

View File

@ -32,16 +32,16 @@ function checkXrayProperty(obj, name, values)
var value = values.shift(); var value = values.shift();
if (typeof value == "undefined") { if (typeof value == "undefined") {
ok(!obj.hasOwnProperty(name), "hasOwnProperty shouldn't see \"" + name + "\" through Xrays"); ok(!obj.hasOwnProperty(name), "hasOwnProperty shouldn't see \"" + name + "\" through Xrays");
ise(Object.getOwnPropertyDescriptor(obj, name), undefined, "getOwnPropertyDescriptor shouldn't see \"" + name + "\" through Xrays"); is(Object.getOwnPropertyDescriptor(obj, name), undefined, "getOwnPropertyDescriptor shouldn't see \"" + name + "\" through Xrays");
ok(Object.keys(obj).indexOf(name) == -1, "Enumerating the Xray should not return \"" + name + "\""); ok(Object.keys(obj).indexOf(name) == -1, "Enumerating the Xray should not return \"" + name + "\"");
} else { } else {
ok(obj.hasOwnProperty(name), "hasOwnProperty should see \"" + name + "\" through Xrays"); ok(obj.hasOwnProperty(name), "hasOwnProperty should see \"" + name + "\" through Xrays");
var pd = Object.getOwnPropertyDescriptor(obj, name); var pd = Object.getOwnPropertyDescriptor(obj, name);
ok(pd, "getOwnPropertyDescriptor should see \"" + name + "\" through Xrays"); ok(pd, "getOwnPropertyDescriptor should see \"" + name + "\" through Xrays");
if (pd && pd.get) { if (pd && pd.get) {
ise(pd.get.call(instance), value, "Should get the right value for \"" + name + "\" through Xrays"); is(pd.get.call(instance), value, "Should get the right value for \"" + name + "\" through Xrays");
} else { } else {
ise(obj[name], value, "Should get the right value for \"" + name + "\" through Xrays"); is(obj[name], value, "Should get the right value for \"" + name + "\" through Xrays");
} }
if (pd && pd.enumerable) { if (pd && pd.enumerable) {
ok(Object.keys(obj).indexOf("" + name) > -1, "Enumerating the Xray should return \"" + name + "\""); ok(Object.keys(obj).indexOf("" + name) > -1, "Enumerating the Xray should return \"" + name + "\"");
@ -62,13 +62,13 @@ function test()
var doc = document.getElementById("t").contentDocument; var doc = document.getElementById("t").contentDocument;
var winProto = Object.getPrototypeOf(win); var winProto = Object.getPrototypeOf(win);
ise(winProto, win.Window.prototype, "The proto chain of the Xray should mirror the prototype chain of the Xrayed object"); is(winProto, win.Window.prototype, "The proto chain of the Xray should mirror the prototype chain of the Xrayed object");
var namedPropertiesObject = Object.getPrototypeOf(winProto); var namedPropertiesObject = Object.getPrototypeOf(winProto);
ise(Cu.getClassName(namedPropertiesObject, /* unwrap = */ true), "WindowProperties", "The proto chain of the Xray should mirror the prototype chain of the Xrayed object"); is(Cu.getClassName(namedPropertiesObject, /* unwrap = */ true), "WindowProperties", "The proto chain of the Xray should mirror the prototype chain of the Xrayed object");
var eventTargetProto = Object.getPrototypeOf(namedPropertiesObject); var eventTargetProto = Object.getPrototypeOf(namedPropertiesObject);
ise(eventTargetProto, win.EventTarget.prototype, "The proto chain of the Xray should mirror the prototype chain of the Xrayed object"); is(eventTargetProto, win.EventTarget.prototype, "The proto chain of the Xray should mirror the prototype chain of the Xrayed object");
// Xrays need to filter expandos. // Xrays need to filter expandos.
checkWindowXrayProperty(win, "expando", undefined); checkWindowXrayProperty(win, "expando", undefined);
@ -94,44 +94,44 @@ function test()
while ((proto = Object.getPrototypeOf(obj))) { while ((proto = Object.getPrototypeOf(obj))) {
obj = proto; obj = proto;
} }
ise(obj, win.Object.prototype, "Object.prototype should be at the end of the prototype chain"); is(obj, win.Object.prototype, "Object.prototype should be at the end of the prototype chain");
// Named properties shouldn't shadow WebIDL- or ECMAScript-defined properties. // Named properties shouldn't shadow WebIDL- or ECMAScript-defined properties.
checkWindowXrayProperty(win, "addEventListener", undefined, undefined, undefined, eventTargetProto.addEventListener); checkWindowXrayProperty(win, "addEventListener", undefined, undefined, undefined, eventTargetProto.addEventListener);
ise(win.addEventListener, eventTargetProto.addEventListener, "Named properties shouldn't shadow WebIDL-defined properties"); is(win.addEventListener, eventTargetProto.addEventListener, "Named properties shouldn't shadow WebIDL-defined properties");
ise(win.toString, win.Object.prototype.toString, "Named properties shouldn't shadow ECMAScript-defined properties"); is(win.toString, win.Object.prototype.toString, "Named properties shouldn't shadow ECMAScript-defined properties");
// HTMLDocument // HTMLDocument
// Unforgeable properties live on the instance. // Unforgeable properties live on the instance.
checkXrayProperty(doc, "location", [ win.location ]); checkXrayProperty(doc, "location", [ win.location ]);
ise(String(win.location), document.getElementById("t").src, is(String(win.location), document.getElementById("t").src,
"Should have the right stringification"); "Should have the right stringification");
// HTMLHtmlElement // HTMLHtmlElement
var elem = doc.documentElement; var elem = doc.documentElement;
var elemProto = Object.getPrototypeOf(elem); var elemProto = Object.getPrototypeOf(elem);
ise(elemProto, win.HTMLHtmlElement.prototype, "The proto chain of the Xray should mirror the prototype chain of the Xrayed object"); is(elemProto, win.HTMLHtmlElement.prototype, "The proto chain of the Xray should mirror the prototype chain of the Xrayed object");
elemProto = Object.getPrototypeOf(elemProto); elemProto = Object.getPrototypeOf(elemProto);
ise(elemProto, win.HTMLElement.prototype, "The proto chain of the Xray should mirror the prototype chain of the Xrayed object"); is(elemProto, win.HTMLElement.prototype, "The proto chain of the Xray should mirror the prototype chain of the Xrayed object");
elemProto = Object.getPrototypeOf(elemProto); elemProto = Object.getPrototypeOf(elemProto);
ise(elemProto, win.Element.prototype, "The proto chain of the Xray should mirror the prototype chain of the Xrayed object"); is(elemProto, win.Element.prototype, "The proto chain of the Xray should mirror the prototype chain of the Xrayed object");
elemProto = Object.getPrototypeOf(elemProto); elemProto = Object.getPrototypeOf(elemProto);
ise(elemProto, win.Node.prototype, "The proto chain of the Xray should mirror the prototype chain of the Xrayed object"); is(elemProto, win.Node.prototype, "The proto chain of the Xray should mirror the prototype chain of the Xrayed object");
elemProto = Object.getPrototypeOf(elemProto); elemProto = Object.getPrototypeOf(elemProto);
ise(elemProto, win.EventTarget.prototype, "The proto chain of the Xray should mirror the prototype chain of the Xrayed object"); is(elemProto, win.EventTarget.prototype, "The proto chain of the Xray should mirror the prototype chain of the Xrayed object");
// Xrays need to filter expandos. // Xrays need to filter expandos.
ok(!("expando" in elem), "Xrays should filter expandos"); ok(!("expando" in elem), "Xrays should filter expandos");
// WebIDL-defined properties live on the prototype. // WebIDL-defined properties live on the prototype.
checkXrayProperty(elem, "version", [ undefined, "" ]); checkXrayProperty(elem, "version", [ undefined, "" ]);
ise(elem.version, "", "WebIDL properties should be exposed through Xrays"); is(elem.version, "", "WebIDL properties should be exposed through Xrays");
// HTMLCollection // HTMLCollection
var coll = doc.getElementsByTagName("iframe"); var coll = doc.getElementsByTagName("iframe");

View File

@ -22,16 +22,16 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1107592
ok(e instanceof Error, "Should have an Error here"); ok(e instanceof Error, "Should have an Error here");
ok(!(e instanceof DOMException), "Should not have DOMException here"); ok(!(e instanceof DOMException), "Should not have DOMException here");
ok(!("code" in e), "Should not have a 'code' property"); ok(!("code" in e), "Should not have a 'code' property");
ise(e.name, "Error", "Should not have an interesting name here"); is(e.name, "Error", "Should not have an interesting name here");
ise(e.message, "We are a DOMError", "Should have the right message"); is(e.message, "We are a DOMError", "Should have the right message");
ise(e.stack, is(e.stack,
"doTest@http://mochi.test:8888/tests/dom/bindings/test/test_exception_options_from_jsimplemented.html:20:7\n", "doTest@http://mochi.test:8888/tests/dom/bindings/test/test_exception_options_from_jsimplemented.html:20:7\n",
"Exception stack should still only show our code"); "Exception stack should still only show our code");
ise(e.fileName, is(e.fileName,
"http://mochi.test:8888/tests/dom/bindings/test/test_exception_options_from_jsimplemented.html", "http://mochi.test:8888/tests/dom/bindings/test/test_exception_options_from_jsimplemented.html",
"Should have the right file name"); "Should have the right file name");
ise(e.lineNumber, 20, "Should have the right line number"); is(e.lineNumber, 20, "Should have the right line number");
ise(e.columnNumber, 6, "Should have the right column number"); is(e.columnNumber, 6, "Should have the right column number");
} }
try { try {
@ -39,18 +39,18 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1107592
} catch (e) { } catch (e) {
ok(e instanceof Error, "Should also have an Error here"); ok(e instanceof Error, "Should also have an Error here");
ok(e instanceof DOMException, "Should have DOMException here"); ok(e instanceof DOMException, "Should have DOMException here");
ise(e.name, "NotSupportedError", "Should have the right name here"); is(e.name, "NotSupportedError", "Should have the right name here");
ise(e.message, "We are a DOMException", is(e.message, "We are a DOMException",
"Should also have the right message"); "Should also have the right message");
ise(e.code, DOMException.NOT_SUPPORTED_ERR, is(e.code, DOMException.NOT_SUPPORTED_ERR,
"Should have the right 'code'"); "Should have the right 'code'");
ise(e.stack, is(e.stack,
"doTest@http://mochi.test:8888/tests/dom/bindings/test/test_exception_options_from_jsimplemented.html:38:7\n", "doTest@http://mochi.test:8888/tests/dom/bindings/test/test_exception_options_from_jsimplemented.html:38:7\n",
"Exception stack should still only show our code"); "Exception stack should still only show our code");
ise(e.filename, is(e.filename,
"http://mochi.test:8888/tests/dom/bindings/test/test_exception_options_from_jsimplemented.html", "http://mochi.test:8888/tests/dom/bindings/test/test_exception_options_from_jsimplemented.html",
"Should still have the right file name"); "Should still have the right file name");
ise(e.lineNumber, 38, "Should still have the right line number"); is(e.lineNumber, 38, "Should still have the right line number");
todo_is(e.columnNumber, 7, todo_is(e.columnNumber, 7,
"No column number support for DOMException yet"); "No column number support for DOMException yet");
} }

View File

@ -15,20 +15,20 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1107592
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
function checkExn(lineNumber, name, message, code, filename, testNumber, stack, exn) { function checkExn(lineNumber, name, message, code, filename, testNumber, stack, exn) {
ise(exn.lineNumber, lineNumber, is(exn.lineNumber, lineNumber,
"Should have the right line number in test " + testNumber); "Should have the right line number in test " + testNumber);
ise(exn.name, name, is(exn.name, name,
"Should have the right exception name in test " + testNumber); "Should have the right exception name in test " + testNumber);
ise("filename" in exn ? exn.filename : exn.fileName, filename, is("filename" in exn ? exn.filename : exn.fileName, filename,
"Should have the right file name in test " + testNumber); "Should have the right file name in test " + testNumber);
ise(exn.message, message, is(exn.message, message,
"Should have the right message in test " + testNumber); "Should have the right message in test " + testNumber);
ise(exn.code, code, "Should have the right .code in test " + testNumber); is(exn.code, code, "Should have the right .code in test " + testNumber);
if (message === "") { if (message === "") {
ise(exn.name, "NS_ERROR_UNEXPECTED", is(exn.name, "NS_ERROR_UNEXPECTED",
"Should have one of our synthetic exceptions in test " + testNumber); "Should have one of our synthetic exceptions in test " + testNumber);
} }
ise(exn.stack, stack, "Should have the right stack in test " + testNumber); is(exn.stack, stack, "Should have the right stack in test " + testNumber);
} }
function ensurePromiseFail(testNumber, value) { function ensurePromiseFail(testNumber, value) {

View File

@ -22,7 +22,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1066432
testInterfaceJS.testSequenceOverload(nonIterableObject); testInterfaceJS.testSequenceOverload(nonIterableObject);
ok(false, "Should have thrown in the overload case"); // see long comment above! ok(false, "Should have thrown in the overload case"); // see long comment above!
} catch (e) { } catch (e) {
ise(e.name, "TypeError", "Should get a TypeError for the overload case"); is(e.name, "TypeError", "Should get a TypeError for the overload case");
ok(e.message.includes("not iterable"), ok(e.message.includes("not iterable"),
"Should have a message about being non-iterable in the overload case"); "Should have a message about being non-iterable in the overload case");
} }
@ -31,7 +31,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1066432
testInterfaceJS.testSequenceUnion(nonIterableObject); testInterfaceJS.testSequenceUnion(nonIterableObject);
ok(false, "Should have thrown in the union case"); ok(false, "Should have thrown in the union case");
} catch (e) { } catch (e) {
ise(e.name, "TypeError", "Should get a TypeError for the union case"); is(e.name, "TypeError", "Should get a TypeError for the union case");
ok(e.message.includes("not iterable"), ok(e.message.includes("not iterable"),
"Should have a message about being non-iterable in the union case"); "Should have a message about being non-iterable in the union case");
} }

View File

@ -22,15 +22,15 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1043690
/** Test for Bug 1043690 **/ /** Test for Bug 1043690 **/
var f = document.querySelector("form"); var f = document.querySelector("form");
var i = document.querySelector("input"); var i = document.querySelector("input");
ise(f.getAttribute("action"), null, "Should have no action attribute"); is(f.getAttribute("action"), null, "Should have no action attribute");
ise(f.action, i, "form.action should be the input"); is(f.action, i, "form.action should be the input");
f.action = "http://example.org"; f.action = "http://example.org";
ise(f.getAttribute("action"), "http://example.org", is(f.getAttribute("action"), "http://example.org",
"Should have an action attribute now"); "Should have an action attribute now");
ise(f.action, i, "form.action should still be the input"); is(f.action, i, "form.action should still be the input");
i.remove(); i.remove();
ise(f.action, "http://example.org/", is(f.action, "http://example.org/",
"form.action should no longer be shadowed"); "form.action should no longer be shadowed");
</script> </script>

View File

@ -17,13 +17,13 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=952365
(function() { (function() {
onvolumechange = x; onvolumechange = x;
ise(onvolumechange, x, is(onvolumechange, x,
"Should preserve an object value when assigning to event handler"); "Should preserve an object value when assigning to event handler");
// Test that we don't try to actually call the non-callable object // Test that we don't try to actually call the non-callable object
window.dispatchEvent(new Event("volumechange")); window.dispatchEvent(new Event("volumechange"));
onvolumechange = 5; onvolumechange = 5;
ise(onvolumechange, null, is(onvolumechange, null,
"Non-object values should become null when assigning to event handler"); "Non-object values should become null when assigning to event handler");
})(); })();
</script> </script>
</head> </head>

View File

@ -454,4 +454,4 @@ CameraTestSuite.prototype = {
}, },
}; };
ise(SpecialPowers.sanityCheck(), "foo", "SpecialPowers passed sanity check"); is(SpecialPowers.sanityCheck(), "foo", "SpecialPowers passed sanity check");

View File

@ -249,7 +249,7 @@ function checkStrArray(str1, str2, msg) {
} }
str1 = optArray(str1).map(normalize_falsy).filter(v => v != ""); str1 = optArray(str1).map(normalize_falsy).filter(v => v != "");
str2 = optArray(str2).map(normalize_falsy).filter(v => v != ""); str2 = optArray(str2).map(normalize_falsy).filter(v => v != "");
ise(JSON.stringify(str1), JSON.stringify(str2), msg); is(JSON.stringify(str1), JSON.stringify(str2), msg);
} }
function checkPref(pref1, pref2) { function checkPref(pref1, pref2) {
@ -260,7 +260,7 @@ function checkPref(pref1, pref2) {
pref2 = false; pref2 = false;
} }
} }
ise(!!pref1, !!pref2, "Same pref"); is(!!pref1, !!pref2, "Same pref");
} }
function checkAddress(adr1, adr2) { function checkAddress(adr1, adr2) {
@ -332,7 +332,7 @@ function checkArrayField(array1, array2, func, msg) {
ok(true, msg); ok(true, msg);
return; return;
} }
ise(array1.length, array2.length, "Same length"); is(array1.length, array2.length, "Same length");
for (var i = 0; i < array1.length; ++i) { for (var i = 0; i < array1.length; ++i) {
func(array1[i], array2[i], msg); func(array1[i], array2[i], msg);
} }

View File

@ -702,13 +702,13 @@ var steps = [
impp: [{value: undefined}], impp: [{value: undefined}],
tel: [{value: undefined}], tel: [{value: undefined}],
}); });
ise(c.adr[0].streetAddress, undefined, "adr.streetAddress is undefined"); is(c.adr[0].streetAddress, undefined, "adr.streetAddress is undefined");
ise(c.adr[0].locality, undefined, "adr.locality is undefined"); is(c.adr[0].locality, undefined, "adr.locality is undefined");
ise(c.adr[0].pref, undefined, "adr.pref is undefined"); is(c.adr[0].pref, undefined, "adr.pref is undefined");
ise(c.email[0].value, undefined, "email.value is undefined"); is(c.email[0].value, undefined, "email.value is undefined");
ise(c.url[0].value, undefined, "url.value is undefined"); is(c.url[0].value, undefined, "url.value is undefined");
ise(c.impp[0].value, undefined, "impp.value is undefined"); is(c.impp[0].value, undefined, "impp.value is undefined");
ise(c.tel[0].value, undefined, "tel.value is undefined"); is(c.tel[0].value, undefined, "tel.value is undefined");
next(); next();
}, },
function() { function() {
@ -764,7 +764,7 @@ var steps = [
req.onsuccess = function() { req.onsuccess = function() {
req = navigator.mozContacts.find(defaultOptions); req = navigator.mozContacts.find(defaultOptions);
req.onsuccess = function() { req.onsuccess = function() {
ise(req.result.length, 1, "Got 1 contact"); is(req.result.length, 1, "Got 1 contact");
checkContacts(req.result[0], properties1); checkContacts(req.result[0], properties1);
next(); next();
}; };
@ -788,7 +788,7 @@ var steps = [
ok(true, "mozContact.init works as expected"); ok(true, "mozContact.init works as expected");
var c = new mozContact({name: ["Foo"]}); var c = new mozContact({name: ["Foo"]});
c.init({name: ["Bar"]}); c.init({name: ["Bar"]});
ise(c.name[0], "Bar", "Same name"); is(c.name[0], "Bar", "Same name");
next(); next();
}, },
function() { function() {
@ -801,7 +801,7 @@ var steps = [
ok(true, "mozContact.init resets properties"); ok(true, "mozContact.init resets properties");
var c = new mozContact({jobTitle: ["Software Engineer"]}); var c = new mozContact({jobTitle: ["Software Engineer"]});
c.init({nickname: ["Jobless Johnny"]}); c.init({nickname: ["Jobless Johnny"]});
ise(c.nickname[0], "Jobless Johnny", "Same nickname"); is(c.nickname[0], "Jobless Johnny", "Same nickname");
ok(!c.jobTitle, "jobTitle is not set"); ok(!c.jobTitle, "jobTitle is not set");
next(); next();
}, },
@ -818,7 +818,7 @@ var steps = [
filterValue: c.id filterValue: c.id
}); });
req.onsuccess = function() { req.onsuccess = function() {
ise(req.result.length, 0, "Successfully removed contact by ID"); is(req.result.length, 0, "Successfully removed contact by ID");
next(); next();
}; };
req.onerror = onFailure; req.onerror = onFailure;

View File

@ -96,8 +96,8 @@ function verifyBlob(blob1, blob2, isLast)
"blob1 is an instance of File"); "blob1 is an instance of File");
isnot(blob2 instanceof File, true, isnot(blob2 instanceof File, true,
"blob2 is an instance of File"); "blob2 is an instance of File");
ise(blob1.size, blob2.size, "Same size"); is(blob1.size, blob2.size, "Same size");
ise(blob1.type, blob2.type, "Same type"); is(blob1.type, blob2.type, "Same type");
var buffer1; var buffer1;
var buffer2; var buffer2;
@ -125,7 +125,7 @@ function verifyBlobArray(blobs1, blobs2)
{ {
is(blobs1 instanceof Array, true, "blobs1 is an array object"); is(blobs1 instanceof Array, true, "blobs1 is an array object");
is(blobs2 instanceof Array, true, "blobs2 is an array object"); is(blobs2 instanceof Array, true, "blobs2 is an array object");
ise(blobs1.length, blobs2.length, "Same length"); is(blobs1.length, blobs2.length, "Same length");
if (!blobs1.length) { if (!blobs1.length) {
next(); next();

View File

@ -95,9 +95,9 @@ var steps = [
filterValue: number1.local}; filterValue: number1.local};
req = mozContacts.find(options); req = mozContacts.find(options);
req.onsuccess = function () { req.onsuccess = function () {
ise(req.result.length, 1, "Found exactly 1 contact."); is(req.result.length, 1, "Found exactly 1 contact.");
findResult1 = req.result[0]; findResult1 = req.result[0];
ise(findResult1.id, sample_id1, "Same ID"); is(findResult1.id, sample_id1, "Same ID");
next(); next();
}; };
req.onerror = onFailure; req.onerror = onFailure;
@ -109,7 +109,7 @@ var steps = [
filterValue: number1.international}; filterValue: number1.international};
req = mozContacts.find(options); req = mozContacts.find(options);
req.onsuccess = function () { req.onsuccess = function () {
ise(req.result.length, 0, "Found exactly 0 contacts."); is(req.result.length, 0, "Found exactly 0 contacts.");
next(); next();
}; };
req.onerror = onFailure; req.onerror = onFailure;
@ -122,7 +122,7 @@ var steps = [
filterValue: shortNumber}; filterValue: shortNumber};
req = mozContacts.find(options); req = mozContacts.find(options);
req.onsuccess = function() { req.onsuccess = function() {
ise(req.result.length, 0, "The prefix short number should not match any contact."); is(req.result.length, 0, "The prefix short number should not match any contact.");
next(); next();
}; };
req.onerror = onFailure; req.onerror = onFailure;
@ -135,7 +135,7 @@ var steps = [
filterValue: shortNumber}; filterValue: shortNumber};
req = mozContacts.find(options); req = mozContacts.find(options);
req.onsuccess = function() { req.onsuccess = function() {
ise(req.result.length, 0, "The suffix short number should not match any contact."); is(req.result.length, 0, "The suffix short number should not match any contact.");
next(); next();
}; };
req.onerror = onFailure; req.onerror = onFailure;
@ -147,7 +147,7 @@ var steps = [
filterValue: shortNumber}; filterValue: shortNumber};
req = mozContacts.find(options); req = mozContacts.find(options);
req.onsuccess = function() { req.onsuccess = function() {
ise(req.result.length, 1, "Found the contact equally matching the shortNumber."); is(req.result.length, 1, "Found the contact equally matching the shortNumber.");
next(); next();
}; };
req.onerror = onFailure; req.onerror = onFailure;
@ -171,7 +171,7 @@ var steps = [
filterValue: number1.local}; filterValue: number1.local};
req = mozContacts.find(options); req = mozContacts.find(options);
req.onsuccess = function () { req.onsuccess = function () {
ise(req.result.length, 0, "Found exactly 0 contact."); is(req.result.length, 0, "Found exactly 0 contact.");
next(); next();
}; };
req.onerror = onFailure; req.onerror = onFailure;
@ -183,7 +183,7 @@ var steps = [
filterValue: number1.international}; filterValue: number1.international};
req = mozContacts.find(options); req = mozContacts.find(options);
req.onsuccess = function () { req.onsuccess = function () {
ise(req.result.length, 0, "Found exactly 0 contact."); is(req.result.length, 0, "Found exactly 0 contact.");
next(); next();
}; };
req.onerror = onFailure; req.onerror = onFailure;
@ -195,9 +195,9 @@ var steps = [
filterValue: number2.local}; filterValue: number2.local};
req = mozContacts.find(options); req = mozContacts.find(options);
req.onsuccess = function () { req.onsuccess = function () {
ise(req.result.length, 1, "Found exactly 1 contact."); is(req.result.length, 1, "Found exactly 1 contact.");
findResult1 = req.result[0]; findResult1 = req.result[0];
ise(findResult1.id, sample_id1, "Same ID"); is(findResult1.id, sample_id1, "Same ID");
next(); next();
}; };
req.onerror = onFailure; req.onerror = onFailure;
@ -209,7 +209,7 @@ var steps = [
filterValue: number2.international}; filterValue: number2.international};
req = mozContacts.find(options); req = mozContacts.find(options);
req.onsuccess = function () { req.onsuccess = function () {
ise(req.result.length, 0, "Found exactly 1 contact."); is(req.result.length, 0, "Found exactly 1 contact.");
next(); next();
}; };
req.onerror = onFailure; req.onerror = onFailure;
@ -241,9 +241,9 @@ var steps = [
filterValue: number3.local}; filterValue: number3.local};
req = mozContacts.find(options); req = mozContacts.find(options);
req.onsuccess = function () { req.onsuccess = function () {
ise(req.result.length, 1, "Found exactly 1 contact."); is(req.result.length, 1, "Found exactly 1 contact.");
findResult1 = req.result[0]; findResult1 = req.result[0];
ise(findResult1.id, sample_id1, "Same ID"); is(findResult1.id, sample_id1, "Same ID");
next(); next();
}; };
req.onerror = onFailure; req.onerror = onFailure;

View File

@ -54,9 +54,9 @@ var steps = [
filterValue: number.international filterValue: number.international
}); });
req.onsuccess = function () { req.onsuccess = function () {
ise(req.result.length, 1, "Found exactly 1 contact."); is(req.result.length, 1, "Found exactly 1 contact.");
findResult1 = req.result[0]; findResult1 = req.result[0];
ise(findResult1.id, sample_id1, "Same ID"); is(findResult1.id, sample_id1, "Same ID");
next(); next();
}; };
req.onerror = onFailure; req.onerror = onFailure;
@ -69,7 +69,7 @@ var steps = [
filterValue: number.local filterValue: number.local
}); });
req.onsuccess = function () { req.onsuccess = function () {
ise(req.result.length, 1, "Found 0 contacts."); is(req.result.length, 1, "Found 0 contacts.");
next(); next();
}; };
req.onerror = onFailure; req.onerror = onFailure;
@ -92,7 +92,7 @@ var steps = [
ok(true, "Retrieving all contacts"); ok(true, "Retrieving all contacts");
req = mozContacts.find({}); req = mozContacts.find({});
req.onsuccess = function () { req.onsuccess = function () {
ise(req.result.length, 1, "One contact."); is(req.result.length, 1, "One contact.");
findResult1 = req.result[0]; findResult1 = req.result[0];
next(); next();
}; };
@ -106,10 +106,10 @@ var steps = [
filterValue: number.international.slice(-8) filterValue: number.international.slice(-8)
}); });
req.onsuccess = function () { req.onsuccess = function () {
ise(req.result.length, 1, "Found exactly 1 contact."); is(req.result.length, 1, "Found exactly 1 contact.");
findResult1 = req.result[0]; findResult1 = req.result[0];
ise(findResult1.id, sample_id1, "Same ID"); is(findResult1.id, sample_id1, "Same ID");
ise(findResult1.tel[0].value, number.international, "Same Value"); is(findResult1.tel[0].value, number.international, "Same Value");
next(); next();
}; };
req.onerror = onFailure; req.onerror = onFailure;
@ -122,10 +122,10 @@ var steps = [
filterValue: number.international.slice(-9) filterValue: number.international.slice(-9)
}); });
req.onsuccess = function () { req.onsuccess = function () {
ise(req.result.length, 1, "Found exactly 1 contact."); is(req.result.length, 1, "Found exactly 1 contact.");
findResult1 = req.result[0]; findResult1 = req.result[0];
ise(findResult1.id, sample_id1, "Same ID"); is(findResult1.id, sample_id1, "Same ID");
ise(findResult1.tel[0].value, number.international, "Same Value"); is(findResult1.tel[0].value, number.international, "Same Value");
next(); next();
}; };
req.onerror = onFailure; req.onerror = onFailure;
@ -138,7 +138,7 @@ var steps = [
filterValue: number.international.slice(-6) filterValue: number.international.slice(-6)
}); });
req.onsuccess = function () { req.onsuccess = function () {
ise(req.result.length, 0, "Found exactly zero contacts."); is(req.result.length, 0, "Found exactly zero contacts.");
next(); next();
}; };
req.onerror = onFailure; req.onerror = onFailure;
@ -161,7 +161,7 @@ var steps = [
ok(true, "Retrieving all contacts"); ok(true, "Retrieving all contacts");
req = mozContacts.find({}); req = mozContacts.find({});
req.onsuccess = function () { req.onsuccess = function () {
ise(req.result.length, 1, "One contact."); is(req.result.length, 1, "One contact.");
findResult1 = req.result[0]; findResult1 = req.result[0];
next(); next();
}; };
@ -175,10 +175,10 @@ var steps = [
filterValue: "022" + landlineNumber.slice(-7) filterValue: "022" + landlineNumber.slice(-7)
}); });
req.onsuccess = function () { req.onsuccess = function () {
ise(req.result.length, 1, "Found exactly 1 contact."); is(req.result.length, 1, "Found exactly 1 contact.");
findResult1 = req.result[0]; findResult1 = req.result[0];
ise(findResult1.id, sample_id1, "Same ID"); is(findResult1.id, sample_id1, "Same ID");
ise(findResult1.tel[0].value, landlineNumber, "Same Value"); is(findResult1.tel[0].value, landlineNumber, "Same Value");
next(); next();
}; };
req.onerror = onFailure; req.onerror = onFailure;

View File

@ -86,7 +86,7 @@ var steps = [
var req = mozContacts.getCount(); var req = mozContacts.getCount();
req.onsuccess = function onsuccess() { req.onsuccess = function onsuccess() {
ok(true, "Could access the mozContacts API"); ok(true, "Could access the mozContacts API");
ise(this.result, contactsCount, "Contacts count is correct"); is(this.result, contactsCount, "Contacts count is correct");
next(); next();
}; };
@ -104,7 +104,7 @@ var steps = [
var req = mozContacts.find(); var req = mozContacts.find();
req.onsuccess = function onsuccess() { req.onsuccess = function onsuccess() {
if (this.result) { if (this.result) {
ise(this.result.length, contactsCount, "Contacts array length is correct"); is(this.result.length, contactsCount, "Contacts array length is correct");
allContacts = this.result; allContacts = this.result;
next(); next();
} else { } else {

View File

@ -48,7 +48,7 @@ var steps = [
SpecialPowers.pushPermissions([ SpecialPowers.pushPermissions([
{type: "downloads", allow: 0, context: document} {type: "downloads", allow: 0, context: document}
], function() { ], function() {
ise(frames[0].navigator.mozDownloadManager, null, "navigator.mozDownloadManager is null when the page doesn't have permissions"); is(frames[0].navigator.mozDownloadManager, null, "navigator.mozDownloadManager is null when the page doesn't have permissions");
next(); next();
}); });
}, },
@ -57,7 +57,7 @@ var steps = [
SpecialPowers.pushPrefEnv({ SpecialPowers.pushPrefEnv({
set: [["dom.mozDownloads.enabled", false]] set: [["dom.mozDownloads.enabled", false]]
}, function() { }, function() {
ise(navigator.mozDownloadManager, undefined, "navigator.mozDownloadManager is undefined"); is(navigator.mozDownloadManager, undefined, "navigator.mozDownloadManager is undefined");
next(); next();
}); });
}, },

View File

@ -29,7 +29,7 @@ function testWidthHeight(attr) {
is(element.getAttribute(attr), '12', 'setting ' + attr + ' changes the content attribute'); is(element.getAttribute(attr), '12', 'setting ' + attr + ' changes the content attribute');
element.removeAttribute(attr); element.removeAttribute(attr);
ise(element.getAttribute(attr), null); is(element.getAttribute(attr), null);
element = document.createElement('input'); element = document.createElement('input');
element.type = 'image'; element.type = 'image';
@ -46,7 +46,7 @@ function testWidthHeight(attr) {
is(element.getAttribute(attr), '12', 'setting ' + attr + ' changes the content attribute'); is(element.getAttribute(attr), '12', 'setting ' + attr + ' changes the content attribute');
element.removeAttribute(attr); element.removeAttribute(attr);
ise(element.getAttribute(attr), null); is(element.getAttribute(attr), null);
} }
// .accept // .accept

View File

@ -66,8 +66,8 @@ function checkAutocompleteValues(field, type) {
field.removeAttribute("autocomplete"); field.removeAttribute("autocomplete");
else else
field.setAttribute("autocomplete", test[0]); field.setAttribute("autocomplete", test[0]);
ise(field.autocomplete, test[1], "Checking @autocomplete for @type=" + type + " of: " + test[0]); is(field.autocomplete, test[1], "Checking @autocomplete for @type=" + type + " of: " + test[0]);
ise(field.autocomplete, test[1], "Checking cached @autocomplete for @type=" + type + " of: " + test[0]); is(field.autocomplete, test[1], "Checking cached @autocomplete for @type=" + type + " of: " + test[0]);
} }
} }

View File

@ -22,7 +22,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=779723
/** Test for Bug 779723 **/ /** Test for Bug 779723 **/
var rdoList = document.forms[0].elements.namedItem('rdo'); var rdoList = document.forms[0].elements.namedItem('rdo');
ise(rdoList.value, "", "The value attribute should be empty"); is(rdoList.value, "", "The value attribute should be empty");
document.getElementById('r2').checked = true; document.getElementById('r2').checked = true;
ok(rdoList.value, "2", "The value attribute should be 2"); ok(rdoList.value, "2", "The value attribute should be 2");
@ -33,20 +33,20 @@ ok(rdoList.value, "on", "The value attribute should be on");
document.getElementById('r1').value = 1; document.getElementById('r1').value = 1;
ok(rdoList.value, "1", "The value attribute should be 1"); ok(rdoList.value, "1", "The value attribute should be 1");
ise(rdoList.value, document.getElementById('r1').value, is(rdoList.value, document.getElementById('r1').value,
"The value attribute should be equal to the first checked radio input element's value"); "The value attribute should be equal to the first checked radio input element's value");
ok(!document.getElementById('r2').checked, ok(!document.getElementById('r2').checked,
"The second radio input element should not be checked"); "The second radio input element should not be checked");
rdoList.value = '2'; rdoList.value = '2';
ise(rdoList.value, document.getElementById('r2').value, is(rdoList.value, document.getElementById('r2').value,
"The value attribute should be equal to the second radio input element's value"); "The value attribute should be equal to the second radio input element's value");
ok(document.getElementById('r2').checked, ok(document.getElementById('r2').checked,
"The second radio input element should be checked"); "The second radio input element should be checked");
rdoList.value = '3'; rdoList.value = '3';
ise(rdoList.value, document.getElementById('r2').value, is(rdoList.value, document.getElementById('r2').value,
"The value attribute should be the second radio input element's value"); "The value attribute should be the second radio input element's value");
ok(document.getElementById('r2').checked, ok(document.getElementById('r2').checked,
"The second radio input element should be checked"); "The second radio input element should be checked");

View File

@ -273,7 +273,7 @@ function reflectLimitedEnumerated(aParameters)
if (nullable) { if (nullable) {
// The missing value default is null, which is typeof == "object" // The missing value default is null, which is typeof == "object"
is(typeof element[idlAttr], "object", "'" + idlAttr + "' IDL attribute should be null, which has typeof == object"); is(typeof element[idlAttr], "object", "'" + idlAttr + "' IDL attribute should be null, which has typeof == object");
ise(element[idlAttr], null, "'" + idlAttr + "' IDL attribute should be null"); is(element[idlAttr], null, "'" + idlAttr + "' IDL attribute should be null");
} else { } else {
is(typeof element[idlAttr], "string", "'" + idlAttr + "' IDL attribute should be a string"); is(typeof element[idlAttr], "string", "'" + idlAttr + "' IDL attribute should be a string");
} }
@ -286,54 +286,54 @@ function reflectLimitedEnumerated(aParameters)
// Explicitly check the default value. // Explicitly check the default value.
element.removeAttribute(contentAttr); element.removeAttribute(contentAttr);
ise(element[idlAttr], defaultValueMissing, is(element[idlAttr], defaultValueMissing,
"When no attribute is set, the value should be the default value."); "When no attribute is set, the value should be the default value.");
// Check valid values. // Check valid values.
validValues.forEach(function (v) { validValues.forEach(function (v) {
element.setAttribute(contentAttr, v); element.setAttribute(contentAttr, v);
ise(element[idlAttr], v, is(element[idlAttr], v,
"'" + v + "' should be accepted as a valid value for " + idlAttr); "'" + v + "' should be accepted as a valid value for " + idlAttr);
ise(element.getAttribute(contentAttr), v, is(element.getAttribute(contentAttr), v,
"Content attribute should return the value it has been set to."); "Content attribute should return the value it has been set to.");
element.removeAttribute(contentAttr); element.removeAttribute(contentAttr);
element.setAttribute(contentAttr, v.toUpperCase()); element.setAttribute(contentAttr, v.toUpperCase());
ise(element[idlAttr], v, is(element[idlAttr], v,
"Enumerated attributes should be case-insensitive."); "Enumerated attributes should be case-insensitive.");
ise(element.getAttribute(contentAttr), v.toUpperCase(), is(element.getAttribute(contentAttr), v.toUpperCase(),
"Content attribute should not be lower-cased."); "Content attribute should not be lower-cased.");
element.removeAttribute(contentAttr); element.removeAttribute(contentAttr);
element[idlAttr] = v; element[idlAttr] = v;
ise(element[idlAttr], v, is(element[idlAttr], v,
"'" + v + "' should be accepted as a valid value for " + idlAttr); "'" + v + "' should be accepted as a valid value for " + idlAttr);
ise(element.getAttribute(contentAttr), v, is(element.getAttribute(contentAttr), v,
"Content attribute should return the value it has been set to."); "Content attribute should return the value it has been set to.");
element.removeAttribute(contentAttr); element.removeAttribute(contentAttr);
element[idlAttr] = v.toUpperCase(); element[idlAttr] = v.toUpperCase();
ise(element[idlAttr], v, is(element[idlAttr], v,
"Enumerated attributes should be case-insensitive."); "Enumerated attributes should be case-insensitive.");
ise(element.getAttribute(contentAttr), v.toUpperCase(), is(element.getAttribute(contentAttr), v.toUpperCase(),
"Content attribute should not be lower-cased."); "Content attribute should not be lower-cased.");
element.removeAttribute(contentAttr); element.removeAttribute(contentAttr);
}); });
// Check invalid values. // Check invalid values.
invalidValues.forEach(function (v) { invalidValues.forEach(function (v) {
element.setAttribute(contentAttr, v); element.setAttribute(contentAttr, v);
ise(element[idlAttr], defaultValueInvalid, is(element[idlAttr], defaultValueInvalid,
"When the content attribute is set to an invalid value, the default value should be returned."); "When the content attribute is set to an invalid value, the default value should be returned.");
ise(element.getAttribute(contentAttr), v, is(element.getAttribute(contentAttr), v,
"Content attribute should not have been changed."); "Content attribute should not have been changed.");
element.removeAttribute(contentAttr); element.removeAttribute(contentAttr);
element[idlAttr] = v; element[idlAttr] = v;
ise(element[idlAttr], defaultValueInvalid, is(element[idlAttr], defaultValueInvalid,
"When the value is set to an invalid value, the default value should be returned."); "When the value is set to an invalid value, the default value should be returned.");
ise(element.getAttribute(contentAttr), v, is(element.getAttribute(contentAttr), v,
"Content attribute should not have been changed."); "Content attribute should not have been changed.");
element.removeAttribute(contentAttr); element.removeAttribute(contentAttr);
}); });
@ -370,8 +370,8 @@ function reflectLimitedEnumerated(aParameters)
}); });
if (nullable) { if (nullable) {
ise(defaultValueMissing, null, is(defaultValueMissing, null,
"Missing default value should be null for nullable attributes"); "Missing default value should be null for nullable attributes");
ok(validValues.length > 0, "We better have at least one valid value"); ok(validValues.length > 0, "We better have at least one valid value");
element.setAttribute(contentAttr, validValues[0]); element.setAttribute(contentAttr, validValues[0]);
ok(element.hasAttribute(contentAttr), ok(element.hasAttribute(contentAttr),

View File

@ -35,7 +35,7 @@ iconDensityValueTests.forEach((density) => {
testIcon.icons[0].density = density; testIcon.icons[0].density = density;
data.jsonText = JSON.stringify(testIcon); data.jsonText = JSON.stringify(testIcon);
var result = processor.process(data); var result = processor.process(data);
ise(result.icons[0].density, 1.0, expected); is(result.icons[0].density, 1.0, expected);
}); });
testIcon = { testIcon = {
@ -51,7 +51,7 @@ parseFloatTests.forEach((testNumber) => {
testIcon.icons[0].density = testNumber; testIcon.icons[0].density = testNumber;
data.jsonText = JSON.stringify(testIcon); data.jsonText = JSON.stringify(testIcon);
var result = processor.process(data); var result = processor.process(data);
ise(result.icons[0].density, parseFloat(testNumber), expected); is(result.icons[0].density, parseFloat(testNumber), expected);
}); });
</script> </script>
</head> </head>

View File

@ -66,10 +66,10 @@ validSizes.forEach(({
var sizes = result.icons[0].sizes; var sizes = result.icons[0].sizes;
for (var expectedSize of expect) { for (var expectedSize of expect) {
var expected = `Expect sizes to contain ${expectedSize}`; var expected = `Expect sizes to contain ${expectedSize}`;
ise(sizes.has(expectedSize), true, expected); is(sizes.has(expectedSize), true, expected);
} }
expected = `Expect the size of the set to be ${expect.length}.`; expected = `Expect the size of the set to be ${expect.length}.`;
ise(sizes.size, expect.length, expected); is(sizes.size, expect.length, expected);
}); });
var testIcon = { var testIcon = {
@ -86,7 +86,7 @@ invalidSizes.forEach((invalidSize) => {
data.jsonText = JSON.stringify(testIcon); data.jsonText = JSON.stringify(testIcon);
var result = processor.process(data); var result = processor.process(data);
var sizes = result.icons[0].sizes; var sizes = result.icons[0].sizes;
ise(sizes.size, 0, expected); is(sizes.size, 0, expected);
}); });
typeTests.forEach((type) => { typeTests.forEach((type) => {
@ -95,7 +95,7 @@ typeTests.forEach((type) => {
data.jsonText = JSON.stringify(testIcon); data.jsonText = JSON.stringify(testIcon);
var result = processor.process(data); var result = processor.process(data);
var sizes = result.icons[0].sizes; var sizes = result.icons[0].sizes;
ise(sizes.size, 0, expected); is(sizes.size, 0, expected);
}); });
</script> </script>
</head> </head>

View File

@ -38,7 +38,7 @@ var noSrc = {
var expected = `Expect icons without a src prop to be filtered out.`; var expected = `Expect icons without a src prop to be filtered out.`;
data.jsonText = JSON.stringify(noSrc); data.jsonText = JSON.stringify(noSrc);
var result = processor.process(data); var result = processor.process(data);
ise(result.icons.length, 0, expected); is(result.icons.length, 0, expected);
var invalidSrc = { var invalidSrc = {
icons: [{ icons: [{
@ -59,7 +59,7 @@ var invalidSrc = {
var expected = `Expect icons with invalid src prop to be filtered out.`; var expected = `Expect icons with invalid src prop to be filtered out.`;
data.jsonText = JSON.stringify(noSrc); data.jsonText = JSON.stringify(noSrc);
var result = processor.process(data); var result = processor.process(data);
ise(result.icons.length, 0, expected); is(result.icons.length, 0, expected);
var expected = `Expect icon's src to be a string.`; var expected = `Expect icon's src to be a string.`;
var withSrc = { var withSrc = {
@ -69,7 +69,7 @@ var withSrc = {
}; };
data.jsonText = JSON.stringify(withSrc); data.jsonText = JSON.stringify(withSrc);
var result = processor.process(data); var result = processor.process(data);
ise(typeof result.icons[0].src, "string", expected); is(typeof result.icons[0].src, "string", expected);
var expected = `Expect only icons with a src prop to be kept.`; var expected = `Expect only icons with a src prop to be kept.`;
var withSrc = { var withSrc = {
@ -84,12 +84,12 @@ var withSrc = {
}; };
data.jsonText = JSON.stringify(withSrc); data.jsonText = JSON.stringify(withSrc);
var result = processor.process(data); var result = processor.process(data);
ise(result.icons.length, 2, expected); is(result.icons.length, 2, expected);
var expectedURL = new URL('pass', manifestURL); var expectedURL = new URL('pass', manifestURL);
for (var icon of result.icons) { for (var icon of result.icons) {
var expected = `Expect src prop to be ${expectedURL.toString()}`; var expected = `Expect src prop to be ${expectedURL.toString()}`;
ise(icon.src.toString(), expectedURL.toString(), expected); is(icon.src.toString(), expectedURL.toString(), expected);
} }
//Resolve URLs relative to manfiest //Resolve URLs relative to manfiest
@ -104,7 +104,7 @@ URLs.forEach((url) => {
}); });
var absURL = new URL(url, manifestURL).toString(); var absURL = new URL(url, manifestURL).toString();
var result = processor.process(data); var result = processor.process(data);
ise(result.icons[0].src.toString(), absURL, expected); is(result.icons[0].src.toString(), absURL, expected);
}); });
</script> </script>
</head> </head>

View File

@ -29,7 +29,7 @@ invalidMimeTypes.forEach((invalidMime) => {
testIcon.icons[0].type = invalidMime; testIcon.icons[0].type = invalidMime;
data.jsonText = JSON.stringify(testIcon); data.jsonText = JSON.stringify(testIcon);
var result = processor.process(data); var result = processor.process(data);
ise(result.icons[0].type, undefined, expected); is(result.icons[0].type, undefined, expected);
}); });
var validTypes = [ var validTypes = [
@ -45,7 +45,7 @@ validTypes.forEach((validMime) => {
testIcon.icons[0].type = validMime; testIcon.icons[0].type = validMime;
data.jsonText = JSON.stringify(testIcon); data.jsonText = JSON.stringify(testIcon);
var result = processor.process(data); var result = processor.process(data);
ise(result.icons[0].type, 'image/jpeg', expected); is(result.icons[0].type, 'image/jpeg', expected);
}); });
</script> </script>
</head> </head>

View File

@ -20,7 +20,7 @@ invalidJson.forEach((testString) => {
var expected = `Expect to recover from invalid JSON: ${testString}`; var expected = `Expect to recover from invalid JSON: ${testString}`;
data.jsonText = testString; data.jsonText = testString;
var result = processor.process(data); var result = processor.process(data);
SimpleTest.ise(result.start_url, docURL.href, expected); SimpleTest.is(result.start_url, docURL.href, expected);
}); });
var validButUnhelpful = ["1", 1, "", "[{}]", "null"]; var validButUnhelpful = ["1", 1, "", "[{}]", "null"];
@ -28,7 +28,7 @@ validButUnhelpful.forEach((testString) => {
var expected = `Expect to recover from invalid JSON: ${testString}`; var expected = `Expect to recover from invalid JSON: ${testString}`;
data.jsonText = testString; data.jsonText = testString;
var result = processor.process(data); var result = processor.process(data);
SimpleTest.ise(result.start_url, docURL.href, expected); SimpleTest.is(result.start_url, docURL.href, expected);
}); });
</script> </script>
</head> </head>

View File

@ -22,7 +22,7 @@ typeTests.forEach((type) => {
display: type display: type
}); });
var result = processor.process(data); var result = processor.process(data);
ise(result.display, 'browser', expected); is(result.display, 'browser', expected);
}); });
/*Test valid modes*/ /*Test valid modes*/
@ -33,7 +33,7 @@ validModes.forEach((mode) => {
display: mode display: mode
}); });
var result = processor.process(data); var result = processor.process(data);
ise(result.display, mode, expected); is(result.display, mode, expected);
}); });
//trim tests //trim tests
@ -44,7 +44,7 @@ validModes.forEach((display) => {
display: expandedDisplay display: expandedDisplay
}); });
var result = processor.process(data); var result = processor.process(data);
ise(result.display, display, expected); is(result.display, display, expected);
}); });
//Unknown modes //Unknown modes
@ -55,7 +55,7 @@ invalidModes.forEach((invalidMode) => {
display: invalidMode display: invalidMode
}); });
var result = processor.process(data); var result = processor.process(data);
ise(result.display, 'browser', expected); is(result.display, 'browser', expected);
}); });
</script> </script>
</head> </head>

View File

@ -24,7 +24,7 @@ typeTests.forEach((type) => {
}); });
var result = processor.process(data); var result = processor.process(data);
var y = SpecialPowers.unwrap(result.icons); var y = SpecialPowers.unwrap(result.icons);
ise(result.icons.length, 0, expected); is(result.icons.length, 0, expected);
}); });
</script> </script>
</head> </head>

View File

@ -34,7 +34,7 @@ props.forEach((prop) => {
obj[prop] = trimmableString; obj[prop] = trimmableString;
data.jsonText = JSON.stringify(obj); data.jsonText = JSON.stringify(obj);
var result = processor.process(data); var result = processor.process(data);
ise(result[prop], 'pass', assetion); is(result[prop], 'pass', assetion);
}); });
}); });
@ -72,7 +72,7 @@ props.forEach((prop) => {
obj[prop] = name; obj[prop] = name;
data.jsonText = JSON.stringify(obj); data.jsonText = JSON.stringify(obj);
var result = processor.process(data); var result = processor.process(data);
ise(result[prop], name, expected); is(result[prop], name, expected);
}); });
}); });
</script> </script>

View File

@ -22,7 +22,7 @@ typeTests.forEach((type) => {
orientation: type orientation: type
}); });
var result = processor.process(data); var result = processor.process(data);
ise(result.orientation, '', expected); is(result.orientation, '', expected);
}); });
@ -43,7 +43,7 @@ validOrientations.forEach((orientation) => {
orientation: orientation orientation: orientation
}); });
var result = processor.process(data); var result = processor.process(data);
ise(result.orientation, orientation, expected); is(result.orientation, orientation, expected);
}); });
var invalidOrientations = [ var invalidOrientations = [
@ -66,7 +66,7 @@ invalidOrientations.forEach((orientation) => {
orientation: orientation orientation: orientation
}); });
var result = processor.process(data); var result = processor.process(data);
ise(result.orientation, "", expected); is(result.orientation, "", expected);
}); });
//Trim tests //Trim tests
@ -77,7 +77,7 @@ validOrientations.forEach((orientation) => {
orientation: expandedOrientation orientation: expandedOrientation
}); });
var result = processor.process(data); var result = processor.process(data);
ise(result.orientation, orientation, expected); is(result.orientation, orientation, expected);
}); });
</script> </script>
</head> </head>

View File

@ -21,7 +21,7 @@ typeTests.forEach((type) => {
scope: type scope: type
}); });
var result = processor.process(data); var result = processor.process(data);
ise(result.scope, undefined, expected); is(result.scope, undefined, expected);
}); });
var expected = 'Expect different origin to be treated as undefined'; var expected = 'Expect different origin to be treated as undefined';
@ -29,14 +29,14 @@ data.jsonText = JSON.stringify({
scope: 'http://not-same-origin' scope: 'http://not-same-origin'
}); });
var result = processor.process(data); var result = processor.process(data);
ise(result.scope, undefined, expected); is(result.scope, undefined, expected);
var expected = 'Expect the empty string to be treated as undefined.'; var expected = 'Expect the empty string to be treated as undefined.';
data.jsonText = JSON.stringify({ data.jsonText = JSON.stringify({
scope: '' scope: ''
}); });
var result = processor.process(data); var result = processor.process(data);
ise(result.scope, undefined, expected); is(result.scope, undefined, expected);
var expected = 'Resolve URLs relative to manifest.'; var expected = 'Resolve URLs relative to manifest.';
var URLs = ['path', '/path', '../../path']; var URLs = ['path', '/path', '../../path'];
@ -47,7 +47,7 @@ URLs.forEach((url) => {
}); });
var absURL = new URL(url, manifestURL).toString(); var absURL = new URL(url, manifestURL).toString();
var result = processor.process(data); var result = processor.process(data);
ise(result.scope, absURL, expected); is(result.scope, absURL, expected);
}); });
var expected = 'If start URL is not in scope, return undefined.'; var expected = 'If start URL is not in scope, return undefined.';
@ -56,7 +56,7 @@ data.jsonText = JSON.stringify({
start_url: 'bar' start_url: 'bar'
}); });
var result = processor.process(data); var result = processor.process(data);
ise(result.scope, undefined, expected); is(result.scope, undefined, expected);
var expected = 'If start URL is in scope, use the scope.'; var expected = 'If start URL is in scope, use the scope.';
data.jsonText = JSON.stringify({ data.jsonText = JSON.stringify({
@ -64,10 +64,10 @@ data.jsonText = JSON.stringify({
scope: 'foo' scope: 'foo'
}); });
var result = processor.process(data); var result = processor.process(data);
ise(result.scope.toString(), new URL('foo', manifestURL).toString(), expected); is(result.scope.toString(), new URL('foo', manifestURL).toString(), expected);
var expected = 'Expect start_url to be ' + new URL('foobar', manifestURL).toString(); var expected = 'Expect start_url to be ' + new URL('foobar', manifestURL).toString();
ise(result.start_url.toString(), new URL('foobar', manifestURL).toString(), expected); is(result.start_url.toString(), new URL('foobar', manifestURL).toString(), expected);
var expected = 'If start URL is in scope, use the scope.'; var expected = 'If start URL is in scope, use the scope.';
data.jsonText = JSON.stringify({ data.jsonText = JSON.stringify({
@ -75,7 +75,7 @@ data.jsonText = JSON.stringify({
scope: '/foo/' scope: '/foo/'
}); });
var result = processor.process(data); var result = processor.process(data);
ise(result.scope.toString(), new URL('/foo/', manifestURL).toString(), expected); is(result.scope.toString(), new URL('/foo/', manifestURL).toString(), expected);
var expected = 'If start URL is in scope, use the scope.'; var expected = 'If start URL is in scope, use the scope.';
data.jsonText = JSON.stringify({ data.jsonText = JSON.stringify({
@ -83,7 +83,7 @@ data.jsonText = JSON.stringify({
scope: '../foo/' scope: '../foo/'
}); });
var result = processor.process(data); var result = processor.process(data);
ise(result.scope.toString(), new URL('/foo/', manifestURL).toString(), expected); is(result.scope.toString(), new URL('/foo/', manifestURL).toString(), expected);
</script> </script>
</head> </head>

View File

@ -21,7 +21,7 @@ typeTests.forEach((type) => {
start_url: type start_url: type
}); });
var result = processor.process(data); var result = processor.process(data);
ise(result.start_url.toString(), docURL.toString(), expected); is(result.start_url.toString(), docURL.toString(), expected);
}); });
//Not same origin //Not same origin
@ -30,7 +30,7 @@ data.jsonText = JSON.stringify({
start_url: 'http://not-same-origin' start_url: 'http://not-same-origin'
}); });
var result = processor.process(data); var result = processor.process(data);
ise(result.start_url.toString(), docURL.toString(), expected); is(result.start_url.toString(), docURL.toString(), expected);
//Empty string test //Empty string test
var expected = `Expect empty string for start_url to become document's URL.`; var expected = `Expect empty string for start_url to become document's URL.`;
@ -38,7 +38,7 @@ data.jsonText = JSON.stringify({
start_url: '' start_url: ''
}); });
var result = processor.process(data); var result = processor.process(data);
ise(result.start_url.toString(), docURL.toString(), expected); is(result.start_url.toString(), docURL.toString(), expected);
//Resolve URLs relative to manfiest //Resolve URLs relative to manfiest
var URLs = ['path', '/path', '../../path', var URLs = ['path', '/path', '../../path',
@ -53,7 +53,7 @@ URLs.forEach((url) => {
}); });
var absURL = new URL(url, manifestURL).toString(); var absURL = new URL(url, manifestURL).toString();
var result = processor.process(data); var result = processor.process(data);
ise(result.start_url.toString(), absURL, expected); is(result.start_url.toString(), absURL, expected);
}); });
</script> </script>
</head> </head>

View File

@ -22,7 +22,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=674720
"use strict"; "use strict";
var mozPhoneNumberService = window.navigator.mozPhoneNumberService; var mozPhoneNumberService = window.navigator.mozPhoneNumberService;
ise(mozPhoneNumberService, undefined, "mozPhoneNumberService should not be accessible"); is(mozPhoneNumberService, undefined, "mozPhoneNumberService should not be accessible");
</script> </script>
</pre> </pre>
</body> </body>

View File

@ -17,7 +17,7 @@
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
function runTests() { function runTests() {
ise(navigator.mozPresentationDeviceInfo, undefined, 'navigator.mozPresentationDeviceInfo is undefined'); is(navigator.mozPresentationDeviceInfo, undefined, 'navigator.mozPresentationDeviceInfo is undefined');
SimpleTest.finish(); SimpleTest.finish();
} }

View File

@ -13,13 +13,13 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1120235
/** Test for Bug 1120235 **/ /** Test for Bug 1120235 **/
var res, rej; var res, rej;
var p = new Promise(function(resolve, reject) { res = resolve; rej = reject; }); var p = new Promise(function(resolve, reject) { res = resolve; rej = reject; });
ise(res(1), undefined, "Resolve function should return undefined"); is(res(1), undefined, "Resolve function should return undefined");
ise(rej(2), undefined, "Reject function should return undefined"); is(rej(2), undefined, "Reject function should return undefined");
var thenable = { var thenable = {
then: function(resolve, reject) { then: function(resolve, reject) {
ise(resolve(3), undefined, "Thenable resolve argument should return undefined"); is(resolve(3), undefined, "Thenable resolve argument should return undefined");
ise(reject(4), undefined, "Thenable reject argument should return undefined"); is(reject(4), undefined, "Thenable reject argument should return undefined");
SimpleTest.finish(); SimpleTest.finish();
} }
}; };

View File

@ -25,7 +25,7 @@ function testPref() {
SpecialPowers.pushPrefEnv({ SpecialPowers.pushPrefEnv({
set: [["dom.mozSettings.enabled", false]] set: [["dom.mozSettings.enabled", false]]
}, function() { }, function() {
ise(navigator.mozSettings, undefined, "navigator.mozSettings is undefined"); is(navigator.mozSettings, undefined, "navigator.mozSettings is undefined");
SimpleTest.finish(); SimpleTest.finish();
}); });
} }
@ -37,7 +37,7 @@ SpecialPowers.pushPermissions([
{type: "settings-api-write", allow: 0, context: document}, {type: "settings-api-write", allow: 0, context: document},
{type: "settings-clear", allow: 0, context: document} {type: "settings-clear", allow: 0, context: document}
], function() { ], function() {
ise(frames[0].navigator.mozSettings, null, "navigator.mozSettings is null when the page doesn't have permissions"); is(frames[0].navigator.mozSettings, null, "navigator.mozSettings is null when the page doesn't have permissions");
testPref(); testPref();
}); });
</script> </script>

View File

@ -48,9 +48,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=941315
function runTests() { function runTests() {
[testSimpleDuration, testMin, testMax, testRepeatDur, testRepeatCount] [testSimpleDuration, testMin, testMax, testRepeatDur, testRepeatCount]
.forEach(function(test) { .forEach(function(test) {
ise(b.getStartTime(), 100, "initial state before running " + test.name); is(b.getStartTime(), 100, "initial state before running " + test.name);
test(); test();
ise(b.getStartTime(), 100, "final state after running " + test.name); is(b.getStartTime(), 100, "final state after running " + test.name);
}); });
SimpleTest.finish(); SimpleTest.finish();
} }
@ -58,11 +58,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=941315
function testSimpleDuration() { function testSimpleDuration() {
// Verify a valid value updates as expected // Verify a valid value updates as expected
a.setAttribute("dur", "50s"); a.setAttribute("dur", "50s");
ise(b.safeGetStartTime(), 50, "valid simple duration"); is(b.safeGetStartTime(), 50, "valid simple duration");
// Check an invalid value also causes the model to be updated // Check an invalid value also causes the model to be updated
a.setAttribute("dur", "abc"); // -> indefinite a.setAttribute("dur", "abc"); // -> indefinite
ise(b.safeGetStartTime(), "none", "invalid simple duration"); is(b.safeGetStartTime(), "none", "invalid simple duration");
// Restore state // Restore state
a.setAttribute("dur", "100s"); a.setAttribute("dur", "100s");
@ -70,40 +70,40 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=941315
function testMin() { function testMin() {
a.setAttribute("min", "200s"); a.setAttribute("min", "200s");
ise(b.safeGetStartTime(), 200, "valid min duration"); is(b.safeGetStartTime(), 200, "valid min duration");
a.setAttribute("min", "abc"); // -> indefinite a.setAttribute("min", "abc"); // -> indefinite
ise(b.safeGetStartTime(), 100, "invalid min duration"); is(b.safeGetStartTime(), 100, "invalid min duration");
a.removeAttribute("min"); a.removeAttribute("min");
} }
function testMax() { function testMax() {
a.setAttribute("max", "50s"); a.setAttribute("max", "50s");
ise(b.safeGetStartTime(), 50, "valid max duration"); is(b.safeGetStartTime(), 50, "valid max duration");
a.setAttribute("max", "abc"); // -> indefinite a.setAttribute("max", "abc"); // -> indefinite
ise(b.safeGetStartTime(), 100, "invalid max duration"); is(b.safeGetStartTime(), 100, "invalid max duration");
a.removeAttribute("max"); a.removeAttribute("max");
} }
function testRepeatDur() { function testRepeatDur() {
a.setAttribute("repeatDur", "200s"); a.setAttribute("repeatDur", "200s");
ise(b.safeGetStartTime(), 200, "valid repeatDur duration"); is(b.safeGetStartTime(), 200, "valid repeatDur duration");
a.setAttribute("repeatDur", "abc"); // -> indefinite a.setAttribute("repeatDur", "abc"); // -> indefinite
ise(b.safeGetStartTime(), 100, "invalid repeatDur duration"); is(b.safeGetStartTime(), 100, "invalid repeatDur duration");
a.removeAttribute("repeatDur"); a.removeAttribute("repeatDur");
} }
function testRepeatCount() { function testRepeatCount() {
a.setAttribute("repeatCount", "2"); a.setAttribute("repeatCount", "2");
ise(b.safeGetStartTime(), 200, "valid repeatCount duration"); is(b.safeGetStartTime(), 200, "valid repeatCount duration");
a.setAttribute("repeatCount", "abc"); // -> indefinite a.setAttribute("repeatCount", "abc"); // -> indefinite
ise(b.safeGetStartTime(), 100, "invalid repeatCount duration"); is(b.safeGetStartTime(), 100, "invalid repeatCount duration");
a.removeAttribute("repeatCount"); a.removeAttribute("repeatCount");
} }

View File

@ -48,42 +48,42 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=948245
// In the extended period (t=150s) we should not be animating or filling // In the extended period (t=150s) we should not be animating or filling
// since the default fill mode is "none". // since the default fill mode is "none".
animation.ownerSVGElement.setCurrentTime(150); animation.ownerSVGElement.setCurrentTime(150);
ise(rect.x.animVal.value, 0, is(rect.x.animVal.value, 0,
"Shouldn't fill in extended period with fill='none'"); "Shouldn't fill in extended period with fill='none'");
// If we set the fill mode we should start filling. // If we set the fill mode we should start filling.
animation.setAttribute("fill", "freeze"); animation.setAttribute("fill", "freeze");
ise(rect.x.animVal.value, 100, is(rect.x.animVal.value, 100,
"Should fill in extended period with fill='freeze'"); "Should fill in extended period with fill='freeze'");
// If we unset the fill attribute we should stop filling. // If we unset the fill attribute we should stop filling.
animation.removeAttribute("fill"); animation.removeAttribute("fill");
ise(rect.x.animVal.value, 0, "Shouldn't fill after unsetting fill"); is(rect.x.animVal.value, 0, "Shouldn't fill after unsetting fill");
// If we jump back into the repeated interval (at t=50s) we should be // If we jump back into the repeated interval (at t=50s) we should be
// animating. // animating.
animation.ownerSVGElement.setCurrentTime(50); animation.ownerSVGElement.setCurrentTime(50);
ise(rect.x.animVal.value, 50, "Should be active in repeating interval"); is(rect.x.animVal.value, 50, "Should be active in repeating interval");
// If we jump to the boundary at the start of the extended period we should // If we jump to the boundary at the start of the extended period we should
// not be filling (since we removed the fill attribute above). // not be filling (since we removed the fill attribute above).
animation.ownerSVGElement.setCurrentTime(100); animation.ownerSVGElement.setCurrentTime(100);
ise(rect.x.animVal.value, 0, is(rect.x.animVal.value, 0,
"Shouldn't fill after seeking to boundary of extended period"); "Shouldn't fill after seeking to boundary of extended period");
// If we apply a fill mode at this boundary point we should do regular fill // If we apply a fill mode at this boundary point we should do regular fill
// behavior of using the last value in the interpolation range. // behavior of using the last value in the interpolation range.
animation.setAttribute("fill", "freeze"); animation.setAttribute("fill", "freeze");
ise(rect.x.animVal.value, 100, is(rect.x.animVal.value, 100,
"Should fill at boundary to extended period"); "Should fill at boundary to extended period");
// Check that if we seek past the interval we fill with the value at the end // Check that if we seek past the interval we fill with the value at the end
// of the _repeat_duration_ not the value at the end of the // of the _repeat_duration_ not the value at the end of the
// _active_duration_. // _active_duration_.
animation.setAttribute("repeatCount", "1.5"); animation.setAttribute("repeatCount", "1.5");
animation.ownerSVGElement.setCurrentTime(225); animation.ownerSVGElement.setCurrentTime(225);
ise(rect.x.animVal.value, 50, is(rect.x.animVal.value, 50,
"Should fill with the end of the repeat duration value"); "Should fill with the end of the repeat duration value");
SimpleTest.finish(); SimpleTest.finish();
} }

View File

@ -128,7 +128,7 @@ href="https://bugzilla.mozilla.org/show_bug.cgi?id=948245">Mozilla Bug 948245</a
var msg = msgPieces.join(', '); var msg = msgPieces.join(', ');
// Check the result // Check the result
ise(getRepeatDuration(), test.result, msg); is(getRepeatDuration(), test.result, msg);
}); });
SimpleTest.finish(); SimpleTest.finish();

View File

@ -65,7 +65,7 @@ function checkParseOk(spec, valueInUnits, units) {
if (typeof units == "undefined") { if (typeof units == "undefined") {
units = ""; units = "";
} }
ise(rect.x.baseVal.unitType, unitMapping[units], spec + " (unit)"); is(rect.x.baseVal.unitType, unitMapping[units], spec + " (unit)");
} }
function checkParseFail(spec) { function checkParseFail(spec) {

View File

@ -76,12 +76,12 @@ function checkTransform(transform, expected, spec, index) {
// Compare type // Compare type
if (typeof expected.type != "undefined") { if (typeof expected.type != "undefined") {
ise(transform.type, typeMapping[expected.type], name + " - transform type"); is(transform.type, typeMapping[expected.type], name + " - transform type");
} }
// Compare angle // Compare angle
if (typeof expected.angle != "undefined") { if (typeof expected.angle != "undefined") {
ise(transform.angle, expected.angle, name + " - angle"); is(transform.angle, expected.angle, name + " - angle");
} }
// Compare matrix values (roughly) // Compare matrix values (roughly)

View File

@ -26,7 +26,7 @@ try {
/* Check that we can touch various properties */ /* Check that we can touch various properties */
isnot(e.lineNumber, undefined, "Unexpected line number"); //This line number is dependent on the implementation of the SpecialPowers API isnot(e.lineNumber, undefined, "Unexpected line number"); //This line number is dependent on the implementation of the SpecialPowers API
is(e.name, "NS_ERROR_MALFORMED_URI", "Unexpected exception name"); is(e.name, "NS_ERROR_MALFORMED_URI", "Unexpected exception name");
ise(e.message, "", "Should not have a message for this case"); is(e.message, "", "Should not have a message for this case");
isnot(e.result, 0, "Should have a result"); isnot(e.result, 0, "Should have a result");
is(e.result, SpecialPowers.Cr.NS_ERROR_MALFORMED_URI); is(e.result, SpecialPowers.Cr.NS_ERROR_MALFORMED_URI);

View File

@ -111,18 +111,18 @@ function checkChangeIsDisabled(aWindow, aNext)
} }
function changeTest() { function changeTest() {
ise(getProp("innerWidth"), originalWidth, is(getProp("innerWidth"), originalWidth,
"Window width shouldn't have changed"); "Window width shouldn't have changed");
ise(getProp("innerHeight"), originalHeight, is(getProp("innerHeight"), originalHeight,
"Window height shouldn't have changed"); "Window height shouldn't have changed");
ise(getProp("screenX"), originalX, is(getProp("screenX"), originalX,
"Window x position shouldn't have changed"); "Window x position shouldn't have changed");
ise(getProp("screenY"), originalY, is(getProp("screenY"), originalY,
"Window y position shouldn't have changed"); "Window y position shouldn't have changed");
ise(getProp("outerWidth"), oWidth, is(getProp("outerWidth"), oWidth,
"Window outerWidth shouldn't have changed"); "Window outerWidth shouldn't have changed");
ise(getProp("outerHeight"), oHeight, is(getProp("outerHeight"), oHeight,
"Window outerHeight shouldn't have changed"); "Window outerHeight shouldn't have changed");
} }
/** /**

View File

@ -297,7 +297,7 @@ function testRotateFromVector()
} catch (e) { } catch (e) {
exn = e; exn = e;
} }
ise(exn, null, "did not throw exception with zero coord for rotateFromVector"); is(exn, null, "did not throw exception with zero coord for rotateFromVector");
// Test bad input (2) // Test bad input (2)
exn = null; exn = null;
@ -306,7 +306,7 @@ function testRotateFromVector()
} catch (e) { } catch (e) {
exn = e; exn = e;
} }
ise(exn, null, "did not throw exception with zero coord for rotateFromVector"); is(exn, null, "did not throw exception with zero coord for rotateFromVector");
} }
// DOMMatrix flipX(); // DOMMatrix flipX();
@ -470,7 +470,7 @@ function testCreateMatrix3D()
// Should be initialised to identity // Should be initialised to identity
cmpMatrix(m, [1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0], cmpMatrix(m, [1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0],
"DOMMatrix should produce identity matrix"); "DOMMatrix should produce identity matrix");
ise(m.is2D, false, "should produce 3d matrix"); is(m.is2D, false, "should produce 3d matrix");
} }
// DOMMatrix multiply(in DOMMatrix secondMatrix); // DOMMatrix multiply(in DOMMatrix secondMatrix);

View File

@ -278,19 +278,19 @@ function runTest() {
iframeCw.history.back(); iframeCw.history.back();
popstateExpected("Going back to page 0 should trigger a popstate."); popstateExpected("Going back to page 0 should trigger a popstate.");
ise(gLastPopStateEvent.state, null, is(gLastPopStateEvent.state, null,
"Going back to page 0 should pop a null state."); "Going back to page 0 should pop a null state.");
ise(iframeCw.history.state, null, is(iframeCw.history.state, null,
"Going back to page 0 should pop a null state."); "Going back to page 0 should pop a null state.");
ise(iframeCw.location.search, "", is(iframeCw.location.search, "",
"Going back to page 0 should clear the querystring."); "Going back to page 0 should clear the querystring.");
iframeCw.history.forward(); iframeCw.history.forward();
popstateExpected("Going forward to page 1 should trigger a popstate."); popstateExpected("Going forward to page 1 should trigger a popstate.");
is(JSON.stringify(gLastPopStateEvent.state), JSON.stringify(testObj1), is(JSON.stringify(gLastPopStateEvent.state), JSON.stringify(testObj1),
"Wrong state object popped after going forward to page 1."); "Wrong state object popped after going forward to page 1.");
ise(gLastPopStateEvent.state, iframeCw.history.state, is(gLastPopStateEvent.state, iframeCw.history.state,
"Wrong state object in document after going forward to page 1."); "Wrong state object in document after going forward to page 1.");
ok(iframeCw.location.toString().match(/file_bug500328_1.html$/), ok(iframeCw.location.toString().match(/file_bug500328_1.html$/),
"Going forward to page 1 should leave us at original page."); "Going forward to page 1 should leave us at original page.");
@ -300,7 +300,7 @@ function runTest() {
popstateExpected("Going forward to page 2 should trigger a popstate."); popstateExpected("Going forward to page 2 should trigger a popstate.");
is(JSON.stringify(gLastPopStateEvent.state), JSON.stringify(testObj2), is(JSON.stringify(gLastPopStateEvent.state), JSON.stringify(testObj2),
"Wrong state object popped after going forward to page 2."); "Wrong state object popped after going forward to page 2.");
ise(iframeCw.history.state, gLastPopStateEvent.state, is(iframeCw.history.state, gLastPopStateEvent.state,
"Wrong state object in document after going forward to page 2."); "Wrong state object in document after going forward to page 2.");
ok(iframeCw.location.toString().match(/file_bug500328_1.html\?test1#foo$/), ok(iframeCw.location.toString().match(/file_bug500328_1.html\?test1#foo$/),
"Going forward to page 2 took us to " + iframeCw.location.toString()); "Going forward to page 2 took us to " + iframeCw.location.toString());
@ -329,7 +329,7 @@ function runTest() {
"search should be ?test1 after clicking link."); "search should be ?test1 after clicking link.");
is(iframeCw.location.hash, "#1", is(iframeCw.location.hash, "#1",
"hash should be #1 after clicking link."); "hash should be #1 after clicking link.");
ise(iframeCw.history.state, null, is(iframeCw.history.state, null,
"Wrong state object in document after clicking link to hash '#1'."); "Wrong state object in document after clicking link to hash '#1'.");
/* /*

View File

@ -23,18 +23,18 @@ for (var prop in gCSSProperties) {
var s = document.createElement("div").style; var s = document.createElement("div").style;
ise(s[info.domProp], "", prop + " should not be set yet"); is(s[info.domProp], "", prop + " should not be set yet");
s[info.domProp] = info.initial_values[0]; s[info.domProp] = info.initial_values[0];
isnot(s[info.domProp], "", prop + " should now be set"); isnot(s[info.domProp], "", prop + " should now be set");
if (prop[0] != "-") { if (prop[0] != "-") {
ise(s[prop], s[info.domProp], is(s[prop], s[info.domProp],
"Getting " + prop + " via name should work") "Getting " + prop + " via name should work")
s = document.createElement("div").style; s = document.createElement("div").style;
ise(s[info.domProp], "", prop + " should not be set here either"); is(s[info.domProp], "", prop + " should not be set here either");
s[prop] = info.initial_values[0]; s[prop] = info.initial_values[0];
isnot(s[info.prop], "", prop + " should now be set again"); isnot(s[info.prop], "", prop + " should now be set again");
ise(s[info.domProp], s[prop], is(s[info.domProp], s[prop],
"Setting " + prop + " via name should work"); "Setting " + prop + " via name should work");
} }
} }
</script> </script>

View File

@ -14,21 +14,21 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=830260
var div = document.createElement("div"); var div = document.createElement("div");
div.style.color = "green"; div.style.color = "green";
div.style.color = "null"; div.style.color = "null";
ise(div.style.color, "green", 'Assigning "null" as a color should not parse'); is(div.style.color, "green", 'Assigning "null" as a color should not parse');
div.style.setProperty("color", "null"); div.style.setProperty("color", "null");
ise(div.style.color, "green", is(div.style.color, "green",
'Passing "null" as a color to setProperty should not parse'); 'Passing "null" as a color to setProperty should not parse');
div.style.setProperty("color", null); div.style.setProperty("color", null);
ise(div.style.color, "", is(div.style.color, "",
'Passing null as a color to setProperty should remove the property'); 'Passing null as a color to setProperty should remove the property');
div.style.color = "green"; div.style.color = "green";
ise(div.style.color, "green", 'Assigning "green" as a color should parse'); is(div.style.color, "green", 'Assigning "green" as a color should parse');
div.style.color = null; div.style.color = null;
ise(div.style.color, "", is(div.style.color, "",
'Assigning null as a color should remove the property'); 'Assigning null as a color should remove the property');

View File

@ -30,7 +30,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "SelfSupportBackend",
"resource:///modules/SelfSupportBackend.jsm"); "resource:///modules/SelfSupportBackend.jsm");
const SIMPLETEST_OVERRIDES = const SIMPLETEST_OVERRIDES =
["ok", "is", "isnot", "ise", "todo", "todo_is", "todo_isnot", "info", "expectAssertions", "requestCompleteLog"]; ["ok", "is", "isnot", "todo", "todo_is", "todo_isnot", "info", "expectAssertions", "requestCompleteLog"];
window.addEventListener("load", function testOnLoad() { window.addEventListener("load", function testOnLoad() {
window.removeEventListener("load", testOnLoad); window.removeEventListener("load", testOnLoad);
@ -929,10 +929,6 @@ function testScope(aTester, aTest, expected) {
self.ok(a != b, name, "Didn't expect " + a + ", but got it", false, self.ok(a != b, name, "Didn't expect " + a + ", but got it", false,
Components.stack.caller); Components.stack.caller);
}; };
this.ise = function test_ise(a, b, name) {
self.ok(a === b, name, "Got " + a + ", strictly expected " + b, false,
Components.stack.caller);
};
this.todo = function test_todo(condition, name, diag, stack) { this.todo = function test_todo(condition, name, diag, stack) {
aTest.addResult(new testResult(!condition, name, diag, true, aTest.addResult(new testResult(!condition, name, diag, true,
stack ? stack : Components.stack.caller)); stack ? stack : Components.stack.caller));

View File

@ -277,7 +277,6 @@ SimpleTest.is = function (a, b, name) {
var diag = pass ? "" : "got " + repr(a) + ", expected " + repr(b) var diag = pass ? "" : "got " + repr(a) + ", expected " + repr(b)
SimpleTest.ok(pass, name, diag); SimpleTest.ok(pass, name, diag);
}; };
SimpleTest.ise = SimpleTest.is;
SimpleTest.isfuzzy = function (a, b, epsilon, name) { SimpleTest.isfuzzy = function (a, b, epsilon, name) {
var pass = (a >= b - epsilon) && (a <= b + epsilon); var pass = (a >= b - epsilon) && (a <= b + epsilon);
@ -1466,7 +1465,6 @@ var ok = SimpleTest.ok;
var is = SimpleTest.is; var is = SimpleTest.is;
var isfuzzy = SimpleTest.isfuzzy; var isfuzzy = SimpleTest.isfuzzy;
var isnot = SimpleTest.isnot; var isnot = SimpleTest.isnot;
var ise = SimpleTest.ise;
var todo = SimpleTest.todo; var todo = SimpleTest.todo;
var todo_is = SimpleTest.todo_is; var todo_is = SimpleTest.todo_is;
var todo_isnot = SimpleTest.todo_isnot; var todo_isnot = SimpleTest.todo_isnot;

View File

@ -3,7 +3,6 @@ function test() {
ok(true, "pass ok"); ok(true, "pass ok");
is(true, true, "pass is"); is(true, true, "pass is");
isnot(false, true, "pass isnot"); isnot(false, true, "pass isnot");
ise(true, true, "pass ise");
todo(false, "pass todo"); todo(false, "pass todo");
todo_is(false, true, "pass todo_is"); todo_is(false, true, "pass todo_is");
todo_isnot(true, true, "pass todo_isnot"); todo_isnot(true, true, "pass todo_isnot");

View File

@ -7,7 +7,6 @@ function test() {
ok(true, "pass ok"); ok(true, "pass ok");
is(true, true, "pass is"); is(true, true, "pass is");
isnot(false, true, "pass isnot"); isnot(false, true, "pass isnot");
ise(true, true, "pass ise");
todo(false, "pass todo"); todo(false, "pass todo");
todo_is(false, true, "pass todo_is"); todo_is(false, true, "pass todo_is");
todo_isnot(true, true, "pass todo_isnot"); todo_isnot(true, true, "pass todo_isnot");

View File

@ -28,22 +28,22 @@ function onNewEvent(e) {
onloadFired = true; onloadFired = true;
} else if (e.type == "input") { } else if (e.type == "input") {
if (e.target.name == "uname") { if (e.target.name == "uname") {
ise(e.target.value, "testuser", "Should get 'testuser' as username"); is(e.target.value, "testuser", "Should get 'testuser' as username");
ok(!usernameInputFired, "Should not have gotten an input event for the username field yet."); ok(!usernameInputFired, "Should not have gotten an input event for the username field yet.");
usernameInputFired = true; usernameInputFired = true;
} else if (e.target.name == "pword") { } else if (e.target.name == "pword") {
ise(e.target.value, "testpass", "Should get 'testpass' as password"); is(e.target.value, "testpass", "Should get 'testpass' as password");
ok(!passwordInputFired, "Should not have gotten an input event for the password field yet."); ok(!passwordInputFired, "Should not have gotten an input event for the password field yet.");
passwordInputFired = true; passwordInputFired = true;
} }
} else if (e.type == "change") { } else if (e.type == "change") {
if (e.target.name == "uname") { if (e.target.name == "uname") {
ise(e.target.value, "testuser", "Should get 'testuser' as username"); is(e.target.value, "testuser", "Should get 'testuser' as username");
ok(usernameInputFired, "Should get input event before change event for username field."); ok(usernameInputFired, "Should get input event before change event for username field.");
ok(!usernameChangeFired, "Should not have gotten a change event for the username field yet."); ok(!usernameChangeFired, "Should not have gotten a change event for the username field yet.");
usernameChangeFired = true; usernameChangeFired = true;
} else if (e.target.name == "pword") { } else if (e.target.name == "pword") {
ise(e.target.value, "testpass", "Should get 'testpass' as password"); is(e.target.value, "testpass", "Should get 'testpass' as password");
ok(passwordInputFired, "Should get input event before change event for password field."); ok(passwordInputFired, "Should get input event before change event for password field.");
ok(!passwordChangeFired, "Should not have gotten a change event for the password field yet."); ok(!passwordChangeFired, "Should not have gotten a change event for the password field yet.");
passwordChangeFired = true; passwordChangeFired = true;

View File

@ -39,10 +39,10 @@ function testtag_notificationbox(nb)
{ {
testtag_notificationbox_State(nb, "initial", null, 0); testtag_notificationbox_State(nb, "initial", null, 0);
SimpleTest.ise(nb.notificationsHidden, false, "initial notificationsHidden"); SimpleTest.is(nb.notificationsHidden, false, "initial notificationsHidden");
SimpleTest.ise(nb.removeAllNotifications(false), undefined, "initial removeAllNotifications"); SimpleTest.is(nb.removeAllNotifications(false), undefined, "initial removeAllNotifications");
testtag_notificationbox_State(nb, "initial removeAllNotifications", null, 0); testtag_notificationbox_State(nb, "initial removeAllNotifications", null, 0);
SimpleTest.ise(nb.removeAllNotifications(true), undefined, "initial removeAllNotifications immediate"); SimpleTest.is(nb.removeAllNotifications(true), undefined, "initial removeAllNotifications immediate");
testtag_notificationbox_State(nb, "initial removeAllNotifications immediate", null, 0); testtag_notificationbox_State(nb, "initial removeAllNotifications immediate", null, 0);
runTimedTests(tests, -1, nb, null); runTimedTests(tests, -1, nb, null);
@ -73,7 +73,7 @@ var tests =
// append a new notification // append a new notification
var ntf = nb.appendNotification("Notification", "note", "happy.png", var ntf = nb.appendNotification("Notification", "note", "happy.png",
nb.PRIORITY_INFO_LOW, testtag_notificationbox_buttons); nb.PRIORITY_INFO_LOW, testtag_notificationbox_buttons);
SimpleTest.ise(ntf && ntf.localName == "notification", true, "append notification"); SimpleTest.is(ntf && ntf.localName == "notification", true, "append notification");
return ntf; return ntf;
}, },
result: function(nb, ntf) { result: function(nb, ntf) {
@ -83,10 +83,10 @@ var tests =
// check the getNotificationWithValue method // check the getNotificationWithValue method
var ntf_found = nb.getNotificationWithValue("note"); var ntf_found = nb.getNotificationWithValue("note");
SimpleTest.ise(ntf, ntf_found, "getNotificationWithValue note"); SimpleTest.is(ntf, ntf_found, "getNotificationWithValue note");
var none_found = nb.getNotificationWithValue("notenone"); var none_found = nb.getNotificationWithValue("notenone");
SimpleTest.ise(none_found, null, "getNotificationWithValue null"); SimpleTest.is(none_found, null, "getNotificationWithValue null");
return ntf; return ntf;
} }
}, },
@ -104,7 +104,7 @@ var tests =
try { try {
nb.removeNotification(ntf); nb.removeNotification(ntf);
} catch (ex) { exh = true; } } catch (ex) { exh = true; }
SimpleTest.ise(exh, true, "removeNotification again"); SimpleTest.is(exh, true, "removeNotification again");
testtag_notificationbox_State(nb, "removeNotification again", null, 0); testtag_notificationbox_State(nb, "removeNotification again", null, 0);
} }
@ -116,7 +116,7 @@ var tests =
nb.PRIORITY_INFO_LOW, nb.PRIORITY_INFO_LOW,
testtag_notificationbox_buttons, testtag_notificationbox_buttons,
notification_eventCallback); notification_eventCallback);
SimpleTest.ise(ntf && ntf.localName == "notification", true, "append notification with callback"); SimpleTest.is(ntf && ntf.localName == "notification", true, "append notification with callback");
return ntf; return ntf;
}, },
result: function(nb, ntf) { result: function(nb, ntf) {
@ -162,12 +162,12 @@ var tests =
testtag_notification_State(nb, ntf, "append", "Notification", "note", testtag_notification_State(nb, ntf, "append", "Notification", "note",
"happy.png", nb.PRIORITY_WARNING_LOW); "happy.png", nb.PRIORITY_WARNING_LOW);
var button = ntf.querySelector(".notification-button"); var button = ntf.querySelector(".notification-button");
SimpleTest.ise(button.type, "menu-button", "Button type should be set"); SimpleTest.is(button.type, "menu-button", "Button type should be set");
var menuPopup = button.getElementsByTagNameNS(NSXUL, "menupopup"); var menuPopup = button.getElementsByTagNameNS(NSXUL, "menupopup");
SimpleTest.ise(menuPopup.length, 1, "There should be a menu attached"); SimpleTest.is(menuPopup.length, 1, "There should be a menu attached");
var menuItem = menuPopup[0].firstChild; var menuItem = menuPopup[0].firstChild;
SimpleTest.ise(menuItem.localName, "menuitem", "There should be a menu item"); SimpleTest.is(menuItem.localName, "menuitem", "There should be a menu item");
SimpleTest.ise(menuItem.getAttribute("label"), "Menu Item", "Label should match"); SimpleTest.is(menuItem.getAttribute("label"), "Menu Item", "Label should match");
// Clean up. // Clean up.
nb.removeNotification(ntf); nb.removeNotification(ntf);
@ -184,7 +184,7 @@ var tests =
// append a new notification // append a new notification
ntf = nb.appendNotification("Notification", "note", "happy.png", ntf = nb.appendNotification("Notification", "note", "happy.png",
nb.PRIORITY_INFO_LOW, testtag_notificationbox_buttons); nb.PRIORITY_INFO_LOW, testtag_notificationbox_buttons);
SimpleTest.ise(ntf && ntf.localName == "notification", true, "append notification"); SimpleTest.is(ntf && ntf.localName == "notification", true, "append notification");
// Test persistence // Test persistence
ntf.persistence++; ntf.persistence++;
@ -205,14 +205,14 @@ var tests =
testtag_notificationbox_State(nb, "notification added", ntf, 1); testtag_notificationbox_State(nb, "notification added", ntf, 1);
testtag_notification_State(nb, ntf, "append", "Notification", "note", testtag_notification_State(nb, ntf, "append", "Notification", "note",
"happy.png", nb.PRIORITY_INFO_LOW); "happy.png", nb.PRIORITY_INFO_LOW);
SimpleTest.ise(ntf.persistence, 1, "persistence is 1"); SimpleTest.is(ntf.persistence, 1, "persistence is 1");
return [++idx, ntf]; return [++idx, ntf];
case 2: case 2:
testtag_notificationbox_State(nb, "first removeTransientNotifications", ntf, 1); testtag_notificationbox_State(nb, "first removeTransientNotifications", ntf, 1);
testtag_notification_State(nb, ntf, "append", "Notification", "note", testtag_notification_State(nb, ntf, "append", "Notification", "note",
"happy.png", nb.PRIORITY_INFO_LOW); "happy.png", nb.PRIORITY_INFO_LOW);
SimpleTest.ise(ntf.persistence, 0, "persistence is now 0"); SimpleTest.is(ntf.persistence, 0, "persistence is now 0");
return [++idx, ntf]; return [++idx, ntf];
case 3: case 3:
@ -227,7 +227,7 @@ var tests =
// append another notification // append another notification
var ntf = nb.appendNotification("Notification", "note", "happy.png", var ntf = nb.appendNotification("Notification", "note", "happy.png",
nb.PRIORITY_INFO_MEDIUM, testtag_notificationbox_buttons); nb.PRIORITY_INFO_MEDIUM, testtag_notificationbox_buttons);
SimpleTest.ise(ntf && ntf.localName == "notification", true, "append notification again"); SimpleTest.is(ntf && ntf.localName == "notification", true, "append notification again");
return ntf; return ntf;
}, },
result: function(nb, ntf) { result: function(nb, ntf) {
@ -257,9 +257,9 @@ var tests =
result: function(nb, ntf) { result: function(nb, ntf) {
// test the removeAllNotifications method // test the removeAllNotifications method
testtag_notificationbox_State(nb, "append info_high", ntf, 1); testtag_notificationbox_State(nb, "append info_high", ntf, 1);
SimpleTest.ise(ntf.priority, nb.PRIORITY_INFO_HIGH, SimpleTest.is(ntf.priority, nb.PRIORITY_INFO_HIGH,
"notification.priority " + nb.PRIORITY_INFO_HIGH); "notification.priority " + nb.PRIORITY_INFO_HIGH);
SimpleTest.ise(nb.removeAllNotifications(false), undefined, "removeAllNotifications"); SimpleTest.is(nb.removeAllNotifications(false), undefined, "removeAllNotifications");
} }
}, },
{ {
@ -278,7 +278,7 @@ var tests =
return ntf; return ntf;
}, },
result: function(nb, ntf) { result: function(nb, ntf) {
SimpleTest.ise(nb.currentNotification == ntf ? SimpleTest.is(nb.currentNotification == ntf ?
nb.currentNotification.value : null, "10", "appendNotification order"); nb.currentNotification.value : null, "10", "appendNotification order");
return 1; return 1;
} }
@ -310,8 +310,8 @@ var tests =
}, },
result: function(nb, arr) { result: function(nb, arr) {
// arr is [testindex, expectedvalue] // arr is [testindex, expectedvalue]
SimpleTest.ise(nb.currentNotification.value, "" + arr[1], "close order " + arr[0]); SimpleTest.is(nb.currentNotification.value, "" + arr[1], "close order " + arr[0]);
SimpleTest.ise(nb.allNotifications.length, 10 - arr[0], "close order " + arr[0] + " count"); SimpleTest.is(nb.allNotifications.length, 10 - arr[0], "close order " + arr[0] + " count");
if (arr[0] == 6) if (arr[0] == 6)
this.repeat = false; this.repeat = false;
return ++arr[0]; return ++arr[0];
@ -323,13 +323,13 @@ var tests =
try { try {
nb.appendNotification("no", "no", "no", 0, null); nb.appendNotification("no", "no", "no", 0, null);
} catch (ex) { exh = true; } } catch (ex) { exh = true; }
SimpleTest.ise(exh, true, "appendNotification priority too low"); SimpleTest.is(exh, true, "appendNotification priority too low");
exh = false; exh = false;
try { try {
nb.appendNotification("no", "no", "no", 11, null); nb.appendNotification("no", "no", "no", 11, null);
} catch (ex) { exh = true; } } catch (ex) { exh = true; }
SimpleTest.ise(exh, true, "appendNotification priority too high"); SimpleTest.is(exh, true, "appendNotification priority too high");
// check that the other priority types work properly // check that the other priority types work properly
runTimedTests(appendPriorityTests, -1, nb, nb.PRIORITY_WARNING_LOW); runTimedTests(appendPriorityTests, -1, nb, nb.PRIORITY_WARNING_LOW);
@ -342,11 +342,11 @@ var appendPriorityTests = [
test: function(nb, priority) { test: function(nb, priority) {
var ntf = nb.appendNotification("Notification", "note", "happy.png", var ntf = nb.appendNotification("Notification", "note", "happy.png",
priority, testtag_notificationbox_buttons); priority, testtag_notificationbox_buttons);
SimpleTest.ise(ntf && ntf.localName == "notification", true, "append notification " + priority); SimpleTest.is(ntf && ntf.localName == "notification", true, "append notification " + priority);
return [ntf, priority]; return [ntf, priority];
}, },
result: function(nb, obj) { result: function(nb, obj) {
SimpleTest.ise(obj[0].priority, obj[1], "notification.priority " + obj[1]); SimpleTest.is(obj[0].priority, obj[1], "notification.priority " + obj[1]);
return obj[1]; return obj[1];
} }
}, },
@ -370,18 +370,18 @@ var appendPriorityTests = [
function testtag_notificationbox_State(nb, testid, expecteditem, expectedcount) function testtag_notificationbox_State(nb, testid, expecteditem, expectedcount)
{ {
SimpleTest.ise(nb.currentNotification, expecteditem, testid + " currentNotification"); SimpleTest.is(nb.currentNotification, expecteditem, testid + " currentNotification");
SimpleTest.ise(nb.allNotifications ? nb.allNotifications.length : "no value", SimpleTest.is(nb.allNotifications ? nb.allNotifications.length : "no value",
expectedcount, testid + " allNotifications"); expectedcount, testid + " allNotifications");
} }
function testtag_notification_State(nb, ntf, testid, label, value, image, priority) function testtag_notification_State(nb, ntf, testid, label, value, image, priority)
{ {
SimpleTest.ise(ntf.control, nb, testid + " notification.control"); SimpleTest.is(ntf.control, nb, testid + " notification.control");
SimpleTest.ise(ntf.label, label, testid + " notification.label"); SimpleTest.is(ntf.label, label, testid + " notification.label");
SimpleTest.ise(ntf.value, value, testid + " notification.value"); SimpleTest.is(ntf.value, value, testid + " notification.value");
SimpleTest.ise(ntf.image, image, testid + " notification.image"); SimpleTest.is(ntf.image, image, testid + " notification.image");
SimpleTest.ise(ntf.priority, priority, testid + " notification.priority"); SimpleTest.is(ntf.priority, priority, testid + " notification.priority");
var type; var type;
switch (priority) { switch (priority) {
@ -403,7 +403,7 @@ function testtag_notification_State(nb, ntf, testid, label, value, image, priori
break; break;
} }
SimpleTest.ise(ntf.type, type, testid + " notification.type"); SimpleTest.is(ntf.type, type, testid + " notification.type");
} }
function checkPopupTest(nb, ntf) function checkPopupTest(nb, ntf)

View File

@ -23,27 +23,27 @@ function doTests() {
var n1 = document.getElementById("n1"); var n1 = document.getElementById("n1");
var n2 = document.getElementById("n2"); var n2 = document.getElementById("n2");
SimpleTest.ise(n1.mode, "", "mode determined"); SimpleTest.is(n1.mode, "", "mode determined");
SimpleTest.ise(n2.mode, "undetermined", "mode undetermined"); SimpleTest.is(n2.mode, "undetermined", "mode undetermined");
SimpleTest.ise(n1.value, "0", "determined value"); SimpleTest.is(n1.value, "0", "determined value");
SimpleTest.ise(n2.value, "0", "undetermined value"); SimpleTest.is(n2.value, "0", "undetermined value");
// values can only be incremented in multiples of 4 // values can only be incremented in multiples of 4
n1.value = 2; n1.value = 2;
SimpleTest.ise(n1.value, "0", "determined value set 2"); SimpleTest.is(n1.value, "0", "determined value set 2");
n1.value = -1; n1.value = -1;
SimpleTest.ise(n1.value, "0", "determined value set -1"); SimpleTest.is(n1.value, "0", "determined value set -1");
n1.value = 125; n1.value = 125;
SimpleTest.ise(n1.value, "100", "determined value set 125"); SimpleTest.is(n1.value, "100", "determined value set 125");
n1.value = 7; n1.value = 7;
SimpleTest.ise(n1.value, "7", "determined value set 7"); SimpleTest.is(n1.value, "7", "determined value set 7");
n1.value = "17"; n1.value = "17";
SimpleTest.ise(n1.value, "17", "determined value set 17 string"); SimpleTest.is(n1.value, "17", "determined value set 17 string");
n1.value = 18; n1.value = 18;
SimpleTest.ise(n1.value, "17", "determined value set 18"); SimpleTest.is(n1.value, "17", "determined value set 18");
n1.value = "Cat"; n1.value = "Cat";
SimpleTest.ise(n1.value, "17", "determined value set invalid"); SimpleTest.is(n1.value, "17", "determined value set invalid");
n1.max = 200; n1.max = 200;
is(n1.max, "200", "max changed"); is(n1.max, "200", "max changed");
@ -52,19 +52,19 @@ function doTests() {
is(n1.value, "120", "max lowered below value"); is(n1.value, "120", "max lowered below value");
n2.value = 2; n2.value = 2;
SimpleTest.ise(n2.value, "0", "undetermined value set 2"); SimpleTest.is(n2.value, "0", "undetermined value set 2");
n2.value = -1; n2.value = -1;
SimpleTest.ise(n2.value, "0", "undetermined value set -1"); SimpleTest.is(n2.value, "0", "undetermined value set -1");
n2.value = 125; n2.value = 125;
SimpleTest.ise(n2.value, "100", "undetermined value set 125"); SimpleTest.is(n2.value, "100", "undetermined value set 125");
n2.value = 7; n2.value = 7;
SimpleTest.ise(n2.value, "7", "undetermined value set 7"); SimpleTest.is(n2.value, "7", "undetermined value set 7");
n2.value = "17"; n2.value = "17";
SimpleTest.ise(n2.value, "17", "undetermined value set 17 string"); SimpleTest.is(n2.value, "17", "undetermined value set 17 string");
n2.value = 18; n2.value = 18;
SimpleTest.ise(n2.value, "17", "undetermined value set 18"); SimpleTest.is(n2.value, "17", "undetermined value set 18");
n2.value = "Cat"; n2.value = "Cat";
SimpleTest.ise(n2.value, "17", "determined value set invalid"); SimpleTest.is(n2.value, "17", "determined value set invalid");
SimpleTest.finish(); SimpleTest.finish();
} }

View File

@ -61,14 +61,14 @@ function doTests() {
ok(n1.spinButtons != null && n1.spinButtons.localName == "spinbuttons", "spinButtons set"); ok(n1.spinButtons != null && n1.spinButtons.localName == "spinbuttons", "spinButtons set");
isnot(n1.decimalSymbol, "", "n1.decimalSymbol is set to something"); isnot(n1.decimalSymbol, "", "n1.decimalSymbol is set to something");
n1.decimalSymbol = "."; n1.decimalSymbol = ".";
SimpleTest.ise(n1.decimalSymbol, ".", "n1.decimalSymbol set to '.'"); SimpleTest.is(n1.decimalSymbol, ".", "n1.decimalSymbol set to '.'");
SimpleTest.ise(n1.wrapAround, false, "wrapAround defaults to false"); SimpleTest.is(n1.wrapAround, false, "wrapAround defaults to false");
SimpleTest.ise(n1.increment, 1, "increment defaults to 1"); SimpleTest.is(n1.increment, 1, "increment defaults to 1");
SimpleTest.ise(n1.decimalPlaces, 0, "decimalPlaces defaults to 0"); SimpleTest.is(n1.decimalPlaces, 0, "decimalPlaces defaults to 0");
SimpleTest.ise(n2.wrapAround, true, "wrapAround when set to true"); SimpleTest.is(n2.wrapAround, true, "wrapAround when set to true");
SimpleTest.ise(n3.increment, 3, "increment when set to 1"); SimpleTest.is(n3.increment, 3, "increment when set to 1");
SimpleTest.ise(n7.decimalPlaces, 2, "decimalPlaces when set to 2"); SimpleTest.is(n7.decimalPlaces, 2, "decimalPlaces when set to 2");
// test changing the value // test changing the value
n1.value = "1700"; n1.value = "1700";
@ -139,7 +139,7 @@ function doTests() {
n7.min = 2.7; n7.min = 2.7;
n7.value = 10.1; n7.value = 10.1;
n7.increment = 4.3; n7.increment = 4.3;
SimpleTest.ise(n7.increment, 4.3, "increment changed"); SimpleTest.is(n7.increment, 4.3, "increment changed");
testIncreaseDecrease(n7, "integer with increment", 4.3, 2, 2.7, 10.1); testIncreaseDecrease(n7, "integer with increment", 4.3, 2, 2.7, 10.1);
n2.value = n2.min; n2.value = n2.min;
@ -149,7 +149,7 @@ function doTests() {
testVals(n2, "integer wraparound decrease method", n2.min); testVals(n2, "integer wraparound decrease method", n2.min);
n7.wrapAround = true; n7.wrapAround = true;
SimpleTest.ise(n7.wrapAround, true, "change wrapAround"); SimpleTest.is(n7.wrapAround, true, "change wrapAround");
n7.value = n7.min + 0.01; n7.value = n7.min + 0.01;
n7.decrease(); n7.decrease();
testVals(n7, "decimal wraparound decrease method", n7.max, n7.max.toFixed(2)); testVals(n7, "decimal wraparound decrease method", n7.max, n7.max.toFixed(2));
@ -168,12 +168,12 @@ function doTests() {
testVals(n1, "set decimalPlaces Infinity set value,", 10.678123); testVals(n1, "set decimalPlaces Infinity set value,", 10.678123);
n1.decimalSymbol = ","; n1.decimalSymbol = ",";
SimpleTest.ise(n1.decimalSymbol, ",", "n1.decimalSymbol set to ','"); SimpleTest.is(n1.decimalSymbol, ",", "n1.decimalSymbol set to ','");
n1.value = "9.67"; n1.value = "9.67";
testVals(n1, "set decimalPlaces set value,", 9.67); testVals(n1, "set decimalPlaces set value,", 9.67);
n1.decimalSymbol = "."; n1.decimalSymbol = ".";
SimpleTest.ise(n1.decimalSymbol, ".", "n1.decimalSymbol set back to '.'"); SimpleTest.is(n1.decimalSymbol, ".", "n1.decimalSymbol set back to '.'");
n1.decimalPlaces = 0; n1.decimalPlaces = 0;
// UI tests // UI tests
@ -285,19 +285,19 @@ function testVals(nb, name, valueNumber, valueFieldNumber) {
if (valueFieldNumber === undefined) if (valueFieldNumber === undefined)
valueFieldNumber = "" + valueNumber; valueFieldNumber = "" + valueNumber;
SimpleTest.ise(nb.value, "" + valueNumber, name + " value is '" + valueNumber + "'"); SimpleTest.is(nb.value, "" + valueNumber, name + " value is '" + valueNumber + "'");
SimpleTest.ise(nb.valueNumber, valueNumber, name + " valueNumber is " + valueNumber); SimpleTest.is(nb.valueNumber, valueNumber, name + " valueNumber is " + valueNumber);
// This value format depends on the localized decimal symbol. // This value format depends on the localized decimal symbol.
var localizedValue = valueFieldNumber.replace(/\./, nb.decimalSymbol); var localizedValue = valueFieldNumber.replace(/\./, nb.decimalSymbol);
SimpleTest.ise(nb.inputField.value, localizedValue, SimpleTest.is(nb.inputField.value, localizedValue,
name + " inputField value is '" + localizedValue + "'"); name + " inputField value is '" + localizedValue + "'");
} }
function testValsMinMax(nb, name, valueNumber, min, max, valueFieldNumber) { function testValsMinMax(nb, name, valueNumber, min, max, valueFieldNumber) {
testVals(nb, name, valueNumber, valueFieldNumber); testVals(nb, name, valueNumber, valueFieldNumber);
SimpleTest.ise(nb.min, min, name + " min is " + min); SimpleTest.is(nb.min, min, name + " min is " + min);
SimpleTest.ise(nb.max, max, name + " max is " + max); SimpleTest.is(nb.max, max, name + " max is " + max);
} }
function testIncreaseDecrease(nb, testid, increment, fixedCount, min, max) function testIncreaseDecrease(nb, testid, increment, fixedCount, min, max)

View File

@ -104,8 +104,8 @@ addTest(function checkAuddie() {
var fnDO = iframeDO.getOwnPropertyDescriptor('auddie').value; var fnDO = iframeDO.getOwnPropertyDescriptor('auddie').value;
var AuddieDO = iframeDO.makeDebuggeeValue(doc.getElementById('Auddie')); var AuddieDO = iframeDO.makeDebuggeeValue(doc.getElementById('Auddie'));
ise(fnDO.class, 'Function', is(fnDO.class, 'Function',
"Script element 'Auddie' defined function 'auddie'."); "Script element 'Auddie' defined function 'auddie'.");
ok(fnDO.script.source.element === AuddieDO, ok(fnDO.script.source.element === AuddieDO,
"Function auddie's script belongs to script element 'Auddie'"); "Function auddie's script belongs to script element 'Auddie'");
is(fnDO.script.source.elementAttributeName, undefined, is(fnDO.script.source.elementAttributeName, undefined,
@ -159,18 +159,18 @@ addTest(function XULDocumentScript() {
var xulDoc = xulFrame.contentWindow.document; var xulDoc = xulFrame.contentWindow.document;
var xulieDO = xulFrameDO.makeDebuggeeValue(xulDoc.getElementById('xulie')); var xulieDO = xulFrameDO.makeDebuggeeValue(xulDoc.getElementById('xulie'));
var xulFnDO = xulFrameDO.getOwnPropertyDescriptor('xulScriptFunc').value; var xulFnDO = xulFrameDO.getOwnPropertyDescriptor('xulScriptFunc').value;
ise(typeof xulFnDO, 'object', "XUL script element defined 'xulScriptFunc'"); is(typeof xulFnDO, 'object', "XUL script element defined 'xulScriptFunc'");
ise(xulFnDO.class, 'Function', is(xulFnDO.class, 'Function',
"XUL global 'xulScriptFunc' is indeed a function"); "XUL global 'xulScriptFunc' is indeed a function");
// A XUL document's script elements' code gets shared amongst all // A XUL document's script elements' code gets shared amongst all
// instantiations of the document, so there's no specific DOM element // instantiations of the document, so there's no specific DOM element
// we can attribute the code to. // we can attribute the code to.
ise(xulFnDO.script.source.element, undefined, is(xulFnDO.script.source.element, undefined,
"XUL script code should not be attributed to any individual element"); "XUL script code should not be attributed to any individual element");
ise(xulFnDO.script.source.introductionType, 'scriptElement', is(xulFnDO.script.source.introductionType, 'scriptElement',
"xulScriptFunc's introduction type is 'scriptElement'"); "xulScriptFunc's introduction type is 'scriptElement'");
runNextTest(); runNextTest();
} }
}); });

View File

@ -40,7 +40,7 @@ function onAttach(aState, aResponse)
tests.push(function() { tests.push(function() {
aState.client.evaluateJS("throw " + value + ";", function(aResponse) { aState.client.evaluateJS("throw " + value + ";", function(aResponse) {
let exception = aResponse.exception; let exception = aResponse.exception;
ise(exception, value, "response.exception for throw " + value); is(exception, value, "response.exception for throw " + value);
nextTest(); nextTest();
}); });
}); });