mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-06 07:17:30 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
6
dom/console/tests/chrome.ini
Normal file
6
dom/console/tests/chrome.ini
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
[DEFAULT]
|
||||
skip-if = os == 'android'
|
||||
support-files =
|
||||
file_empty.html
|
||||
|
||||
[test_console.xul]
|
||||
1
dom/console/tests/file_empty.html
Normal file
1
dom/console/tests/file_empty.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
<!DOCTYPE html><html><body></body></html>
|
||||
11
dom/console/tests/mochitest.ini
Normal file
11
dom/console/tests/mochitest.ini
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
[DEFAULT]
|
||||
support-files =
|
||||
file_empty.html
|
||||
|
||||
[test_bug659625.html]
|
||||
[test_bug978522.html]
|
||||
[test_bug979109.html]
|
||||
[test_bug989665.html]
|
||||
[test_consoleEmptyStack.html]
|
||||
[test_console_binding.html]
|
||||
[test_console_proto.html]
|
||||
92
dom/console/tests/test_bug659625.html
Normal file
92
dom/console/tests/test_bug659625.html
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=659625
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 659625</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=659625">Mozilla Bug 659625</a>
|
||||
<script type="application/javascript">
|
||||
const { Cc, Ci } = SpecialPowers;
|
||||
let consoleStorage = Cc["@mozilla.org/consoleAPI-storage;1"];
|
||||
let storage = consoleStorage.getService(Ci.nsIConsoleAPIStorage);
|
||||
|
||||
let clearAndCheckStorage = () => {
|
||||
console.clear();
|
||||
ok(storage.getEvents().length === 1,
|
||||
"Only one event remains in consoleAPIStorage");
|
||||
ok(storage.getEvents()[0].level === "clear",
|
||||
"Remaining event has level 'clear'");
|
||||
}
|
||||
|
||||
storage.clearEvents();
|
||||
ok(storage.getEvents().length === 0,
|
||||
"Console is empty when test is starting");
|
||||
clearAndCheckStorage();
|
||||
|
||||
console.log("log");
|
||||
console.debug("debug");
|
||||
console.warn("warn");
|
||||
console.error("error");
|
||||
console.exception("exception");
|
||||
ok(storage.getEvents().length === 6,
|
||||
"5 new console events have been registered for logging variants");
|
||||
clearAndCheckStorage();
|
||||
|
||||
console.trace();
|
||||
ok(storage.getEvents().length === 2,
|
||||
"1 new console event registered for trace");
|
||||
clearAndCheckStorage();
|
||||
|
||||
console.dir({});
|
||||
ok(storage.getEvents().length === 2,
|
||||
"1 new console event registered for dir");
|
||||
clearAndCheckStorage();
|
||||
|
||||
console.count("count-label");
|
||||
console.count("count-label");
|
||||
ok(storage.getEvents().length === 3,
|
||||
"2 new console events registered for 2 count calls");
|
||||
clearAndCheckStorage();
|
||||
|
||||
console.group("group-label")
|
||||
console.log("group-log");
|
||||
ok(storage.getEvents().length === 3,
|
||||
"2 new console events registered for group + log");
|
||||
clearAndCheckStorage();
|
||||
|
||||
console.groupCollapsed("group-collapsed")
|
||||
console.log("group-collapsed-log");
|
||||
ok(storage.getEvents().length === 3,
|
||||
"2 new console events registered for groupCollapsed + log");
|
||||
clearAndCheckStorage();
|
||||
|
||||
console.group("closed-group-label")
|
||||
console.log("group-log");
|
||||
console.groupEnd()
|
||||
ok(storage.getEvents().length === 4,
|
||||
"3 new console events registered for group/groupEnd");
|
||||
clearAndCheckStorage();
|
||||
|
||||
console.time("time-label");
|
||||
console.timeEnd();
|
||||
ok(storage.getEvents().length === 3,
|
||||
"2 new console events registered for time/timeEnd");
|
||||
clearAndCheckStorage();
|
||||
|
||||
console.timeStamp("timestamp-label");
|
||||
ok(storage.getEvents().length === 2,
|
||||
"1 new console event registered for timeStamp");
|
||||
clearAndCheckStorage();
|
||||
|
||||
// Check that console.clear() clears previous clear messages
|
||||
clearAndCheckStorage();
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
32
dom/console/tests/test_bug978522.html
Normal file
32
dom/console/tests/test_bug978522.html
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=978522
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 978522 - basic support</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=978522">Mozilla Bug 978522</a>
|
||||
<script type="application/javascript">
|
||||
|
||||
console.log('%s', {
|
||||
toString: function() {
|
||||
console.log('%s', {
|
||||
toString: function() {
|
||||
ok(true, "Still alive \\o/");
|
||||
SimpleTest.finish();
|
||||
return "hello world";
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
32
dom/console/tests/test_bug979109.html
Normal file
32
dom/console/tests/test_bug979109.html
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=979109
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 979109</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=979109">Mozilla Bug 979109</a>
|
||||
<script type="application/javascript">
|
||||
|
||||
console.warn("%", "a");
|
||||
console.warn("%%", "a");
|
||||
console.warn("%123", "a");
|
||||
console.warn("%123.", "a");
|
||||
console.warn("%123.123", "a");
|
||||
console.warn("%123.123o", "a");
|
||||
console.warn("%123.123s", "a");
|
||||
console.warn("%123.123d", "a");
|
||||
console.warn("%123.123f", "a");
|
||||
console.warn("%123.123z", "a");
|
||||
console.warn("%.", "a");
|
||||
console.warn("%.123", "a");
|
||||
ok(true, "Still alive \\o/");
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
21
dom/console/tests/test_bug989665.html
Normal file
21
dom/console/tests/test_bug989665.html
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=989665
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 989665</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=989665">Mozilla Bug 989665</a>
|
||||
<script type="application/javascript">
|
||||
|
||||
w = new Worker("data:text/javascript;charset=UTF-8, console.log('%s', {toString: function() { throw 3 }}); ");
|
||||
ok(true, "This test should not crash.");
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
35
dom/console/tests/test_console.xul
Normal file
35
dom/console/tests/test_console.xul
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
|
||||
<?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
|
||||
<window title="Test for URL API"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
|
||||
|
||||
<!-- test results are displayed in the html:body -->
|
||||
<body xmlns="http://www.w3.org/1999/xhtml">
|
||||
<iframe id="iframe" />
|
||||
</body>
|
||||
|
||||
<!-- test code goes here -->
|
||||
<script type="application/javascript"><![CDATA[
|
||||
|
||||
ok("console" in window, "Console exists");
|
||||
window.console.log(42);
|
||||
ok("table" in console, "Console has the 'table' method.");
|
||||
window.console = 42;
|
||||
is(window.console, 42, "Console is replacable");
|
||||
|
||||
var frame = document.getElementById("iframe");
|
||||
ok(frame, "Frame must exist");
|
||||
frame.src="http://mochi.test:8888/tests/dom/console/test/file_empty.html";
|
||||
frame.onload = function() {
|
||||
ok("console" in frame.contentWindow, "Console exists in the iframe");
|
||||
frame.contentWindow.console.log(42);
|
||||
frame.contentWindow.console = 42;
|
||||
is(frame.contentWindow.console, 42, "Console is replacable in the iframe");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
]]></script>
|
||||
</window>
|
||||
27
dom/console/tests/test_consoleEmptyStack.html
Normal file
27
dom/console/tests/test_consoleEmptyStack.html
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Test for empty stack in console</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<script type="application/javascript">
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
window.setTimeout(console.log.bind(console), 0, "xyz");
|
||||
|
||||
window.addEventListener("fake", console.log.bind(console, "xyz"));
|
||||
|
||||
window.addEventListener("fake", function() {
|
||||
ok(true, "Still alive");
|
||||
SimpleTest.finish();
|
||||
});
|
||||
|
||||
window.dispatchEvent(new Event("fake"));
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
42
dom/console/tests/test_console_binding.html
Normal file
42
dom/console/tests/test_console_binding.html
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test Console binding</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<script type="application/javascript">
|
||||
|
||||
function consoleListener() {
|
||||
SpecialPowers.addObserver(this, "console-api-log-event", false);
|
||||
}
|
||||
|
||||
var order = 0;
|
||||
consoleListener.prototype = {
|
||||
observe: function(aSubject, aTopic, aData) {
|
||||
if (aTopic == "console-api-log-event") {
|
||||
var obj = aSubject.wrappedJSObject;
|
||||
if (order+1 == parseInt(obj.arguments[0])) {
|
||||
ok(true, "Message received: " + obj.arguments[0]);
|
||||
order++;
|
||||
}
|
||||
|
||||
if (order == 3) {
|
||||
SpecialPowers.removeObserver(this, "console-api-log-event");
|
||||
SimpleTest.finish();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var cl = new consoleListener();
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
[1,2,3].forEach(console.log);
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
17
dom/console/tests/test_console_proto.html
Normal file
17
dom/console/tests/test_console_proto.html
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for console.__proto__</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<script type="application/javascript">
|
||||
|
||||
isnot(Object.getPrototypeOf(console), Object.prototype, "Foo");
|
||||
is(Object.getPrototypeOf(Object.getPrototypeOf(console)), Object.prototype, "Boo");
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue