From 31dfa1554f8b664a800bcb83d9416fe3b9de80fd Mon Sep 17 00:00:00 2001 From: Brett Zamir Date: Sun, 16 Apr 2017 13:38:17 +0800 Subject: [PATCH] - Enhancement: Allow `runnerjs`' setting of `window.testharness_properties` to take into account any preexisting `window.testharness_properties` (as injected by a parent frame) - Enhancement: Expose `runner.js`' `VisualOutput` globally so that a parent frame can monkey-patch --- runner/runner.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/runner/runner.js b/runner/runner.js index 39b2634..9380002 100644 --- a/runner/runner.js +++ b/runner/runner.js @@ -2,7 +2,7 @@ (function() { "use strict"; var runner; -var testharness_properties = {output:false, +var testharness_properties = window.testharness_properties || {output:false, timeout_multiplier:1}; function Manifest(path) { @@ -559,8 +559,8 @@ TestControl.prototype = { }, get_testharness_settings: function() { - return {timeout_multiplier: parseFloat(this.timeout_input.value), - output: this.render_checkbox.checked}; + return Object.assign({timeout_multiplier: parseFloat(this.timeout_input.value), + output: this.render_checkbox.checked}, testharness_properties); }, get_use_regex: function() { @@ -840,4 +840,6 @@ window.completion_callback = function(tests, status) { }; window.addEventListener("DOMContentLoaded", setup, false); + +window.VisualOutput = VisualOutput; })();