1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 debug
= function debug(msg
)
10 description
= function description(msg
, quiet
)
15 finishJSTest
= function finishJSTest() {
16 console
.log("TEST FINISHED");
21 // It's conceivable that someone would stub out 'document' in a worker so
22 // also check for childNodes, an arbitrary DOM-related object that is
23 // meaningless in a WorkerContext.
24 return (typeof document
=== 'undefined' ||
25 typeof document
.childNodes
=== 'undefined') && !!self
.importScripts
;
28 function handleTestFinished() {
29 if (!window
.jsTestIsAsync
)
33 // Returns a sorted array of property names of object. This function returns
34 // not only own properties but also properties on prototype chains.
35 function getAllPropertyNames(object
) {
37 for (var property
in object
) {
38 properties
.push(property
);
40 return properties
.sort();
44 window
.addEventListener('DOMContentLoaded', handleTestFinished
, false);