diff --git a/tests/jsunit/event_test.js b/tests/jsunit/event_test.js index e0ba78f20..8e88d651e 100644 --- a/tests/jsunit/event_test.js +++ b/tests/jsunit/event_test.js @@ -29,15 +29,6 @@ goog.require('goog.testing.MockControl'); var mockControl_; var workspace; -var savedFireFunc = Blockly.Events.fire; - -function temporary_fireEvent(event) { - if (!Blockly.Events.isEnabled()) { - return; - } - Blockly.Events.FIRE_QUEUE_.push(event); - Blockly.Events.fireNow_(); -} function eventTest_setUp() { workspace = new Blockly.Workspace(); diff --git a/tests/jsunit/test_utilities.js b/tests/jsunit/test_utilities.js index 381e9134e..36469ee29 100644 --- a/tests/jsunit/test_utilities.js +++ b/tests/jsunit/test_utilities.js @@ -27,6 +27,23 @@ goog.require('goog.testing'); +/** + * The normal blockly event fire function. We sometimes override this. This + * handle lets us reset after an override. + */ +var savedFireFunc = Blockly.Events.fire; + +/** + * A helper function to replace Blockly.Events.fire in tests. + */ +function temporary_fireEvent(event) { + if (!Blockly.Events.isEnabled()) { + return; + } + Blockly.Events.FIRE_QUEUE_.push(event); + Blockly.Events.fireNow_(); +} + /** * Check that two arrays have the same content. * @param {!Array.} array1 The first array.