mirror of
https://github.com/google/blockly.git
synced 2026-01-08 01:20:12 +01:00
Merge pull request #1910 from rachel-fenichel/tests/move_utils
Move a test function into utils
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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.<string>} array1 The first array.
|
||||
|
||||
Reference in New Issue
Block a user