Bug 1577746 - Enable ESLint rule dot-notation for dom/. r=baku

Depends on D44149

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mark Banner 2019-09-02 11:23:05 +00:00
parent 351d147e2f
commit acd70816c6
61 changed files with 349 additions and 350 deletions

View File

@ -258,7 +258,6 @@ module.exports = {
],
"rules": {
"consistent-return": "off",
"dot-notation": "off",
"mozilla/avoid-removeChild": "off",
"mozilla/consistent-if-bracing": "off",
"mozilla/no-arbitrary-setTimeout": "off",

View File

@ -60,19 +60,19 @@ function checkIndividualResults(testname, expected) {
testname + " test: some image loads required in results object."
);
is(
results["img"].count,
results.img.count,
2,
testname + " Test: Expected 2 loads for image requests."
);
expected.forEach(function(ref) {
ok(
results["img"].referrers.includes(ref),
results.img.referrers.includes(ref),
testname +
" Test: Expected " +
ref +
" referrer policy in test, results were " +
JSON.stringify(results["img"].referrers) +
JSON.stringify(results.img.referrers) +
"."
);
});
@ -100,7 +100,7 @@ function checkExpectedGlobalResults(testName) {
for (policy in response[type][scheme]) {
var expectedResult =
EXPECTED_RESULTS[type] === undefined
? EXPECTED_RESULTS["default"][scheme][policy]
? EXPECTED_RESULTS.default[scheme][policy]
: EXPECTED_RESULTS[type][scheme][policy];
is(
response[type][scheme][policy],

View File

@ -76,17 +76,17 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
function fn_onmessage(e) {
if (e.currentTarget == e.target && e.target.hits != null)
e.target.hits['fn_onmessage']++;
e.target.hits.fn_onmessage++;
}
function fn_event_listener_message(e) {
if (e.currentTarget == e.target && e.target.hits != null)
e.target.hits['fn_event_listener_message']++;
e.target.hits.fn_event_listener_message++;
}
function fn_other_event_name(e) {
if (e.currentTarget == e.target && e.target.hits != null)
e.target.hits['fn_other_event_name']++;
e.target.hits.fn_other_event_name++;
}
var gEventSourceObj1 = null, gEventSourceObj1_e, gEventSourceObj1_f;
@ -105,9 +105,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
// the test when running in slow machines
function hasBeenHitFor1And2(obj, min) {
if (obj.hits['fn_onmessage'] < min ||
obj.hits['fn_event_listener_message'] < min ||
obj.hits['fn_other_event_name'] < min)
if (obj.hits.fn_onmessage < min ||
obj.hits.fn_event_listener_message < min ||
obj.hits.fn_other_event_name < min)
return false;
return true;
}
@ -130,11 +130,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
function doTest1_b(test_id) {
gEventSourceObj1.hits = [];
gEventSourceObj1.hits['fn_onmessage'] = 0;
gEventSourceObj1.hits.fn_onmessage = 0;
gEventSourceObj1.onmessage = fn_onmessage;
gEventSourceObj1.hits['fn_event_listener_message'] = 0;
gEventSourceObj1.hits.fn_event_listener_message = 0;
gEventSourceObj1.addEventListener('message', fn_event_listener_message, true);
gEventSourceObj1.hits['fn_other_event_name'] = 0;
gEventSourceObj1.hits.fn_other_event_name = 0;
gEventSourceObj1.addEventListener('other_event_name', fn_other_event_name, true);
// the eventsources.res always use a retry of 0.5 second, so for four hits a timeout of 6 seconds is enough
@ -154,9 +154,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
}
function doTest1_d(test_id) {
gEventSourceObj1.hits['fn_onmessage'] = 0;
gEventSourceObj1.hits['fn_event_listener_message'] = 0;
gEventSourceObj1.hits['fn_other_event_name'] = 0;
gEventSourceObj1.hits.fn_onmessage = 0;
gEventSourceObj1.hits.fn_event_listener_message = 0;
gEventSourceObj1.hits.fn_other_event_name = 0;
setTimeout(function(){
bhits = hasBeenHitFor1And2(gEventSourceObj1, 1);
@ -237,10 +237,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
gEventSourceObj3_a.onmessage = fn_onmessage;
gEventSourceObj3_a.hits = [];
gEventSourceObj3_a.hits['fn_onmessage'] = 0;
gEventSourceObj3_a.hits.fn_onmessage = 0;
setTimeout(function() {
ok(gEventSourceObj3_a.hits['fn_onmessage'] == 0, "Test 3.a failed");
ok(gEventSourceObj3_a.hits.fn_onmessage == 0, "Test 3.a failed");
gEventSourceObj3_a.close();
setTestHasFinished(test_id);
}, parseInt(1500*stress_factor));
@ -262,10 +262,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
gEventSourceObj3_b.onmessage = fn_onmessage;
gEventSourceObj3_b.hits = [];
gEventSourceObj3_b.hits['fn_onmessage'] = 0;
gEventSourceObj3_b.hits.fn_onmessage = 0;
setTimeout(function() {
ok(gEventSourceObj3_b.hits['fn_onmessage'] == 0, "Test 3.b failed");
ok(gEventSourceObj3_b.hits.fn_onmessage == 0, "Test 3.b failed");
gEventSourceObj3_b.close();
setTestHasFinished(test_id);
}, parseInt(1500*stress_factor));
@ -282,10 +282,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
gEventSourceObj3_c.onmessage = fn_onmessage;
gEventSourceObj3_c.hits = [];
gEventSourceObj3_c.hits['fn_onmessage'] = 0;
gEventSourceObj3_c.hits.fn_onmessage = 0;
setTimeout(function() {
ok(gEventSourceObj3_c.hits['fn_onmessage'] == 0, "Test 3.c failed");
ok(gEventSourceObj3_c.hits.fn_onmessage == 0, "Test 3.c failed");
gEventSourceObj3_c.close();
setTestHasFinished(test_id);
}, parseInt(1500*stress_factor));
@ -296,10 +296,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
gEventSourceObj3_d.onmessage = fn_onmessage;
gEventSourceObj3_d.hits = [];
gEventSourceObj3_d.hits['fn_onmessage'] = 0;
gEventSourceObj3_d.hits.fn_onmessage = 0;
setTimeout(function() {
ok(gEventSourceObj3_d.hits['fn_onmessage'] == 0, "Test 3.d failed");
ok(gEventSourceObj3_d.hits.fn_onmessage == 0, "Test 3.d failed");
gEventSourceObj3_d.close();
setTestHasFinished(test_id);
}, parseInt(1500*stress_factor));
@ -310,10 +310,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
gEventSourceObj3_e.onmessage = fn_onmessage;
gEventSourceObj3_e.hits = [];
gEventSourceObj3_e.hits['fn_onmessage'] = 0;
gEventSourceObj3_e.hits.fn_onmessage = 0;
setTimeout(function() {
ok(gEventSourceObj3_e.hits['fn_onmessage'] == 0, "Test 3.e failed");
ok(gEventSourceObj3_e.hits.fn_onmessage == 0, "Test 3.e failed");
gEventSourceObj3_e.close();
setTestHasFinished(test_id);
}, parseInt(1500*stress_factor));
@ -324,10 +324,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
gEventSourceObj3_f.onmessage = fn_onmessage;
gEventSourceObj3_f.hits = [];
gEventSourceObj3_f.hits['fn_onmessage'] = 0;
gEventSourceObj3_f.hits.fn_onmessage = 0;
setTimeout(function() {
ok(gEventSourceObj3_f.hits['fn_onmessage'] == 0, "Test 3.f failed");
ok(gEventSourceObj3_f.hits.fn_onmessage == 0, "Test 3.f failed");
gEventSourceObj3_f.close();
setTestHasFinished(test_id);
}, parseInt(1500*stress_factor));
@ -342,10 +342,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
gEventSourceObj3_g.onmessage = fn_onmessage;
gEventSourceObj3_g.hits = [];
gEventSourceObj3_g.hits['fn_onmessage'] = 0;
gEventSourceObj3_g.hits.fn_onmessage = 0;
setTimeout(function() {
ok(gEventSourceObj3_g.hits['fn_onmessage'] == 0, "Test 3.g failed");
ok(gEventSourceObj3_g.hits.fn_onmessage == 0, "Test 3.g failed");
gEventSourceObj3_g.close();
setTestHasFinished(test_id);
}, parseInt(1500*stress_factor));
@ -365,11 +365,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
gEventSourceObj3_h.onmessage = fn_onmessage;
gEventSourceObj3_h.hits = [];
gEventSourceObj3_h.hits['fn_onmessage'] = 0;
gEventSourceObj3_h.hits.fn_onmessage = 0;
setTimeout(function() {
ok(gEventSourceObj3_h.hits['fn_onmessage'] > 1, "Test 3.h.1 failed");
if (gEventSourceObj3_h.hits['fn_onmessage'] > 1) {
ok(gEventSourceObj3_h.hits.fn_onmessage > 1, "Test 3.h.1 failed");
if (gEventSourceObj3_h.hits.fn_onmessage > 1) {
ok(fnMessageListenerTest3h.msg_ok, "Test 3.h.2 failed");
ok(fnMessageListenerTest3h.id_ok, "Test 3.h.3 failed");
}
@ -438,10 +438,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
gEventSourceObj5_a.onmessage = fn_onmessage;
gEventSourceObj5_a.hits = [];
gEventSourceObj5_a.hits['fn_onmessage'] = 0;
gEventSourceObj5_a.hits.fn_onmessage = 0;
setTimeout(function() {
ok(gEventSourceObj5_a.hits['fn_onmessage'] != 0, "Test 5.a failed");
ok(gEventSourceObj5_a.hits.fn_onmessage != 0, "Test 5.a failed");
gEventSourceObj5_a.close();
setTestHasFinished(test_id);
}, parseInt(3000*stress_factor));
@ -453,10 +453,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
gEventSourceObj5_b.onmessage = fn_onmessage;
gEventSourceObj5_b.hits = [];
gEventSourceObj5_b.hits['fn_onmessage'] = 0;
gEventSourceObj5_b.hits.fn_onmessage = 0;
setTimeout(function() {
ok(gEventSourceObj5_b.hits['fn_onmessage'] == 0, "Test 5.b failed");
ok(gEventSourceObj5_b.hits.fn_onmessage == 0, "Test 5.b failed");
gEventSourceObj5_b.close();
setTestHasFinished(test_id);
}, parseInt(3000*stress_factor));
@ -481,10 +481,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
fn_onmessage(e);
};
gEventSourceObj5_c.hits = [];
gEventSourceObj5_c.hits['fn_onmessage'] = 0;
gEventSourceObj5_c.hits.fn_onmessage = 0;
setTimeout(function() {
ok(gEventSourceObj5_c.hits['fn_onmessage'] > 0, "Test 5.c failed");
ok(gEventSourceObj5_c.hits.fn_onmessage > 0, "Test 5.c failed");
gEventSourceObj5_c.close();
doTest5_d(test_id);
}, parseInt(3000*stress_factor));
@ -507,10 +507,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
fn_onmessage(e);
};
gEventSourceObj5_d.hits = [];
gEventSourceObj5_d.hits['fn_onmessage'] = 0;
gEventSourceObj5_d.hits.fn_onmessage = 0;
setTimeout(function() {
ok(gEventSourceObj5_d.hits['fn_onmessage'] == 0, "Test 5.d failed");
ok(gEventSourceObj5_d.hits.fn_onmessage == 0, "Test 5.d failed");
gEventSourceObj5_d.close();
setTestHasFinished(test_id);
}, parseInt(3000*stress_factor));
@ -535,10 +535,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
fn_onmessage(e);
};
gEventSourceObj5_e.hits = [];
gEventSourceObj5_e.hits['fn_onmessage'] = 0;
gEventSourceObj5_e.hits.fn_onmessage = 0;
setTimeout(function() {
ok(gEventSourceObj5_e.hits['fn_onmessage'] > 0, "Test 5.e failed");
ok(gEventSourceObj5_e.hits.fn_onmessage > 0, "Test 5.e failed");
gEventSourceObj5_e.close();
doTest5_f(test_id);
}, parseInt(5000*stress_factor));
@ -562,10 +562,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=338583
fn_onmessage(e);
};
gEventSourceObj5_f.hits = [];
gEventSourceObj5_f.hits['fn_onmessage'] = 0;
gEventSourceObj5_f.hits.fn_onmessage = 0;
setTimeout(function() {
ok(gEventSourceObj5_f.hits['fn_onmessage'] == 0, "Test 5.f failed");
ok(gEventSourceObj5_f.hits.fn_onmessage == 0, "Test 5.f failed");
gEventSourceObj5_f.close();
setTestHasFinished(test_id);
}, parseInt(3000*stress_factor));

View File

@ -157,7 +157,7 @@ function request_document() {
// GeckoView shows an error page for CSP errors, which breaks this test, so just skip in that case.
try {
if (!SpecialPowers.Cc["@mozilla.org/android/bridge;1"].getService(SpecialPowers.Ci.nsIAndroidBridge).isFennec) {
lastContentType = Ci.nsIContentPolicy["TYPE_DOCUMENT"];
lastContentType = Ci.nsIContentPolicy.TYPE_DOCUMENT;
return;
}
} catch (e){}

View File

@ -23,10 +23,10 @@ SimpleTest.waitForExplicitFinish();
var xhr = new XMLHttpRequest();
xhr.onload = function() {
is(xhr.response["foo"], "bar", "Should have gotten bar on baseline");
is(xhr.response.foo, "bar", "Should have gotten bar on baseline");
xhr.onload = function() {
is(xhr.response["foo"], "bar", "Should have gotten bar with BOM");
is(xhr.response.foo, "bar", "Should have gotten bar with BOM");
xhr.onload = function() {
is(xhr.response, null, "Should have gotten null response with UTF-16 JSON");

View File

@ -14,7 +14,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=891952
SimpleTest.waitForExplicitFinish();
addLoadEvent(function() {
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");
is(all[""], undefined, "Should not get empty string on document.all");
is(all.namedItem(""), null,

View File

@ -9,7 +9,7 @@
WEBGL_TYPES = {};
WEBGL_TYPES['experimental-webgl'] = true;
WEBGL_TYPES['webgl'] = true;
WEBGL_TYPES.webgl = true;
function AreBothIn(a, b, set) {
return (a in set) && (b in set);
@ -73,7 +73,7 @@ if (IsWebGLFunctional())
functionalTypeSet['experimental-webgl'] = true;
if (IsWebGLConformant())
functionalTypeSet['webgl'] = true;
functionalTypeSet.webgl = true;
for (var i in typeList) {
var creationType = typeList[i];

View File

@ -33,14 +33,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=910211
function next(event) {
if (event) {
is(event.data, current['encoding'], "Got bad encoding for " + current["tld"]);
is(event.data, current.encoding, "Got bad encoding for " + current.tld);
}
current = tlds.shift();
if (!current) {
SimpleTest.finish();
return;
}
iframe.src = "http://example." + current["tld"] + "/tests/dom/encoding/test/file_TLD.html";
iframe.src = "http://example." + current.tld + "/tests/dom/encoding/test/file_TLD.html";
}
</script>

View File

@ -20,14 +20,14 @@ addListeners(document.getElementById("target1"));
// Function allows to initialize prerequisites before testing
// and adds some callbacks to support mochitest system.
function resultCallback(aTestObj) {
var message = aTestObj["name"] + " (";
message += "Get: " + JSON.stringify(aTestObj["status"]) + ", ";
message += "Expect: " + JSON.stringify(aTestObj["PASS"]) + ")";
var message = aTestObj.name + " (";
message += "Get: " + JSON.stringify(aTestObj.status) + ", ";
message += "Expect: " + JSON.stringify(aTestObj.PASS) + ")";
window.opener.postMessage(
{
type: "RESULT",
message,
result: aTestObj["status"] === aTestObj["PASS"],
result: aTestObj.status === aTestObj.PASS,
},
PARENT_ORIGIN
);

View File

@ -104,7 +104,7 @@
test_pointerEvent = setup_pointerevent_test("got/lost pointercapture: subsequent events to target", ALL_POINTERS); // set up test harness
var listener = document.getElementById("listener");
var target0 = document.getElementById("target0");
target0.style["touchAction"] = "none";
target0.style.touchAction = "none";
// target0 and listener - handle all events
for (var i = 0; i < All_Pointer_Events.length; i++) {

View File

@ -25,7 +25,7 @@
function run() {
var target0 = document.getElementById("target0");
target0.style["touchAction"] = "none";
target0.style.touchAction = "none";
var listener = document.getElementById("listener");
// try to release pointer capture with an invalid id

View File

@ -24,7 +24,7 @@
function run() {
var target0 = document.getElementById("target0");
target0.style["touchAction"] = "none";
target0.style.touchAction = "none";
var listener = document.getElementById("complete-notice");
on_event(target0, "pointerdown", function (event) {

View File

@ -184,38 +184,38 @@ function testBlockBubbling() {
function testOnPointerProperty()
{
iframeBody.onpointerdown = function (e) { gOnPointerPropHandled["pointerdown"] = true; }
iframeBody.onpointerup = function (e) { gOnPointerPropHandled["pointerup"] = true; }
iframeBody.onpointermove = function (e) { gOnPointerPropHandled["pointermove"] = true; }
iframeBody.onpointerout = function (e) { gOnPointerPropHandled["pointerout"] = true; }
iframeBody.onpointerover = function (e) { gOnPointerPropHandled["pointerover"] = true; }
iframeBody.onpointerenter = function (e) { gOnPointerPropHandled["pointerenter"] = true; }
iframeBody.onpointerleave = function (e) { gOnPointerPropHandled["pointerleave"] = true; }
iframeBody.onpointercancel = function (e) { gOnPointerPropHandled["pointercancel"] = true; }
iframeBody.onpointerdown = function (e) { gOnPointerPropHandled.pointerdown = true; }
iframeBody.onpointerup = function (e) { gOnPointerPropHandled.pointerup = true; }
iframeBody.onpointermove = function (e) { gOnPointerPropHandled.pointermove = true; }
iframeBody.onpointerout = function (e) { gOnPointerPropHandled.pointerout = true; }
iframeBody.onpointerover = function (e) { gOnPointerPropHandled.pointerover = true; }
iframeBody.onpointerenter = function (e) { gOnPointerPropHandled.pointerenter = true; }
iframeBody.onpointerleave = function (e) { gOnPointerPropHandled.pointerleave = true; }
iframeBody.onpointercancel = function (e) { gOnPointerPropHandled.pointercancel = true; }
iframeBody.dispatchEvent(getDefaultArgEvent("pointerdown"));
is(gOnPointerPropHandled['pointerdown'], true, "pointerdown property is performed");
is(gOnPointerPropHandled.pointerdown, true, "pointerdown property is performed");
iframeBody.dispatchEvent(getDefaultArgEvent("pointerup"));
is(gOnPointerPropHandled['pointerup'], true, "pointerup property is performed");
is(gOnPointerPropHandled.pointerup, true, "pointerup property is performed");
iframeBody.dispatchEvent(getDefaultArgEvent("pointermove"));
is(gOnPointerPropHandled['pointermove'], true, "pointermove property is performed");
is(gOnPointerPropHandled.pointermove, true, "pointermove property is performed");
iframeBody.dispatchEvent(getDefaultArgEvent("pointerout"));
is(gOnPointerPropHandled['pointerout'], true, "pointerout property is performed");
is(gOnPointerPropHandled.pointerout, true, "pointerout property is performed");
iframeBody.dispatchEvent(getDefaultArgEvent("pointerover"));
is(gOnPointerPropHandled['pointerover'], true, "pointerover property is performed");
is(gOnPointerPropHandled.pointerover, true, "pointerover property is performed");
iframeBody.dispatchEvent(getDefaultArgEvent("pointerenter"));
is(gOnPointerPropHandled['pointerenter'], true, "pointerenter property is performed");
is(gOnPointerPropHandled.pointerenter, true, "pointerenter property is performed");
iframeBody.dispatchEvent(getDefaultArgEvent("pointerleave"));
is(gOnPointerPropHandled['pointerleave'], true, "pointerleave property is performed");
is(gOnPointerPropHandled.pointerleave, true, "pointerleave property is performed");
iframeBody.dispatchEvent(getDefaultArgEvent("pointercancel"));
is(gOnPointerPropHandled['pointercancel'], true, "pointercancel property is performed");
is(gOnPointerPropHandled.pointercancel, true, "pointercancel property is performed");
nextTest();
}

View File

@ -722,9 +722,9 @@ function* testOnWheelAttr()
yield synthesizeWheel(gScrollableElement, 10, 10,
{ deltaMode: WheelEvent.DOM_DELTA_LINE,
deltaX: 1.0, deltaY: 2.0 });
ok(gOnWheelAttrHandled['html'], "html element's onwheel attribute isn't performed");
ok(gOnWheelAttrHandled['body'], "body element's onwheel attribute isn't performed");
ok(gOnWheelAttrHandled['div'], "div element's onwheel attribute isn't performed");
ok(gOnWheelAttrHandled.html, "html element's onwheel attribute isn't performed");
ok(gOnWheelAttrHandled.body, "body element's onwheel attribute isn't performed");
ok(gOnWheelAttrHandled.div, "div element's onwheel attribute isn't performed");
}
var gOnWheelPropHandled = new Array;
@ -751,11 +751,11 @@ function* testOnWheelProperty()
{ deltaMode: WheelEvent.DOM_DELTA_LINE,
deltaX: 1.0, deltaY: 2.0 });
ok(gOnWheelPropHandled['window'], "window's onwheel property isn't performed");
ok(gOnWheelPropHandled['document'], "document's onwheel property isn't performed");
ok(gOnWheelPropHandled['html'], "html element's onwheel property isn't performed");
ok(gOnWheelPropHandled['body'], "body element's onwheel property isn't performed");
ok(gOnWheelPropHandled['div'], "div element's onwheel property isn't performed");
ok(gOnWheelPropHandled.window, "window's onwheel property isn't performed");
ok(gOnWheelPropHandled.document, "document's onwheel property isn't performed");
ok(gOnWheelPropHandled.html, "html element's onwheel property isn't performed");
ok(gOnWheelPropHandled.body, "body element's onwheel property isn't performed");
ok(gOnWheelPropHandled.div, "div element's onwheel property isn't performed");
}
function* testBody()

View File

@ -39,7 +39,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1286509
synthesizeKey("KEY_ArrowDown");
synthesizeKey("KEY_ArrowLeft");
synthesizeKey("KEY_ArrowRight");
is(eventCounts['change'], 4, "Expect key up/down/left/right should trigger range input to fire change events");
is(eventCounts.change, 4, "Expect key up/down/left/right should trigger range input to fire change events");
SimpleTest.finish();
}
addLoadEvent(test);

View File

@ -56,7 +56,7 @@ function runTestsForNextInputType()
function checkValueSubmittedIsValid()
{
is(frames['submit_frame'].location.href,
is(frames.submit_frame.location.href,
'http://mochi.test:8888/tests/dom/html/test/forms/foo?i='
+ urlify(gValidData[valueIndex++]),
"The submitted value should not have been sanitized");
@ -79,7 +79,7 @@ function checkValueSubmittedIsValid()
function checkValueSubmittedIsInvalid()
{
is(frames['submit_frame'].location.href,
is(frames.submit_frame.location.href,
'http://mochi.test:8888/tests/dom/html/test/forms/foo?i=',
"The submitted value should have been sanitized");

View File

@ -311,7 +311,7 @@ function checkNotResetableAndFormSubmission(aElement)
aElement.max = 100.0;
document.getElementsByName('submit_frame')[0].addEventListener("load", function() {
is(frames['submit_frame'].location.href,
is(frames.submit_frame.location.href,
'http://mochi.test:8888/tests/dom/html/test/forms/foo?a=tulip',
"The meter element value should not be submitted");

View File

@ -10,7 +10,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=346485
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript">
frameLoaded = function() {
is(frames['submit_frame'].location.href, "about:blank",
is(frames.submit_frame.location.href, "about:blank",
"Blank frame loaded");
}
</script>
@ -135,7 +135,7 @@ function checkFormSubmission()
* element value should not appear.
*/
is(frames['submit_frame'].location.href,
is(frames.submit_frame.location.href,
'http://mochi.test:8888/tests/dom/html/test/forms/foo?a=afield&b=bfield',
"The output element value should not be submitted");
SimpleTest.finish();

View File

@ -247,7 +247,7 @@ function checkNotResetableAndFormSubmission(aElement)
aElement.max = 100.0;
document.getElementsByName('submit_frame')[0].addEventListener("load", function() {
is(frames['submit_frame'].location.href,
is(frames.submit_frame.location.href,
'http://mochi.test:8888/tests/dom/html/test/forms/foo?a=tulip',
"The progress element value should not be submitted");

View File

@ -52,10 +52,10 @@ function runTests() {
function runNext() {
let p = params[testIdx];
(p["focus"]) ? input.focus() : input.blur();
expectChange = p["valueChanged"] == 0 ? expectChange : expectChange + 1;
result += parseInt(p["valueChanged"]);
sendWheelAndPaint(input, 1, 1, { deltaY: p["deltaY"], deltaMode: p["deltaMode"] }, () => {
(p.focus) ? input.focus() : input.blur();
expectChange = p.valueChanged == 0 ? expectChange : expectChange + 1;
result += parseInt(p.valueChanged);
sendWheelAndPaint(input, 1, 1, { deltaY: p.deltaY, deltaMode: p.deltaMode }, () => {
ok(input.value == result,
"Handle wheel in number input test-" + testIdx + " expect " + result +
" get " + input.value);

View File

@ -52,10 +52,10 @@ function runTests() {
function runNext() {
let p = params[testIdx];
(p["focus"]) ? input.focus() : input.blur();
expectChange = p["valueChanged"] == 0 ? expectChange : expectChange + 1;
result += parseInt(p["valueChanged"]);
sendWheelAndPaint(input, 1, 1, { deltaY: p["deltaY"], deltaMode: p["deltaMode"] }, () => {
(p.focus) ? input.focus() : input.blur();
expectChange = p.valueChanged == 0 ? expectChange : expectChange + 1;
result += parseInt(p.valueChanged);
sendWheelAndPaint(input, 1, 1, { deltaY: p.deltaY, deltaMode: p.deltaMode }, () => {
ok(input.value == result,
"Handle wheel in range input test-" + testIdx + " expect " + result + " get " + input.value);
ok(rangeChange == expectChange,

View File

@ -49,8 +49,8 @@ function runTests() {
function runNext() {
let p = params[testIdx];
(p["focus"]) ? input.focus() : input.blur();
sendWheelAndPaint(input, 1, 1, { deltaY: p["deltaY"], deltaMode: p["deltaMode"] }, () => {
(p.focus) ? input.focus() : input.blur();
sendWheelAndPaint(input, 1, 1, { deltaY: p.deltaY, deltaMode: p.deltaMode }, () => {
ok(input.value == result,
"Handle wheel in range input test-" + testIdx + " expect " + result + " get " + input.value);
ok(rangeChange == 0, "Wheel event should not trigger change event when max < min");

View File

@ -16,14 +16,14 @@
var form1 = document.getElementById("form1");
form1.insertBefore(input2, input1);
is(form1.elements["input"].length, 3, "Form 1 'input' has the correct length");
is(form1.elements["input"][0].value, "2", "Form 1 element 1 is correct");
is(form1.elements["input"][1].value, "1", "Form 1 element 2 is correct");
is(form1.elements["input"][2].value, "3", "Form 1 element 3 is correct");
is(form1.elements.input.length, 3, "Form 1 'input' has the correct length");
is(form1.elements.input[0].value, "2", "Form 1 element 1 is correct");
is(form1.elements.input[1].value, "1", "Form 1 element 2 is correct");
is(form1.elements.input[2].value, "3", "Form 1 element 3 is correct");
is(form1.elements["input"][0].id, "input2", "Form 1 element 1 id is correct");
is(form1.elements["input"][1].id, "input1", "Form 1 element 2 id is correct");
is(form1.elements["input"][2].id, "input3", "Form 1 element 3 id is correct");
is(form1.elements.input[0].id, "input2", "Form 1 element 1 id is correct");
is(form1.elements.input[1].id, "input1", "Form 1 element 2 id is correct");
is(form1.elements.input[2].id, "input3", "Form 1 element 3 id is correct");
</script>
</body>
</html>

View File

@ -16,14 +16,14 @@
var form1 = document.getElementById("form1");
form1.insertBefore(input2, input1);
is(form1.elements["input"].length, 3, "Form 1 'input' has the correct length");
is(form1.elements["input"][0].value, "2", "Form 1 element 1 is correct");
is(form1.elements["input"][1].value, "1", "Form 1 element 2 is correct");
is(form1.elements["input"][2].value, "3", "Form 1 element 3 is correct");
is(form1.elements.input.length, 3, "Form 1 'input' has the correct length");
is(form1.elements.input[0].value, "2", "Form 1 element 1 is correct");
is(form1.elements.input[1].value, "1", "Form 1 element 2 is correct");
is(form1.elements.input[2].value, "3", "Form 1 element 3 is correct");
is(form1.elements["input"][0].id, "input", "Form 1 element 1 id is correct");
is(form1.elements["input"][1].id, "input1", "Form 1 element 2 id is correct");
is(form1.elements["input"][2].id, "input3", "Form 1 element 3 id is correct");
is(form1.elements.input[0].id, "input", "Form 1 element 1 id is correct");
is(form1.elements.input[1].id, "input1", "Form 1 element 2 id is correct");
is(form1.elements.input[2].id, "input3", "Form 1 element 3 id is correct");
</script>
</body>
</html>

View File

@ -16,12 +16,12 @@
var form1 = document.getElementById("form1");
form1.insertBefore(input2, input1);
is(form1.elements["input"].length, 3, "Form 1 'input' has the correct length");
is(form1.elements["input"][0].value, "2", "Form 1 element 1 is correct");
is(form1.elements["input"][1].value, "1", "Form 1 element 2 is correct");
is(form1.elements.input.length, 3, "Form 1 'input' has the correct length");
is(form1.elements.input[0].value, "2", "Form 1 element 1 is correct");
is(form1.elements.input[1].value, "1", "Form 1 element 2 is correct");
is(form1.elements["input"][0].id, "input", "Form 1 element 1 id is correct");
is(form1.elements["input"][1].id, "input1", "Form 1 element 2 id is correct");
is(form1.elements.input[0].id, "input", "Form 1 element 1 id is correct");
is(form1.elements.input[1].id, "input1", "Form 1 element 2 id is correct");
</script>
</body>
</html>

View File

@ -41,28 +41,28 @@
form1.insertBefore(input8, input4);
form1.insertBefore(input9, input2);
is(form1.elements["input"].length, 10, "Form 1 'input' has the correct length");
is(form1.elements["input"][0].value, "9", "Form 1 element 1 is correct");
is(form1.elements["input"][1].value, "2", "Form 1 element 2 is correct");
is(form1.elements["input"][2].value, "1", "Form 1 element 3 is correct");
is(form1.elements["input"][3].value, "3", "Form 1 element 4 is correct");
is(form1.elements["input"][4].value, "8", "Form 1 element 5 is correct");
is(form1.elements["input"][5].value, "4", "Form 1 element 6 is correct");
is(form1.elements["input"][6].value, "5", "Form 1 element 7 is correct");
is(form1.elements["input"][7].value, "10", "Form 1 element 8 is correct");
is(form1.elements["input"][8].value, "6", "Form 1 element 9 is correct");
is(form1.elements["input"][9].value, "7", "Form 1 element 10 is correct");
is(form1.elements.input.length, 10, "Form 1 'input' has the correct length");
is(form1.elements.input[0].value, "9", "Form 1 element 1 is correct");
is(form1.elements.input[1].value, "2", "Form 1 element 2 is correct");
is(form1.elements.input[2].value, "1", "Form 1 element 3 is correct");
is(form1.elements.input[3].value, "3", "Form 1 element 4 is correct");
is(form1.elements.input[4].value, "8", "Form 1 element 5 is correct");
is(form1.elements.input[5].value, "4", "Form 1 element 6 is correct");
is(form1.elements.input[6].value, "5", "Form 1 element 7 is correct");
is(form1.elements.input[7].value, "10", "Form 1 element 8 is correct");
is(form1.elements.input[8].value, "6", "Form 1 element 9 is correct");
is(form1.elements.input[9].value, "7", "Form 1 element 10 is correct");
is(form1.elements["input"][0].id, "input9", "Form 1 element 1 id is correct");
is(form1.elements["input"][1].id, "input2", "Form 1 element 2 id is correct");
is(form1.elements["input"][2].id, "input1", "Form 1 element 3 id is correct");
is(form1.elements["input"][3].id, "input3", "Form 1 element 4 id is correct");
is(form1.elements["input"][4].id, "input8", "Form 1 element 5 id is correct");
is(form1.elements["input"][5].id, "input4", "Form 1 element 6 id is correct");
is(form1.elements["input"][6].id, "input5", "Form 1 element 7 id is correct");
is(form1.elements["input"][7].id, "input10", "Form 1 element 8 id is correct");
is(form1.elements["input"][8].id, "input6", "Form 1 element 9 id is correct");
is(form1.elements["input"][9].id, "input7", "Form 1 element 10 id is correct");
is(form1.elements.input[0].id, "input9", "Form 1 element 1 id is correct");
is(form1.elements.input[1].id, "input2", "Form 1 element 2 id is correct");
is(form1.elements.input[2].id, "input1", "Form 1 element 3 id is correct");
is(form1.elements.input[3].id, "input3", "Form 1 element 4 id is correct");
is(form1.elements.input[4].id, "input8", "Form 1 element 5 id is correct");
is(form1.elements.input[5].id, "input4", "Form 1 element 6 id is correct");
is(form1.elements.input[6].id, "input5", "Form 1 element 7 id is correct");
is(form1.elements.input[7].id, "input10", "Form 1 element 8 id is correct");
is(form1.elements.input[8].id, "input6", "Form 1 element 9 id is correct");
is(form1.elements.input[9].id, "input7", "Form 1 element 10 id is correct");
</script>
</body>

View File

@ -31,7 +31,7 @@
addLoadEvent(function() {
document.getElementsByName('submit_frame')[0].onload = function() {
is(frames['submit_frame'].location.href, "http://mochi.test:8888/blah?field1=teststring&field2=0&field4=1&field6=3&field7=2&field8=8&field9=9&field12=", "Submit string was correct.");
is(frames.submit_frame.location.href, "http://mochi.test:8888/blah?field1=teststring&field2=0&field4=1&field6=3&field7=2&field8=8&field9=9&field12=", "Submit string was correct.");
SimpleTest.finish();
};

View File

@ -56,7 +56,7 @@
addLoadEvent(function() {
document.getElementsByName('submit_frame')[0].onload = function() {
is(frames['submit_frame'].location.href, "http://mochi.test:8888/blah?field1-2=teststring&field2-2=0&field4-2=1&field6-2=3&field7-2=2&field8-2=8&field9-2=9&field12-2=&field1=teststring&field2=0&field4=1&field6=3&field7=2&field8=8&field9=9&field12=&field14=14&field14-2=14", "Submit string was correct.");
is(frames.submit_frame.location.href, "http://mochi.test:8888/blah?field1-2=teststring&field2-2=0&field4-2=1&field6-2=3&field7-2=2&field8-2=8&field9-2=9&field12-2=&field1=teststring&field2=0&field4=1&field6=3&field7=2&field8=8&field9=9&field12=&field14=14&field14-2=14", "Submit string was correct.");
SimpleTest.finish();
};

View File

@ -22,7 +22,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=481440
for (var i = 0; i < 500; ++i) {
document.getElementById(i);
}
is(document.all["x"], document.getElementById("y"),
is(document.all.x, document.getElementById("y"),
"Unexpected node");
</script>
</pre>

View File

@ -22,9 +22,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=529819
<script type="application/javascript">
/** Test for Bug 529819 **/
is($("form").elements["foo"] instanceof HTMLInputElement, true, "Should have an element here");
is($("form").elements["bar"] instanceof HTMLInputElement, false, "Should have a list here");
is($("form").elements["bar"].length, 2, "Should have a list with two elements here");
is($("form").elements.foo instanceof HTMLInputElement, true, "Should have an element here");
is($("form").elements.bar instanceof HTMLInputElement, false, "Should have a list here");
is($("form").elements.bar.length, 2, "Should have a list with two elements here");
</script>
</pre>

View File

@ -48,7 +48,7 @@ function initializeNextTest()
function runTests()
{
document.getElementById('iframe').addEventListener('load', function(aEvent) {
is(frames['submit_frame'].location.href,
is(frames.submit_frame.location.href,
"http://mochi.test:8888/tests/dom/html/test/" + gTestData[gCurrentTest],
"The form should have been submitted");
gCurrentTest++;

View File

@ -49,7 +49,7 @@ function initializeNextTest()
function runTests()
{
document.getElementById('iframe').addEventListener('load', function(aEvent) {
is(frames['submit_frame'].location.href,
is(frames.submit_frame.location.href,
"http://mochi.test:8888/tests/dom/html/test/" + gTestData[gCurrentTest],
"The form should have been submitted");
gCurrentTest++;

View File

@ -49,7 +49,7 @@ function initializeNextTest()
function runTests()
{
document.getElementById('iframe').addEventListener('load', function(aEvent) {
is(frames['submit_frame'].location.href,
is(frames.submit_frame.location.href,
"http://mochi.test:8888/tests/dom/html/test/" + gTestData[gCurrentTest],
"The form should have been submitted");
gCurrentTest++;

View File

@ -42,11 +42,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=650295
};
if (nextEventIdx >= eventsToAbortOn.indexOf("speechstart")) {
expectedEvents["speechstart"] = null;
expectedEvents.speechstart = null;
}
if (nextEventIdx >= eventsToAbortOn.indexOf("speechend")) {
expectedEvents["speechend"] = null;
expectedEvents.speechend = null;
}
info("Aborting on " + nextEvent);

View File

@ -21,7 +21,7 @@ function checkResults(reportObj) {
is(cspReport["document-uri"], docUri, "Incorrect document-uri");
// we can not test for the whole referrer since it includes platform specific information
is(cspReport["referrer"], document.location.toString(), "Incorrect referrer");
is(cspReport.referrer, document.location.toString(), "Incorrect referrer");
is(cspReport["blocked-uri"], document.location.toString(), "Incorrect blocked-uri");
is(cspReport["violated-directive"], "frame-ancestors", "Incorrect violated-directive");
is(cspReport["original-policy"], "frame-ancestors 'none'; report-uri http://mochi.test:8888/foo.sjs", "Incorrect original-policy");

View File

@ -29,25 +29,25 @@ function checkStyles(evt) {
// black means the style wasn't applied. green colors are used for styles
//expected to be applied. A color is red if a style is erroneously applied
color = window.getComputedStyle(cspframe.contentDocument.getElementById('linkstylediv'))['color'];
color = window.getComputedStyle(cspframe.contentDocument.getElementById('linkstylediv')).color;
ok('rgb(0, 255, 0)' === color, 'External Stylesheet (' + color + ')');
color = window.getComputedStyle(cspframe.contentDocument.getElementById('inlinestylediv'))['color'];
color = window.getComputedStyle(cspframe.contentDocument.getElementById('inlinestylediv')).color;
ok('rgb(0, 0, 0)' === color, 'Inline Style TAG (' + color + ')');
color = window.getComputedStyle(cspframe.contentDocument.getElementById('attrstylediv'))['color'];
color = window.getComputedStyle(cspframe.contentDocument.getElementById('attrstylediv')).color;
ok('rgb(0, 0, 0)' === color, 'Style Attribute (' + color + ')');
color = window.getComputedStyle(cspframe.contentDocument.getElementById('csstextstylediv'))['color'];
color = window.getComputedStyle(cspframe.contentDocument.getElementById('csstextstylediv')).color;
ok('rgb(0, 255, 0)' === color, 'cssText (' + color + ')');
// SMIL tests
color = window.getComputedStyle(cspframe.contentDocument.getElementById('xmlTest',null))['fill'];
color = window.getComputedStyle(cspframe.contentDocument.getElementById('xmlTest',null)).fill;
ok('rgb(0, 0, 0)' === color, 'XML Attribute styling (SMIL) (' + color + ')');
color = window.getComputedStyle(cspframe.contentDocument.getElementById('cssOverrideTest',null))['fill'];
color = window.getComputedStyle(cspframe.contentDocument.getElementById('cssOverrideTest',null)).fill;
ok('rgb(0, 0, 0)' === color, 'CSS Override styling (SMIL) (' + color + ')');
color = window.getComputedStyle(cspframe.contentDocument.getElementById('cssOverrideTestById',null))['fill'];
color = window.getComputedStyle(cspframe.contentDocument.getElementById('cssOverrideTestById',null)).fill;
ok('rgb(0, 0, 0)' === color, 'CSS Override styling via ID lookup (SMIL) (' + color + ')');
color = window.getComputedStyle(cspframe.contentDocument.getElementById('cssSetTestById',null))['fill'];
color = window.getComputedStyle(cspframe.contentDocument.getElementById('cssSetTestById',null)).fill;
ok('rgb(0, 0, 0)' === color, 'CSS Set Element styling via ID lookup (SMIL) (' + color + ')');
color = window.getComputedStyle(cspframe.contentDocument.getElementById('modifycsstextdiv'))['color'];
color = window.getComputedStyle(cspframe.contentDocument.getElementById('modifycsstextdiv')).color;
ok('rgb(0, 255, 0)' === color, 'Modify loaded style sheet via cssText (' + color + ')');
checkIfDone();
@ -61,28 +61,28 @@ function checkStylesAllowed(evt) {
// black means the style wasn't applied. green colors are used for styles
// expected to be applied. A color is red if a style is erroneously applied
color = window.getComputedStyle(cspframe.contentDocument.getElementById('linkstylediv'))['color'];
color = window.getComputedStyle(cspframe.contentDocument.getElementById('linkstylediv')).color;
ok('rgb(0, 255, 0)' === color, 'External Stylesheet (' + color + ')');
color = window.getComputedStyle(cspframe.contentDocument.getElementById('inlinestylediv'))['color'];
color = window.getComputedStyle(cspframe.contentDocument.getElementById('inlinestylediv')).color;
ok('rgb(0, 255, 0)' === color, 'Inline Style TAG (' + color + ')');
color = window.getComputedStyle(cspframe.contentDocument.getElementById('attrstylediv'))['color'];
color = window.getComputedStyle(cspframe.contentDocument.getElementById('attrstylediv')).color;
ok('rgb(0, 255, 0)' === color, 'Style Attribute (' + color + ')');
// Note that the below test will fail if "script-src: 'unsafe-inline'" breaks,
// since it relies on executing script to set .cssText
color = window.getComputedStyle(cspframe.contentDocument.getElementById('csstextstylediv'))['color'];
color = window.getComputedStyle(cspframe.contentDocument.getElementById('csstextstylediv')).color;
ok('rgb(0, 255, 0)' === color, 'style.cssText (' + color + ')');
// SMIL tests
color = window.getComputedStyle(cspframe.contentDocument.getElementById('xmlTest',null))['fill'];
color = window.getComputedStyle(cspframe.contentDocument.getElementById('xmlTest',null)).fill;
ok('rgb(0, 255, 0)' === color, 'XML Attribute styling (SMIL) (' + color + ')');
color = window.getComputedStyle(cspframe.contentDocument.getElementById('cssOverrideTest',null))['fill'];
color = window.getComputedStyle(cspframe.contentDocument.getElementById('cssOverrideTest',null)).fill;
ok('rgb(0, 255, 0)' === color, 'CSS Override styling (SMIL) (' + color + ')');
color = window.getComputedStyle(cspframe.contentDocument.getElementById('cssOverrideTestById',null))['fill'];
color = window.getComputedStyle(cspframe.contentDocument.getElementById('cssOverrideTestById',null)).fill;
ok('rgb(0, 255, 0)' === color, 'CSS Override styling via ID lookup (SMIL) (' + color + ')');
color = window.getComputedStyle(cspframe.contentDocument.getElementById('cssSetTestById',null))['fill'];
color = window.getComputedStyle(cspframe.contentDocument.getElementById('cssSetTestById',null)).fill;
ok('rgb(0, 255, 0)' === color, 'CSS Set Element styling via ID lookup (SMIL) (' + color + ')');
color = window.getComputedStyle(cspframe.contentDocument.getElementById('modifycsstextdiv'))['color'];
color = window.getComputedStyle(cspframe.contentDocument.getElementById('modifycsstextdiv')).color;
ok('rgb(0, 255, 0)' === color, 'Modify loaded style sheet via cssText (' + color + ')');
checkIfDone();

View File

@ -44,15 +44,15 @@ function receiveMessage(event) {
switch (event.data.test) {
case "rootCSP_test":
is(event.data.msg, "img-blocked", "image should be blocked");
testsToRunMultipartCSP["rootCSP_test"] = true;
testsToRunMultipartCSP.rootCSP_test = true;
break;
case "part1CSP_test":
is(event.data.msg, "part1-img-loaded", "Part1 image should be loaded");
testsToRunMultipartCSP["part1CSP_test"] = true;
testsToRunMultipartCSP.part1CSP_test = true;
break;
case "part2CSP_test":
is(event.data.msg, "part2-img-blocked", "Part2 image should be blocked");
testsToRunMultipartCSP["part2CSP_test"] = true;
testsToRunMultipartCSP.part2CSP_test = true;
break;
}
checkTestsCompleted();

View File

@ -45,7 +45,7 @@ window.checkResults = function(reportObj) {
is(cspReport["document-uri"], docUri, "Incorrect document-uri");
// we can not test for the whole referrer since it includes platform specific information
ok(cspReport["referrer"].startsWith("http://mochi.test:8888/tests/dom/security/test/csp/test_report.html"),
ok(cspReport.referrer.startsWith("http://mochi.test:8888/tests/dom/security/test/csp/test_report.html"),
"Incorrect referrer");
is(cspReport["blocked-uri"], "inline", "Incorrect blocked-uri");

View File

@ -46,7 +46,7 @@ function checkResults(reportStr) {
var cspReport = reportObj["csp-report"];
is(cspReport["document-uri"], DOC_URI, "Incorrect document-uri");
is(cspReport["referrer"],
is(cspReport.referrer,
"http://mochi.test:8888/tests/dom/security/test/csp/test_report_for_import.html",
"Incorrect referrer");
is(cspReport["violated-directive"],

View File

@ -28,10 +28,10 @@ window.addEventListener("message", receiveMessage);
function receiveMessage(event) {
switch (event.data) {
case "test1":
testsToRun["test1"] = true;
testsToRun.test1 = true;
break;
case "test3":
testsToRun["test3"] = true;
testsToRun.test3 = true;
break;
}
}
@ -42,7 +42,7 @@ function test1() {
let win1 = window.open(TEST_FILE);
// testsToRun["test1"] will be false if toplevel data: URI is blocked
setTimeout(function () {
is(testsToRun["test1"], false,
is(testsToRun.test1, false,
"toplevel data: URI navigation through click() should be blocked");
win1.close();
test2();
@ -67,7 +67,7 @@ function test3() {
let win3 = window.open("file_block_toplevel_data_navigation3.html");
// testsToRun["test3"] will be false if toplevel data: URI is blocked
setTimeout(function () {
is(testsToRun["test3"], false,
is(testsToRun.test3, false,
"data: URI navigation through win.loc.href should be blocked");
win3.close();
test4();

View File

@ -91,38 +91,38 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=803225
/* Mixed Script tests */
case "about":
ok(event.data.msg == "resource with about protocol loaded", "resource with about protocol did not load");
testsToRun["about"] = true;
testsToRun.about = true;
break;
case "resource":
ok(event.data.msg == "resource with resource protocol loaded", "resource with resource protocol did not load");
testsToRun["resource"] = true;
testsToRun.resource = true;
break;
case "unsafe_about":
// This one should not load
ok(event.data.msg == "resource with unsafe about protocol did not load", "resource with unsafe about protocol loaded");
testsToRun["unsafe_about"] = true;
testsToRun.unsafe_about = true;
break;
case "data_protocol":
ok(event.data.msg == "resource with data protocol loaded", "resource with data protocol did not load");
testsToRun["data_protocol"] = true;
testsToRun.data_protocol = true;
break;
case "javascript":
ok(event.data.msg == "resource with javascript protocol loaded", "resource with javascript protocol did not load");
testsToRun["javascript"] = true;
testsToRun.javascript = true;
break;
case "wss":
ok(event.data.msg == "resource with wss protocol loaded", "resource with wss protocol did not load");
testsToRun["wss"] = true;
testsToRun.wss = true;
break;
case "mailto":
ok(event.data.msg == "resource with mailto protocol loaded", "resource with mailto protocol did not load");
testsToRun["mailto"] = true;
testsToRun.mailto = true;
break;
}
checkTestsCompleted();

View File

@ -91,22 +91,22 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=840388
case "insecurePage_navigate_child":
is(event.data.msg, "navigated to insecure iframe on insecure page", "navigating to insecure iframe blocked on insecure page");
testsToRunInsecure["insecurePage_navigate_child"] = true;
testsToRunInsecure.insecurePage_navigate_child = true;
break;
case "insecurePage_navigate_grandchild":
is(event.data.msg, "navigated to insecure grandchild iframe on insecure page", "navigating to insecure grandchild iframe blocked on insecure page");
testsToRunInsecure["insecurePage_navigate_grandchild"] = true;
testsToRunInsecure.insecurePage_navigate_grandchild = true;
break;
case "securePage_navigate_child":
ok(blockActive == (event.data.msg == "navigating to insecure iframe blocked on secure page"), "navigated to insecure iframe on secure page");
testsToRunSecure["securePage_navigate_child"] = true;
testsToRunSecure.securePage_navigate_child = true;
break;
case "blankTarget":
is(event.data.msg, "opened an http link with target=_blank from a secure page", "couldn't open an http link in a new window from a secure page");
testsToRunSecure["blankTarget"] = true;
testsToRunSecure.blankTarget = true;
break;
}

View File

@ -114,27 +114,27 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=62178
/* Mixed Script tests */
case "iframe":
ok(blockActive == (event.data.msg == "insecure iframe blocked"), "iframe did not follow block_active_content pref");
testsToRun["iframe"] = true;
testsToRun.iframe = true;
break;
case "object":
ok(blockActive == (event.data.msg == "insecure object blocked"), "object did not follow block_active_content pref");
testsToRun["object"] = true;
testsToRun.object = true;
break;
case "script":
ok(blockActive == (event.data.msg == "insecure script blocked"), "script did not follow block_active_content pref");
testsToRun["script"] = true;
testsToRun.script = true;
break;
case "stylesheet":
ok(blockActive == (event.data.msg == "insecure stylesheet blocked"), "stylesheet did not follow block_active_content pref");
testsToRun["stylesheet"] = true;
testsToRun.stylesheet = true;
break;
case "xhr":
ok(blockActive == (event.data.msg == "insecure xhr blocked"), "xhr did not follow block_active_content pref");
testsToRun["xhr"] = true;
testsToRun.xhr = true;
break;
/* Mixed Display tests */
@ -145,7 +145,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=62178
} else {
ok(blockDisplay == (event.data.msg == "insecure image blocked"), "image did not follow block_display_content pref");
}
testsToRun["image"] = true;
testsToRun.image = true;
break;
case "media":
@ -154,7 +154,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=62178
} else {
ok(blockDisplay == (event.data.msg == "insecure media blocked"), "media did not follow block_display_content pref");
}
testsToRun["media"] = true;
testsToRun.media = true;
break;
/* Images using the "imageset" policy, from <img srcset> and <picture>, do not get the mixed display exception */
@ -166,7 +166,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=62178
} else {
ok(blockActive == (event.data.msg == "insecure image blocked"), "imageSrcset did not follow block_active_content pref");
}
testsToRun["imageSrcset"] = true;
testsToRun.imageSrcset = true;
break;
case "imageSrcsetFallback":
@ -175,7 +175,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=62178
} else {
ok(blockActive == (event.data.msg == "insecure image blocked"), "imageSrcsetFallback did not follow block_active_content pref");
}
testsToRun["imageSrcsetFallback"] = true;
testsToRun.imageSrcsetFallback = true;
break;
case "imagePicture":
@ -184,7 +184,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=62178
} else {
ok(blockActive == (event.data.msg == "insecure image blocked"), "imagePicture did not follow block_active_content pref");
}
testsToRun["imagePicture"] = true;
testsToRun.imagePicture = true;
break;
case "imageJoinPicture":
@ -193,7 +193,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=62178
} else {
ok(blockActive == (event.data.msg == "insecure image blocked"), "imageJoinPicture did not follow block_active_content pref");
}
testsToRun["imageJoinPicture"] = true;
testsToRun.imageJoinPicture = true;
break;
// Should return to mixed display mode
@ -203,7 +203,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=62178
} else {
ok(blockDisplay == (event.data.msg == "insecure image blocked"), "imageLeavePicture did not follow block_display_content pref");
}
testsToRun["imageLeavePicture"] = true;
testsToRun.imageLeavePicture = true;
break;
}

View File

@ -21,8 +21,8 @@ addEventListener("fetch", function(event) {
event.respondWith(fetch(event.request));
} else if (event.request.url.includes("redirect")) {
let param = get_query_params(event.request.url);
let url = param["url"];
let mode = param["mode"];
let url = param.url;
let mode = param.mode;
event.respondWith(fetch(url, { mode }));
}

View File

@ -14,9 +14,9 @@ onnotificationclick = function(e) {
client.postMessage({
result:
e.notification.data &&
e.notification.data["complex"] &&
e.notification.data["complex"][0] == "jsval" &&
e.notification.data["complex"][1] == 5,
e.notification.data.complex &&
e.notification.data.complex[0] == "jsval" &&
e.notification.data.complex[1] == 5,
});
});
});

View File

@ -19,9 +19,9 @@ onnotificationclose = function(e) {
client.postMessage({
result:
e.notification.data &&
e.notification.data["complex"] &&
e.notification.data["complex"][0] == "jsval" &&
e.notification.data["complex"][1] == 5,
e.notification.data.complex &&
e.notification.data.complex[0] == "jsval" &&
e.notification.data.complex[1] == 5,
windowOpened,
});
});

View File

@ -101,61 +101,61 @@ function runTest() {
var mpathInvalidTargets = [gMpathInvalidTargetA, gMpathInvalidTargetB];
for (var i in mpathInvalidTargets) {
var curInvalidValue = mpathInvalidTargets[i];
attrSettings["mpath"] = curInvalidValue;
attrSettings.mpath = curInvalidValue;
testAttrSettings(attrSettings, gUnAnimatedCTM,
"invalid <mpath> should block animation");
}
delete attrSettings["mpath"];
delete attrSettings.mpath;
// Test that 'path' overrides everything below it
testAttrSettings(attrSettings, gPathCTM,
"'path' should win vs all but mpath");
attrSettings["path"] = gInvalidAttrValue;
attrSettings.path = gInvalidAttrValue;
testAttrSettings(attrSettings, gUnAnimatedCTM,
"invalid 'path' should block animation vs all but mpath");
delete attrSettings["path"];
delete attrSettings.path;
// Test that 'values' overrides everything below it
testAttrSettings(attrSettings, gValuesCTM,
"'values' should win vs from/by/to");
attrSettings["values"] = gInvalidAttrValue;
attrSettings.values = gInvalidAttrValue;
testAttrSettings(attrSettings, gUnAnimatedCTM,
"invalid 'values' should block animation vs from/by/to");
delete attrSettings["values"];
delete attrSettings.values;
// Test that 'from' & 'to' overrides 'by'
testAttrSettings(attrSettings, gFromToCTM,
"'from/to' should win vs 'by'");
attrSettings["to"] = gInvalidAttrValue;
attrSettings.to = gInvalidAttrValue;
testAttrSettings(attrSettings, gUnAnimatedCTM,
"invalid 'to' should block animation vs 'by'");
delete attrSettings["to"];
delete attrSettings.to;
// Test that 'from' & 'by' are effective
testAttrSettings(attrSettings, gFromByCTM,
"'from/by' should be visible");
attrSettings["by"] = gInvalidAttrValue;
attrSettings.by = gInvalidAttrValue;
testAttrSettings(attrSettings, gUnAnimatedCTM,
"invalid 'by' should block animation");
delete attrSettings["from"];
delete attrSettings.from;
// REINSERT "to" & fix up "by" so we can test pure-"to" vs pure-"by"
attrSettings["to"] = gToValidValue;
attrSettings["by"] = gByValidValue;
attrSettings.to = gToValidValue;
attrSettings.by = gByValidValue;
testAttrSettings(attrSettings, gPureToCTM,
"pure-'to' should be effective & beat pure-'by'");
attrSettings["to"] = gInvalidAttrValue;
attrSettings.to = gInvalidAttrValue;
testAttrSettings(attrSettings, gUnAnimatedCTM,
"invalid pure-'to' should block animation vs pure-'by'");
delete attrSettings["to"];
delete attrSettings.to;
// Test that pure-"by" is effective
testAttrSettings(attrSettings, gPureByCTM,
"pure-by should be visible");
attrSettings["by"] = gInvalidAttrValue;
attrSettings.by = gInvalidAttrValue;
testAttrSettings(attrSettings, gUnAnimatedCTM,
"invalid 'by' should block animation");
delete attrSettings["by"];
delete attrSettings.by;
// Make sure that our hash is empty now.
for (var unexpectedKey in attrSettings) {

View File

@ -2,7 +2,7 @@
<title></title>
<script type="text/javascript">
function finish() {
window.opener.finish(sessionStorage["testItem"]);
window.opener.finish(sessionStorage.testItem);
window.close();
}
</script>

View File

@ -48,7 +48,7 @@ function finish(val)
SimpleTest.waitForExplicitFinish();
function test1() {
sessionStorage["testItem"] = "correct value";
sessionStorage.testItem = "correct value";
gRunningTests++;
window.open('javascript:window.opener.finish(sessionStorage["testItem"]);window.close();');
@ -78,7 +78,7 @@ function test2() {
// Now change session storage and load a new item in gTestWin, to
// verify that they properly diverged after window.open().
gRunningTests++;
sessionStorage["testItem"] = "incorrect value";
sessionStorage.testItem = "incorrect value";
gTestWin.location = 'javascript:window.opener.finish(sessionStorage["testItem"]);';
}

View File

@ -42,7 +42,7 @@
function doTest() {
// Set up shortcut access to elements
e['html'] = document.getElementsByTagName("html")[0];
e.html = document.getElementsByTagName("html")[0];
['h1', 'd1', 'd2', 'p1', 'p2', 'p3', 'p4', 'p5', 'p6', 'span',
'a1', 'a2', 'a3', 'transf', 'iframe1', 'body'].forEach(function(a) {
e[a] = document.getElementById(a);

View File

@ -8,7 +8,7 @@
SimpleTest.waitForExplicitFinish();
function doTest() {
var sandbox = Cu.Sandbox("http://mochi.test:8888/", { wantXrays: true });
var win = window.frames["sameDomain"];
var win = window.frames.sameDomain;
sandbox.win = win;
sandbox.is = is;
sandbox.done = SimpleTest.finish;

View File

@ -17,7 +17,7 @@ function doStep()
case 2:
localStorage.setItem("a", "1");
is(localStorage["a"], "1", "Value a=1 set");
is(localStorage.a, "1", "Value a=1 set");
break;
case 3:
@ -27,7 +27,7 @@ function doStep()
catch (exc) {
ok(false, "Shouldn't throw when accessing key(0) " + exc);
}
is(localStorage["a"], "1", "Value a=1 set");
is(localStorage.a, "1", "Value a=1 set");
break;
default:

View File

@ -41,15 +41,15 @@ function startTest()
is(localStorage.key(-1), null, "key() should return null for out-of-bounds access");
is(localStorage.key(1), null, "key() should return null for out-of-bounds access");
is(localStorage.getItem("nonexisting"), null, "Nonexisting item is null (getItem())");
is(localStorage["nonexisting"], undefined, "Nonexisting item is undefined (array access)");
is(localStorage.nonexisting, undefined, "Nonexisting item is undefined (array access)");
is(localStorage.nonexisting, undefined, "Nonexisting item is undefined (property access)");
localStorage.removeItem("nonexisting"); // Just check there is no exception
is(typeof localStorage.getItem("nonexisting"), "object", "getItem('nonexisting') is object");
is(typeof localStorage["nonexisting"], "undefined", "['nonexisting'] is undefined");
is(typeof localStorage.nonexisting, "undefined", "['nonexisting'] is undefined");
is(typeof localStorage.nonexisting, "undefined", "nonexisting is undefined");
is(typeof localStorage.getItem("nonexisting2"), "object", "getItem('nonexisting2') is object");
is(typeof localStorage["nonexisting2"], "undefined", "['nonexisting2'] is undefined");
is(typeof localStorage.nonexisting2, "undefined", "['nonexisting2'] is undefined");
is(typeof localStorage.nonexisting2, "undefined", "nonexisting2 is undefined");
var localStorageCopy = localStorage;
@ -68,18 +68,18 @@ function startTest()
// add an empty-value key
localStorage.setItem("empty", "");
is(localStorage.getItem("empty"), "", "Empty value (getItem())");
is(localStorage["empty"], "", "Empty value (array access)");
is(localStorage.empty, "", "Empty value (array access)");
is(localStorage.empty, "", "Empty value (property access)");
is(typeof localStorage.getItem("empty"), "string", "getItem('empty') is string");
is(typeof localStorage["empty"], "string", "['empty'] is string");
is(typeof localStorage.empty, "string", "['empty'] is string");
is(typeof localStorage.empty, "string", "empty is string");
localStorage.removeItem("empty");
is(localStorage.length, 0, "The storage has no keys");
is(localStorage.getItem("empty"), null, "empty item is null (getItem())");
is(localStorage["empty"], undefined, "empty item is undefined (array access)");
is(localStorage.empty, undefined, "empty item is undefined (array access)");
is(localStorage.empty, undefined, "empty item is undefined (property access)");
is(typeof localStorage.getItem("empty"), "object", "getItem('empty') is object");
is(typeof localStorage["empty"], "undefined", "['empty'] is undefined");
is(typeof localStorage.empty, "undefined", "['empty'] is undefined");
is(typeof localStorage.empty, "undefined", "empty is undefined");
// add one key, check it is there
@ -92,11 +92,11 @@ function startTest()
// check all access method give the correct result
// and are of the correct type
is(localStorage.getItem("key1"), "value1", "getItem('key1') == value1");
is(localStorage["key1"], "value1", "['key1'] == value1");
is(localStorage.key1, "value1", "['key1'] == value1");
is(localStorage.key1, "value1", "key1 == value1");
is(typeof localStorage.getItem("key1"), "string", "getItem('key1') is string");
is(typeof localStorage["key1"], "string", "['key1'] is string");
is(typeof localStorage.key1, "string", "['key1'] is string");
is(typeof localStorage.key1, "string", "key1 is string");
// remove the previously added key and check the storage is empty
@ -106,7 +106,7 @@ function startTest()
is(localStorage.getItem("key1"), null, "\'key1\' removed");
is(typeof localStorage.getItem("key1"), "object", "getItem('key1') is object");
is(typeof localStorage["key1"], "undefined", "['key1'] is object");
is(typeof localStorage.key1, "undefined", "['key1'] is object");
is(typeof localStorage.key1, "undefined", "key1 is object");
// add one key, check it is there
@ -157,52 +157,52 @@ function startTest()
// JS property test
localStorage.testA = "valueA";
is(localStorage.testA, "valueA");
is(localStorage["testA"], "valueA");
is(localStorage.testA, "valueA");
is(localStorage.getItem("testA"), "valueA");
localStorage.testA = "valueA2";
is(localStorage.testA, "valueA2");
is(localStorage["testA"], "valueA2");
is(localStorage.testA, "valueA2");
is(localStorage.getItem("testA"), "valueA2");
localStorage["testB"] = "valueB";
localStorage.testB = "valueB";
is(localStorage.testB, "valueB");
is(localStorage.testB, "valueB");
is(localStorage["testB"], "valueB");
is(localStorage.getItem("testB"), "valueB");
localStorage["testB"] = "valueB2";
localStorage.testB = "valueB2";
is(localStorage.testB, "valueB2");
is(localStorage.testB, "valueB2");
is(localStorage["testB"], "valueB2");
is(localStorage.getItem("testB"), "valueB2");
localStorage.setItem("testC", "valueC");
is(localStorage.testC, "valueC");
is(localStorage["testC"], "valueC");
is(localStorage.testC, "valueC");
is(localStorage.getItem("testC"), "valueC");
localStorage.setItem("testC", "valueC2");
is(localStorage.testC, "valueC2");
is(localStorage["testC"], "valueC2");
is(localStorage.testC, "valueC2");
is(localStorage.getItem("testC"), "valueC2");
localStorage.setItem("testC", null);
is("testC" in localStorage, true);
is(localStorage.getItem("testC"), "null");
is(localStorage["testC"], "null");
is(localStorage.testC, "null");
is(localStorage.testC, "null");
localStorage.removeItem("testC");
localStorage["testC"] = null;
localStorage.testC = null;
is("testC" in localStorage, true);
is(localStorage.getItem("testC"), "null");
is(localStorage["testC"], "null");
is(localStorage.testC, "null");
is(localStorage.testC, "null");
localStorage.setItem(null, "test");
is("null" in localStorage, true);
is(localStorage.getItem("null"), "test");
is(localStorage.getItem(null), "test");
is(localStorage["null"], "test");
is(localStorage.null, "test");
localStorage.removeItem(null, "test");
is("null" in localStorage, false);

View File

@ -50,32 +50,32 @@ function doTest() {
is(privateWin.content.localStorage.key(-1), null, "key() should return null for out-of-bounds access");
is(privateWin.content.localStorage.key(1), null, "key() should return null for out-of-bounds access");
is(privateWin.content.localStorage.getItem("nonexisting"), null, "Nonexisting item is null (getItem())");
is(privateWin.content.localStorage["nonexisting"], undefined, "Nonexisting item is null (array access)");
is(privateWin.content.localStorage.nonexisting, undefined, "Nonexisting item is null (array access)");
is(privateWin.content.localStorage.nonexisting, undefined, "Nonexisting item is null (property access)");
privateWin.content.localStorage.removeItem("nonexisting"); // Just check there is no exception
is(typeof privateWin.content.localStorage.getItem("nonexisting"), "object", "getItem('nonexisting') is object");
is(typeof privateWin.content.localStorage["nonexisting"], "undefined", "['nonexisting'] is undefined");
is(typeof privateWin.content.localStorage.nonexisting, "undefined", "['nonexisting'] is undefined");
is(typeof privateWin.content.localStorage.nonexisting, "undefined", "nonexisting is undefined");
is(typeof privateWin.content.localStorage.getItem("nonexisting2"), "object", "getItem('nonexisting2') is object");
is(typeof privateWin.content.localStorage["nonexisting2"], "undefined", "['nonexisting2'] is undefined");
is(typeof privateWin.content.localStorage.nonexisting2, "undefined", "['nonexisting2'] is undefined");
is(typeof privateWin.content.localStorage.nonexisting2, "undefined", "nonexisting2 is undefined");
// add an empty-value key
privateWin.content.localStorage.setItem("empty", "");
is(privateWin.content.localStorage.getItem("empty"), "", "Empty value (getItem())");
is(privateWin.content.localStorage["empty"], "", "Empty value (array access)");
is(privateWin.content.localStorage.empty, "", "Empty value (array access)");
is(privateWin.content.localStorage.empty, "", "Empty value (property access)");
is(typeof privateWin.content.localStorage.getItem("empty"), "string", "getItem('empty') is string");
is(typeof privateWin.content.localStorage["empty"], "string", "['empty'] is string");
is(typeof privateWin.content.localStorage.empty, "string", "['empty'] is string");
is(typeof privateWin.content.localStorage.empty, "string", "empty is string");
privateWin.content.localStorage.removeItem("empty");
is(privateWin.content.localStorage.length, 0, "The storage has no keys");
is(privateWin.content.localStorage.getItem("empty"), null, "empty item is null (getItem())");
is(privateWin.content.localStorage["empty"], undefined, "empty item is undefined (array access)");
is(privateWin.content.localStorage.empty, undefined, "empty item is undefined (array access)");
is(privateWin.content.localStorage.empty, undefined, "empty item is undefined (property access)");
is(typeof privateWin.content.localStorage.getItem("empty"), "object", "getItem('empty') is object");
is(typeof privateWin.content.localStorage["empty"], "undefined", "['empty'] is undefined");
is(typeof privateWin.content.localStorage.empty, "undefined", "['empty'] is undefined");
is(typeof privateWin.content.localStorage.empty, "undefined", "empty is undefined");
// add one key, check it is there
@ -88,11 +88,11 @@ function doTest() {
// check all access method give the correct result
// and are of the correct type
is(privateWin.content.localStorage.getItem("key1"), "value1", "getItem('key1') == value1");
is(privateWin.content.localStorage["key1"], "value1", "['key1'] == value1");
is(privateWin.content.localStorage.key1, "value1", "['key1'] == value1");
is(privateWin.content.localStorage.key1, "value1", "key1 == value1");
is(typeof privateWin.content.localStorage.getItem("key1"), "string", "getItem('key1') is string");
is(typeof privateWin.content.localStorage["key1"], "string", "['key1'] is string");
is(typeof privateWin.content.localStorage.key1, "string", "['key1'] is string");
is(typeof privateWin.content.localStorage.key1, "string", "key1 is string");
// remove the previously added key and check the storage is empty
@ -102,7 +102,7 @@ function doTest() {
is(privateWin.content.localStorage.getItem("key1"), null, "\'key1\' removed");
is(typeof privateWin.content.localStorage.getItem("key1"), "object", "getItem('key1') is object");
is(typeof privateWin.content.localStorage["key1"], "undefined", "['key1'] is undefined");
is(typeof privateWin.content.localStorage.key1, "undefined", "['key1'] is undefined");
is(typeof privateWin.content.localStorage.key1, "undefined", "key1 is undefined");
// add one key, check it is there
@ -153,52 +153,52 @@ function doTest() {
// JS property test
privateWin.content.localStorage.testA = "valueA";
is(privateWin.content.localStorage.testA, "valueA");
is(privateWin.content.localStorage["testA"], "valueA");
is(privateWin.content.localStorage.testA, "valueA");
is(privateWin.content.localStorage.getItem("testA"), "valueA");
privateWin.content.localStorage.testA = "valueA2";
is(privateWin.content.localStorage.testA, "valueA2");
is(privateWin.content.localStorage["testA"], "valueA2");
is(privateWin.content.localStorage.testA, "valueA2");
is(privateWin.content.localStorage.getItem("testA"), "valueA2");
privateWin.content.localStorage["testB"] = "valueB";
privateWin.content.localStorage.testB = "valueB";
is(privateWin.content.localStorage.testB, "valueB");
is(privateWin.content.localStorage.testB, "valueB");
is(privateWin.content.localStorage["testB"], "valueB");
is(privateWin.content.localStorage.getItem("testB"), "valueB");
privateWin.content.localStorage["testB"] = "valueB2";
privateWin.content.localStorage.testB = "valueB2";
is(privateWin.content.localStorage.testB, "valueB2");
is(privateWin.content.localStorage.testB, "valueB2");
is(privateWin.content.localStorage["testB"], "valueB2");
is(privateWin.content.localStorage.getItem("testB"), "valueB2");
privateWin.content.localStorage.setItem("testC", "valueC");
is(privateWin.content.localStorage.testC, "valueC");
is(privateWin.content.localStorage["testC"], "valueC");
is(privateWin.content.localStorage.testC, "valueC");
is(privateWin.content.localStorage.getItem("testC"), "valueC");
privateWin.content.localStorage.setItem("testC", "valueC2");
is(privateWin.content.localStorage.testC, "valueC2");
is(privateWin.content.localStorage["testC"], "valueC2");
is(privateWin.content.localStorage.testC, "valueC2");
is(privateWin.content.localStorage.getItem("testC"), "valueC2");
privateWin.content.localStorage.setItem("testC", null);
is("testC" in privateWin.content.localStorage, true);
is(privateWin.content.localStorage.getItem("testC"), "null");
is(privateWin.content.localStorage["testC"], "null");
is(privateWin.content.localStorage.testC, "null");
is(privateWin.content.localStorage.testC, "null");
privateWin.content.localStorage.removeItem("testC");
privateWin.content.localStorage["testC"] = null;
privateWin.content.localStorage.testC = null;
is("testC" in privateWin.content.localStorage, true);
is(privateWin.content.localStorage.getItem("testC"), "null");
is(privateWin.content.localStorage["testC"], "null");
is(privateWin.content.localStorage.testC, "null");
is(privateWin.content.localStorage.testC, "null");
privateWin.content.localStorage.setItem(null, "test");
is("null" in privateWin.content.localStorage, true);
is(privateWin.content.localStorage.getItem("null"), "test");
is(privateWin.content.localStorage.getItem(null), "test");
is(privateWin.content.localStorage["null"], "test");
is(privateWin.content.localStorage.null, "test");
privateWin.content.localStorage.removeItem(null, "test");
is("null" in privateWin.content.localStorage, false);

View File

@ -25,32 +25,32 @@ function test1() {
is(localStorage.key(-1), null, "key() should return null for out-of-bounds access");
is(localStorage.key(1), null, "key() should return null for out-of-bounds access");
is(localStorage.getItem("nonexisting"), null, "Nonexisting item is null (getItem())");
is(localStorage["nonexisting"], undefined, "Nonexisting item is undefined (array access)");
is(localStorage.nonexisting, undefined, "Nonexisting item is undefined (array access)");
is(localStorage.nonexisting, undefined, "Nonexisting item is undefined (property access)");
localStorage.removeItem("nonexisting"); // Just check there is no exception
is(typeof localStorage.getItem("nonexisting"), "object", "getItem('nonexisting') is object");
is(typeof localStorage["nonexisting"], "undefined", "['nonexisting'] is undefined");
is(typeof localStorage.nonexisting, "undefined", "['nonexisting'] is undefined");
is(typeof localStorage.nonexisting, "undefined", "nonexisting is undefined");
is(typeof localStorage.getItem("nonexisting2"), "object", "getItem('nonexisting2') is object");
is(typeof localStorage["nonexisting2"], "undefined", "['nonexisting2'] is undefined");
is(typeof localStorage.nonexisting2, "undefined", "['nonexisting2'] is undefined");
is(typeof localStorage.nonexisting2, "undefined", "nonexisting2 is undefined");
// add an empty-value key
localStorage.setItem("empty", "");
is(localStorage.getItem("empty"), "", "Empty value (getItem())");
is(localStorage["empty"], "", "Empty value (array access)");
is(localStorage.empty, "", "Empty value (array access)");
is(localStorage.empty, "", "Empty value (property access)");
is(typeof localStorage.getItem("empty"), "string", "getItem('empty') is string");
is(typeof localStorage["empty"], "string", "['empty'] is string");
is(typeof localStorage.empty, "string", "['empty'] is string");
is(typeof localStorage.empty, "string", "empty is string");
localStorage.removeItem("empty");
is(localStorage.length, 0, "The storage has no keys");
is(localStorage.getItem("empty"), null, "empty item is null (getItem())");
is(localStorage["empty"], undefined, "empty item is undefined (array access)");
is(localStorage.empty, undefined, "empty item is undefined (array access)");
is(localStorage.empty, undefined, "empty item is undefined (property access)");
is(typeof localStorage.getItem("empty"), "object", "getItem('empty') is object");
is(typeof localStorage["empty"], "undefined", "['empty'] is undefined");
is(typeof localStorage.empty, "undefined", "['empty'] is undefined");
is(typeof localStorage.empty, "undefined", "empty is undefined");
// add one key, check it is there
@ -63,11 +63,11 @@ function test1() {
// check all access method give the correct result
// and are of the correct type
is(localStorage.getItem("key1"), "value1", "getItem('key1') == value1");
is(localStorage["key1"], "value1", "['key1'] == value1");
is(localStorage.key1, "value1", "['key1'] == value1");
is(localStorage.key1, "value1", "key1 == value1");
is(typeof localStorage.getItem("key1"), "string", "getItem('key1') is string");
is(typeof localStorage["key1"], "string", "['key1'] is string");
is(typeof localStorage.key1, "string", "['key1'] is string");
is(typeof localStorage.key1, "string", "key1 is string");
// remove the previously added key and check the storage is empty
@ -77,7 +77,7 @@ function test1() {
is(localStorage.getItem("key1"), null, "\'key1\' removed");
is(typeof localStorage.getItem("key1"), "object", "getItem('key1') is object");
is(typeof localStorage["key1"], "undefined", "['key1'] is undefined");
is(typeof localStorage.key1, "undefined", "['key1'] is undefined");
is(typeof localStorage.key1, "undefined", "key1 is undefined");
// add one key, check it is there
@ -128,52 +128,52 @@ function test1() {
// JS property test
localStorage.testA = "valueA";
is(localStorage.testA, "valueA");
is(localStorage["testA"], "valueA");
is(localStorage.testA, "valueA");
is(localStorage.getItem("testA"), "valueA");
localStorage.testA = "valueA2";
is(localStorage.testA, "valueA2");
is(localStorage["testA"], "valueA2");
is(localStorage.testA, "valueA2");
is(localStorage.getItem("testA"), "valueA2");
localStorage["testB"] = "valueB";
localStorage.testB = "valueB";
is(localStorage.testB, "valueB");
is(localStorage.testB, "valueB");
is(localStorage["testB"], "valueB");
is(localStorage.getItem("testB"), "valueB");
localStorage["testB"] = "valueB2";
localStorage.testB = "valueB2";
is(localStorage.testB, "valueB2");
is(localStorage.testB, "valueB2");
is(localStorage["testB"], "valueB2");
is(localStorage.getItem("testB"), "valueB2");
localStorage.setItem("testC", "valueC");
is(localStorage.testC, "valueC");
is(localStorage["testC"], "valueC");
is(localStorage.testC, "valueC");
is(localStorage.getItem("testC"), "valueC");
localStorage.setItem("testC", "valueC2");
is(localStorage.testC, "valueC2");
is(localStorage["testC"], "valueC2");
is(localStorage.testC, "valueC2");
is(localStorage.getItem("testC"), "valueC2");
localStorage.setItem("testC", null);
is("testC" in localStorage, true);
is(localStorage.getItem("testC"), "null");
is(localStorage["testC"], "null");
is(localStorage.testC, "null");
is(localStorage.testC, "null");
localStorage.removeItem("testC");
localStorage["testC"] = null;
localStorage.testC = null;
is("testC" in localStorage, true);
is(localStorage.getItem("testC"), "null");
is(localStorage["testC"], "null");
is(localStorage.testC, "null");
is(localStorage.testC, "null");
localStorage.setItem(null, "test");
is("null" in localStorage, true);
is(localStorage.getItem("null"), "test");
is(localStorage.getItem(null), "test");
is(localStorage["null"], "test");
is(localStorage.null, "test");
localStorage.removeItem(null, "test");
is("null" in localStorage, false);

View File

@ -33,15 +33,15 @@ function startTest()
is(sessionStorage.key(-1), null, "key() should return null for out-of-bounds access");
is(sessionStorage.key(1), null, "key() should return null for out-of-bounds access");
is(sessionStorage.getItem("nonexisting"), null, "Nonexisting item is null (getItem())");
is(sessionStorage["nonexisting"], undefined, "Nonexisting item is undefined (array access)");
is(sessionStorage.nonexisting, undefined, "Nonexisting item is undefined (array access)");
is(sessionStorage.nonexisting, undefined, "Nonexisting item is undefined (property access)");
sessionStorage.removeItem("nonexisting"); // Just check there is no exception
is(typeof sessionStorage.getItem("nonexisting"), "object", "getItem('nonexisting') is object");
is(typeof sessionStorage["nonexisting"], "undefined", "['nonexisting'] is undefined");
is(typeof sessionStorage.nonexisting, "undefined", "['nonexisting'] is undefined");
is(typeof sessionStorage.nonexisting, "undefined", "nonexisting is undefined");
is(typeof sessionStorage.getItem("nonexisting2"), "object", "getItem('nonexisting2') is object");
is(typeof sessionStorage["nonexisting2"], "undefined", "['nonexisting2'] is undefined");
is(typeof sessionStorage.nonexisting2, "undefined", "['nonexisting2'] is undefined");
is(typeof sessionStorage.nonexisting2, "undefined", "nonexisting2 is undefined");
var sessionStorageCopy = sessionStorage;
@ -60,18 +60,18 @@ function startTest()
// add an empty-value key
sessionStorage.setItem("empty", "");
is(sessionStorage.getItem("empty"), "", "Empty value (getItem())");
is(sessionStorage["empty"], "", "Empty value (array access)");
is(sessionStorage.empty, "", "Empty value (array access)");
is(sessionStorage.empty, "", "Empty value (property access)");
is(typeof sessionStorage.getItem("empty"), "string", "getItem('empty') is string");
is(typeof sessionStorage["empty"], "string", "['empty'] is string");
is(typeof sessionStorage.empty, "string", "['empty'] is string");
is(typeof sessionStorage.empty, "string", "empty is string");
sessionStorage.removeItem("empty");
is(sessionStorage.length, 0, "The storage has no keys");
is(sessionStorage.getItem("empty"), null, "empty item is null (getItem())");
is(sessionStorage["empty"], undefined, "empty item is undefined (array access)");
is(sessionStorage.empty, undefined, "empty item is undefined (array access)");
is(sessionStorage.empty, undefined, "empty item is undefined (property access)");
is(typeof sessionStorage.getItem("empty"), "object", "getItem('empty') is object");
is(typeof sessionStorage["empty"], "undefined", "['empty'] is undefined");
is(typeof sessionStorage.empty, "undefined", "['empty'] is undefined");
is(typeof sessionStorage.empty, "undefined", "empty is undefined");
// add one key, check it is there
@ -84,11 +84,11 @@ function startTest()
// check all access method give the correct result
// and are of the correct type
is(sessionStorage.getItem("key1"), "value1", "getItem('key1') == value1");
is(sessionStorage["key1"], "value1", "['key1'] == value1");
is(sessionStorage.key1, "value1", "['key1'] == value1");
is(sessionStorage.key1, "value1", "key1 == value1");
is(typeof sessionStorage.getItem("key1"), "string", "getItem('key1') is string");
is(typeof sessionStorage["key1"], "string", "['key1'] is string");
is(typeof sessionStorage.key1, "string", "['key1'] is string");
is(typeof sessionStorage.key1, "string", "key1 is string");
// remove the previously added key and check the storage is empty
@ -98,7 +98,7 @@ function startTest()
is(sessionStorage.getItem("key1"), null, "\'key1\' removed");
is(typeof sessionStorage.getItem("key1"), "object", "getItem('key1') is object");
is(typeof sessionStorage["key1"], "undefined", "['key1'] is undefined");
is(typeof sessionStorage.key1, "undefined", "['key1'] is undefined");
is(typeof sessionStorage.key1, "undefined", "key1 is undefined");
// add one key, check it is there

View File

@ -41,32 +41,32 @@ function test1() {
is(sessionStorage.key(-1), null, "key() should return null for out-of-bounds access");
is(sessionStorage.key(1), null, "key() should return null for out-of-bounds access");
is(sessionStorage.getItem("nonexisting"), null, "Nonexisting item is null (getItem())");
is(sessionStorage["nonexisting"], undefined, "Nonexisting item is undefined (array access)");
is(sessionStorage.nonexisting, undefined, "Nonexisting item is undefined (array access)");
is(sessionStorage.nonexisting, undefined, "Nonexisting item is undefined (property access)");
sessionStorage.removeItem("nonexisting"); // Just check there is no exception
is(typeof sessionStorage.getItem("nonexisting"), "object", "getItem('nonexisting') is object");
is(typeof sessionStorage["nonexisting"], "undefined", "['nonexisting'] is undefined");
is(typeof sessionStorage.nonexisting, "undefined", "['nonexisting'] is undefined");
is(typeof sessionStorage.nonexisting, "undefined", "nonexisting is undefined");
is(typeof sessionStorage.getItem("nonexisting2"), "object", "getItem('nonexisting2') is object");
is(typeof sessionStorage["nonexisting2"], "undefined", "['nonexisting2'] is undefined");
is(typeof sessionStorage.nonexisting2, "undefined", "['nonexisting2'] is undefined");
is(typeof sessionStorage.nonexisting2, "undefined", "nonexisting2 is undefined");
// add an empty-value key
sessionStorage.setItem("empty", "");
is(sessionStorage.getItem("empty"), "", "Empty value (getItem())");
is(sessionStorage["empty"], "", "Empty value (array access)");
is(sessionStorage.empty, "", "Empty value (array access)");
is(sessionStorage.empty, "", "Empty value (property access)");
is(typeof sessionStorage.getItem("empty"), "string", "getItem('empty') is string");
is(typeof sessionStorage["empty"], "string", "['empty'] is string");
is(typeof sessionStorage.empty, "string", "['empty'] is string");
is(typeof sessionStorage.empty, "string", "empty is string");
sessionStorage.removeItem("empty");
is(sessionStorage.length, 0, "The storage has no keys");
is(sessionStorage.getItem("empty"), null, "empty item is null (getItem())");
is(sessionStorage["empty"], undefined, "empty item is undefined (array access)");
is(sessionStorage.empty, undefined, "empty item is undefined (array access)");
is(sessionStorage.empty, undefined, "empty item is undefined (property access)");
is(typeof sessionStorage.getItem("empty"), "object", "getItem('empty') is object");
is(typeof sessionStorage["empty"], "undefined", "['empty'] is undefined");
is(typeof sessionStorage.empty, "undefined", "['empty'] is undefined");
is(typeof sessionStorage.empty, "undefined", "empty is undefined");
// add one key, check it is there
@ -79,11 +79,11 @@ function test1() {
// check all access method give the correct result
// and are of the correct type
is(sessionStorage.getItem("key1"), "value1", "getItem('key1') == value1");
is(sessionStorage["key1"], "value1", "['key1'] == value1");
is(sessionStorage.key1, "value1", "['key1'] == value1");
is(sessionStorage.key1, "value1", "key1 == value1");
is(typeof sessionStorage.getItem("key1"), "string", "getItem('key1') is string");
is(typeof sessionStorage["key1"], "string", "['key1'] is string");
is(typeof sessionStorage.key1, "string", "['key1'] is string");
is(typeof sessionStorage.key1, "string", "key1 is string");
// remove the previously added key and check the storage is empty
@ -93,7 +93,7 @@ function test1() {
is(sessionStorage.getItem("key1"), null, "\'key1\' removed");
is(typeof sessionStorage.getItem("key1"), "object", "getItem('key1') is object");
is(typeof sessionStorage["key1"], "undefined", "['key1'] is undefined");
is(typeof sessionStorage.key1, "undefined", "['key1'] is undefined");
is(typeof sessionStorage.key1, "undefined", "key1 is undefined");
// add one key, check it is there
@ -144,52 +144,52 @@ function test1() {
// JS property test
sessionStorage.testA = "valueA";
is(sessionStorage.testA, "valueA");
is(sessionStorage["testA"], "valueA");
is(sessionStorage.testA, "valueA");
is(sessionStorage.getItem("testA"), "valueA");
sessionStorage.testA = "valueA2";
is(sessionStorage.testA, "valueA2");
is(sessionStorage["testA"], "valueA2");
is(sessionStorage.testA, "valueA2");
is(sessionStorage.getItem("testA"), "valueA2");
sessionStorage["testB"] = "valueB";
sessionStorage.testB = "valueB";
is(sessionStorage.testB, "valueB");
is(sessionStorage.testB, "valueB");
is(sessionStorage["testB"], "valueB");
is(sessionStorage.getItem("testB"), "valueB");
sessionStorage["testB"] = "valueB2";
sessionStorage.testB = "valueB2";
is(sessionStorage.testB, "valueB2");
is(sessionStorage.testB, "valueB2");
is(sessionStorage["testB"], "valueB2");
is(sessionStorage.getItem("testB"), "valueB2");
sessionStorage.setItem("testC", "valueC");
is(sessionStorage.testC, "valueC");
is(sessionStorage["testC"], "valueC");
is(sessionStorage.testC, "valueC");
is(sessionStorage.getItem("testC"), "valueC");
sessionStorage.setItem("testC", "valueC2");
is(sessionStorage.testC, "valueC2");
is(sessionStorage["testC"], "valueC2");
is(sessionStorage.testC, "valueC2");
is(sessionStorage.getItem("testC"), "valueC2");
sessionStorage.setItem("testC", null);
is("testC" in sessionStorage, true);
is(sessionStorage.getItem("testC"), "null");
is(sessionStorage["testC"], "null");
is(sessionStorage.testC, "null");
is(sessionStorage.testC, "null");
sessionStorage.removeItem("testC");
sessionStorage["testC"] = null;
sessionStorage.testC = null;
is("testC" in sessionStorage, true);
is(sessionStorage.getItem("testC"), "null");
is(sessionStorage["testC"], "null");
is(sessionStorage.testC, "null");
is(sessionStorage.testC, "null");
sessionStorage.setItem(null, "test");
is("null" in sessionStorage, true);
is(sessionStorage.getItem("null"), "test");
is(sessionStorage.getItem(null), "test");
is(sessionStorage["null"], "test");
is(sessionStorage.null, "test");
sessionStorage.removeItem(null, "test");
is("null" in sessionStorage, false);

View File

@ -181,22 +181,22 @@ add_task(async function test() {
"Scalar keys are set: " + Object.keys(webauthn_used).join(", ")
);
is(
webauthn_used["U2FRegisterFinish"],
webauthn_used.U2FRegisterFinish,
1,
"webauthn_used U2FRegisterFinish scalar should be 1"
);
is(
webauthn_used["U2FSignFinish"],
webauthn_used.U2FSignFinish,
1,
"webauthn_used U2FSignFinish scalar should be 1"
);
is(
webauthn_used["U2FSignAbort"],
webauthn_used.U2FSignAbort,
undefined,
"webauthn_used U2FSignAbort scalar must be unset"
);
is(
webauthn_used["U2FRegisterAbort"],
webauthn_used.U2FRegisterAbort,
undefined,
"webauthn_used U2FRegisterAbort scalar must be unset"
);

View File

@ -159,7 +159,7 @@
let publicKeyCredentialRequestOptions = {
challenge: chall,
rpId: document.domain,
allowCredentials: [gTrackedCredential["basic"]]
allowCredentials: [gTrackedCredential.basic]
};
return credm.get({publicKey: publicKeyCredentialRequestOptions})
.then(arrivingHereIsGood)
@ -169,7 +169,7 @@
// Test rpId being unset
let publicKeyCredentialRequestOptions = {
challenge: chall,
allowCredentials: [gTrackedCredential["basic"]]
allowCredentials: [gTrackedCredential.basic]
};
return credm.get({publicKey: publicKeyCredentialRequestOptions})
.then(arrivingHereIsGood)
@ -180,7 +180,7 @@
let publicKeyCredentialRequestOptions = {
challenge: chall,
rpId: "user:pass@" + document.origin + ":8888",
allowCredentials: [gTrackedCredential["basic"]]
allowCredentials: [gTrackedCredential.basic]
};
return credm.get({publicKey: publicKeyCredentialRequestOptions})
.then(arrivingHereIsBad)
@ -191,7 +191,7 @@
let publicKeyCredentialRequestOptions = {
challenge: chall,
rpId: "",
allowCredentials: [gTrackedCredential["basic"]]
allowCredentials: [gTrackedCredential.basic]
};
return credm.get({publicKey: publicKeyCredentialRequestOptions})
.then(arrivingHereIsBad)
@ -202,7 +202,7 @@
let publicKeyCredentialRequestOptions = {
challenge: chall,
rpId: "subdomain." + document.domain,
allowCredentials: [gTrackedCredential["basic"]]
allowCredentials: [gTrackedCredential.basic]
};
return credm.get({publicKey: publicKeyCredentialRequestOptions})
.then(arrivingHereIsBad)
@ -213,7 +213,7 @@
let publicKeyCredentialRequestOptions = {
challenge: chall,
rpId: "example.com",
allowCredentials: [gTrackedCredential["basic"]]
allowCredentials: [gTrackedCredential.basic]
};
return credm.get({publicKey: publicKeyCredentialRequestOptions})
.then(arrivingHereIsGood)
@ -224,7 +224,7 @@
let publicKeyCredentialRequestOptions = {
challenge: chall,
rpId: "com",
allowCredentials: [gTrackedCredential["basic"]]
allowCredentials: [gTrackedCredential.basic]
};
return credm.get({publicKey: publicKeyCredentialRequestOptions})
.then(arrivingHereIsBad)
@ -235,7 +235,7 @@
let publicKeyCredentialRequestOptions = {
challenge: chall,
rpId: "alt.test",
allowCredentials: [gTrackedCredential["basic"]]
allowCredentials: [gTrackedCredential.basic]
};
return credm.get({publicKey: publicKeyCredentialRequestOptions})
.then(arrivingHereIsBad)
@ -256,7 +256,7 @@
let publicKeyCredentialRequestOptions = {
challenge: chall,
rpId: window.origin,
allowCredentials: [gTrackedCredential["basic"]]
allowCredentials: [gTrackedCredential.basic]
};
return credm.get({publicKey: publicKeyCredentialRequestOptions})
.then(arrivingHereIsBad)
@ -267,7 +267,7 @@
let publicKeyCredentialRequestOptions = {
challenge: chall,
rpId: document.domain + ":somejunk",
allowCredentials: [gTrackedCredential["basic"]]
allowCredentials: [gTrackedCredential.basic]
};
return credm.get({publicKey: publicKeyCredentialRequestOptions})
.then(arrivingHereIsBad)
@ -278,7 +278,7 @@
let publicKeyCredentialRequestOptions = {
challenge: chall,
rpId: document.domain + ":8888",
allowCredentials: [gTrackedCredential["basic"]]
allowCredentials: [gTrackedCredential.basic]
};
return credm.get({publicKey: publicKeyCredentialRequestOptions})
.then(arrivingHereIsBad)

View File

@ -47,7 +47,7 @@ if (self.Notification) {
"data item 0 should be a matching string"
);
is(
notification.data[1]["structured"],
notification.data[1].structured,
"cloned",
"data item 1 should be a matching object literal"
);

View File

@ -46,7 +46,7 @@ var view = {
if (head.test(line)) {
test = new Object();
res = head.exec(line);
test["title"] = res[1];
test.title = res[1];
this.testArray.push(test);
} else if (line == "") {
test = undefined;