From 5c79e70a3f5d24e6d04720cecf9d76914875c14d Mon Sep 17 00:00:00 2001 From: Gavin Sharp Date: Mon, 7 Jan 2013 11:18:19 -0800 Subject: [PATCH] Bug 827193: fix typo in WorkerScope, r=khuey --HG-- extra : rebase_source : 2ccc411444fd9b16d96d152d4f85931c1706f359 --- dom/workers/WorkerScope.cpp | 14 +++---- dom/workers/test/Makefile.in | 2 + dom/workers/test/content_worker.js | 12 ++++++ dom/workers/test/test_contentWorker.html | 48 ++++++++++++++++++++++++ 4 files changed, 68 insertions(+), 8 deletions(-) create mode 100644 dom/workers/test/content_worker.js create mode 100644 dom/workers/test/test_contentWorker.html diff --git a/dom/workers/WorkerScope.cpp b/dom/workers/WorkerScope.cpp index addb62695c90..3b6281642d2c 100644 --- a/dom/workers/WorkerScope.cpp +++ b/dom/workers/WorkerScope.cpp @@ -963,14 +963,12 @@ CreateDedicatedWorkerGlobalScope(JSContext* aCx) return NULL; } - if (worker->IsChromeWorker() && - (!chromeworker::InitClass(aCx, global, workerProto, false) || - !DefineChromeWorkerFunctions(aCx, global))) { - return NULL; - } - - if (!DefineOSFileConstants(aCx, global)) { - return NULL; + if (worker->IsChromeWorker()) { + if (!chromeworker::InitClass(aCx, global, workerProto, false) || + !DefineChromeWorkerFunctions(aCx, global) || + !DefineOSFileConstants(aCx, global)) { + return NULL; + } } // Init other classes we care about. diff --git a/dom/workers/test/Makefile.in b/dom/workers/test/Makefile.in index 2d17669c6dc1..0dad540ac207 100644 --- a/dom/workers/test/Makefile.in +++ b/dom/workers/test/Makefile.in @@ -106,6 +106,8 @@ MOCHITEST_FILES = \ transferable_worker.js \ test_errorwarning.html \ errorwarning_worker.js \ + test_contentWorker.html \ + content_worker.js \ $(NULL) _SUBDIRMOCHITEST_FILES = \ diff --git a/dom/workers/test/content_worker.js b/dom/workers/test/content_worker.js new file mode 100644 index 000000000000..7e092ec8c6c9 --- /dev/null +++ b/dom/workers/test/content_worker.js @@ -0,0 +1,12 @@ +/** + * Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ + */ +var props = { + 'ctypes': 1, + 'OS': 1 +}; +for (var prop in props) { + postMessage({ "prop": prop, "value": self[prop] }); +} +postMessage({ "testfinished": 1 }); diff --git a/dom/workers/test/test_contentWorker.html b/dom/workers/test/test_contentWorker.html new file mode 100644 index 000000000000..e745ca4a0fd9 --- /dev/null +++ b/dom/workers/test/test_contentWorker.html @@ -0,0 +1,48 @@ + + + + + Test for DOM Worker privileged properties + + + + +

+ +
+
+
+ +