mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 15:28:39 +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
devtools/shared/platform/content/test/.eslintrc.js
Normal file
6
devtools/shared/platform/content/test/.eslintrc.js
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
// Extend from the common devtools xpcshell eslintrc config.
|
||||
"extends": "../../../../.eslintrc.xpcshell.js"
|
||||
};
|
||||
5
devtools/shared/platform/content/test/mochitest.ini
Normal file
5
devtools/shared/platform/content/test/mochitest.ini
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
[DEFAULT]
|
||||
support-files =
|
||||
|
||||
[test_clipboard.html]
|
||||
subsuite = clipboard
|
||||
53
devtools/shared/platform/content/test/test_clipboard.html
Normal file
53
devtools/shared/platform/content/test/test_clipboard.html
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1290230
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 1290230 - clipboard helpers</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css"
|
||||
href="chrome://mochikit/content/tests/SimpleTest/test.css">
|
||||
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
|
||||
<script type="application/javascript;version=1.8">
|
||||
"use strict";
|
||||
var exports = {}
|
||||
</script>
|
||||
|
||||
<script type="application/javascript;version=1.8"
|
||||
src="resource://devtools/shared/platform/content/clipboard.js"></script>
|
||||
|
||||
</head>
|
||||
<body onload="do_tests()">
|
||||
<script type="application/javascript;version=1.8">
|
||||
"use strict";
|
||||
|
||||
const RESULT = "lark bunting";
|
||||
|
||||
function doCopy(e) {
|
||||
console.log(e.isTrusted);
|
||||
copyString(RESULT);
|
||||
}
|
||||
|
||||
function do_tests() {
|
||||
let elt = document.querySelector("#key");
|
||||
elt.addEventListener("keydown", doCopy);
|
||||
|
||||
// Set the clipboard to something other than what we expect.
|
||||
SpecialPowers.clipboardCopyString("snowy owl");
|
||||
|
||||
elt.focus();
|
||||
synthesizeKey("x", {});
|
||||
|
||||
is(SpecialPowers.getClipboardData("text/unicode"), RESULT, "clipboard copying worked");
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
</script>
|
||||
<div id="key" tabindex="-1">Type Here</div>
|
||||
</body>
|
||||
48
devtools/shared/platform/content/test/test_stack.js
Normal file
48
devtools/shared/platform/content/test/test_stack.js
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
// There isn't really very much about the content stack.js that we can
|
||||
// test, but we'll do what we can.
|
||||
|
||||
"use strict";
|
||||
|
||||
var Cu = Components.utils;
|
||||
const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
|
||||
// Make sure to explicitly require the content version of this module.
|
||||
// We have to use the ".." trick due to the way the loader remaps
|
||||
// devtools/shared/platform.
|
||||
const {
|
||||
callFunctionWithAsyncStack,
|
||||
getStack,
|
||||
describeNthCaller
|
||||
} = require("devtools/shared/platform/../content/stack");
|
||||
|
||||
function f3() {
|
||||
return describeNthCaller(2);
|
||||
}
|
||||
|
||||
function f2() {
|
||||
return f3();
|
||||
}
|
||||
|
||||
function f1() {
|
||||
return f2();
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
let value = 7;
|
||||
|
||||
const changeValue = () => {
|
||||
value = 9;
|
||||
};
|
||||
|
||||
callFunctionWithAsyncStack(changeValue, getStack(), "test_stack");
|
||||
equal(value, 9, "callFunctionWithAsyncStack worked");
|
||||
|
||||
let stack = getStack();
|
||||
equal(JSON.parse(JSON.stringify(stack)), stack, "stack is serializable");
|
||||
|
||||
let desc = f1();
|
||||
ok(desc.includes("f1"), "stack description includes f1");
|
||||
}
|
||||
7
devtools/shared/platform/content/test/xpcshell.ini
Normal file
7
devtools/shared/platform/content/test/xpcshell.ini
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[DEFAULT]
|
||||
tags = devtools
|
||||
head =
|
||||
tail =
|
||||
firefox-appdir = browser
|
||||
|
||||
[test_stack.js]
|
||||
Loading…
Add table
Add a link
Reference in a new issue