Bug 947044 - Part 2: Fix tests that check ReferenceError's message. r=gavin

This commit is contained in:
Nick Fitzgerald 2014-09-22 16:13:00 +02:00
Родитель 90a2be9118
Коммит 51675a240f
10 изменённых файлов: 13 добавлений и 10 удалений

Просмотреть файл

@ -105,7 +105,7 @@ function test() {
function test1(aCallback) {
gDebugger.once(gDebugger.EVENTS.FETCHED_WATCH_EXPRESSIONS, () => {
checkWatchExpressions(26, {
a: "ReferenceError: a is not defined",
a: "ReferenceError: a is not defined, did you mean 'z'?",
this: { type: "object", class: "Object" },
prop: { type: "object", class: "String" },
args: { type: "undefined" }

Просмотреть файл

@ -33,7 +33,8 @@ window.onerror = function(message, uri, line) {
</script>
<script type="application/javascript">
window.onerror = function(message, uri, line) {
is(message, "ReferenceError: c is not defined", "Should have correct error message");
ok(message.contains("ReferenceError: c is not defined"),
"Should have correct error message");
is(uri,
"http://mochi.test:8888/tests/content/base/test/bug461735-redirect2.sjs",
"Unexpected error location URI");

Просмотреть файл

@ -38,7 +38,8 @@ window.onerror = function(message, uri, line) {
errorFired = false;
global = "";
window.onerror = function(message, uri, line) {
is(message, "ReferenceError: c is not defined", "Should have correct error message");
ok(message.contains("ReferenceError: c is not defined"),
"Should have correct error message");
is(uri,
"http://example.com/tests/content/base/test/bug696301-script-1.js",
"Should also have correct script URI");

Просмотреть файл

@ -40,7 +40,8 @@ window.onerror = function(message, uri, line) {
errorFired = false;
global = "";
window.onerror = function(message, uri, line) {
is(message, "ReferenceError: c is not defined", "Should have correct error message");
ok(message.contains("ReferenceError: c is not defined"),
"Should have correct error message");
is(uri,
"http://example.com/tests/content/base/test/bug696301-script-1.js",
"Should also have correct script URI");

Просмотреть файл

@ -31,7 +31,7 @@ var expected = [
{ name: "", message: "uncaught exception: [object Object]" },
{ name: "InvalidStateError", message: "An attempt was made to use an object that is not, or is no longer, usable", filename: location, lineNumber: 60 },
{ name: "ReferenceError", message: "xxx is not defined", filename: location, lineNumber: 64 },
{ name: "ReferenceError", message: "xxx is not defined", filename: location, lineNumber: 66 }
{ name: "ReferenceError", message: "xxx is not defined, did you mean 'x'?", filename: location, lineNumber: 66 }
];
var counter = 0;

Просмотреть файл

@ -52,7 +52,7 @@ Tests of DOM Worker Threads (Bug 437152)
worker.onerror = function(otherEvent) {
otherEvent.preventDefault();
is(otherEvent.target, worker);
is(otherEvent.message, "ReferenceError: Components is not defined");
ok(otherEvent.message.contains("ReferenceError: Components is not defined"));
gotErrors = true;
worker.onerror = function(oneMoreEvent) {

Просмотреть файл

@ -20,7 +20,7 @@ function test()
printBugNumber(BUGNUMBER);
printStatus (summary);
expect = 'ReferenceError: x is not defined';
expect = "ReferenceError: x is not defined, did you mean 'gc'?";
try
{
delete (0 ? 3 : x());

Просмотреть файл

@ -23,7 +23,7 @@ var b = 45;
};
})();
expect = 'ReferenceError: a is not defined | undefined | 45';
expect = "ReferenceError: a is not defined, did you mean 'b'? | undefined | 45";
actual = '';
var foo;

Просмотреть файл

@ -20,7 +20,7 @@ function test()
printBugNumber(BUGNUMBER);
printStatus (summary);
expect = 'ReferenceError: setter is not defined';
expect = "ReferenceError: setter is not defined, did you mean 'stop'?";
try
{
eval("setter/*\n*/;");

Просмотреть файл

@ -742,7 +742,7 @@ add_test(function test_exception_in_onProgress() {
it.does.not.exist();
};
request.get(function onComplete(error) {
do_check_eq(error, "ReferenceError: it is not defined");
do_check_true(error.toString().contains("ReferenceError: it is not defined"));
do_check_eq(this.status, this.ABORTED);
server.stop(run_next_test);