Backed out changeset e28e73446d88 (bug 1018169) for Android & B2G xpcshell failures in worker_test_constants.js; CLOSED TREE

This commit is contained in:
Ed Morley 2014-06-06 11:59:22 +01:00
Родитель 7baf52d7b8
Коммит 2dd911fd12
4 изменённых файлов: 5 добавлений и 57 удалений

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

@ -1 +0,0 @@
content workers ./

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

@ -1,10 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
onmessage = function(e) {
// send the OS.Constants as a stringified JSON
postMessage(JSON.stringify({'OS_Constants': OS.Constants, 'OS_Constants_Win': OS.Constants.Win,
'OS_Constants_Path': OS.Constants.Path, 'OS_Constants_Sys': OS.Constants.Sys,
'OS_Constants_libc': OS.Constants.libc, 'OS_Constants_Sys_DEBUG': OS.Constants.Sys.DEBUG,
'OS_Constants_Sys_Name': OS.Constants.Sys.Name}));
};

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

@ -1,15 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
Components.utils.import("resource://gre/modules/Promise.jsm", this);
Components.utils.import("resource://gre/modules/osfile.jsm");
Components.utils.import("resource://gre/modules/Services.jsm");
Components.utils.import("resource://gre/modules/Services.jsm", this);
let isDebugBuild = Components.classes["@mozilla.org/xpcom/debug;1"].getService(Components.interfaces.nsIDebug2).isDebugBuild;
// import the worker using a chrome uri
let worker_url = "chrome://workers/content/worker_test_constants.js";
do_load_manifest("data/chrome.manifest");
function run_test() {
run_next_test();
@ -21,44 +14,13 @@ add_task(function* check_definition() {
do_check_true(!!OS.Constants.Win || !!OS.Constants.libc);
do_check_true(OS.Constants.Path!=null);
do_check_true(OS.Constants.Sys!=null);
// check system name
//check system name
do_check_eq(OS.Constants.Sys.Name, Services.appinfo.OS);
// check if using DEBUG build
if (isDebugBuild) {
//check if using DEBUG build
if (Components.classes["@mozilla.org/xpcom/debug;1"].getService(Components.interfaces.nsIDebug2).isDebugBuild == true) {
do_check_true(OS.Constants.Sys.DEBUG);
} else {
do_check_true(typeof(OS.Constants.Sys.DEBUG) == 'undefined');
}
});
function test_worker(worker) {
var deferred = Promise.defer();
worker.onmessage = function (e) {
// parse the stringified data
var data = JSON.parse(e.data);
try {
// perform the tests
do_check_true(data.OS_Constants != null);
do_check_true(!!data.OS_Constants_Win || !!data.OS_Constants_libc);
do_check_true(data.OS_Constants_Path != null);
do_check_true(data.OS_Constants_Sys != null);
do_check_eq(data.OS_Constants_Sys_Name, Services.appinfo.OS);
if (isDebugBuild) {
do_check_true(data.OS_Constants_Sys_DEBUG);
} else {
do_check_true(typeof(data.OS_Constants_Sys_DEBUG) == 'undefined');
}
} finally {
// resolve the promise
deferred.resolve();
}
};
// start the worker
worker.postMessage('Start tests');
return deferred.promise;
}
add_task(function* check_worker() {
// create a new ChromeWorker
return test_worker(new ChromeWorker(worker_url));
});

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

@ -1,9 +1,6 @@
[DEFAULT]
head = head.js
tail =
support-files =
data/worker_test_constants.js
data/chrome.manifest
[test_available_free_space.js]
[test_osfile_closed.js]