
registerType('appdoo', (function () { function EditorTests() {} var __super = setSupertypeFromDomain(EditorTests, 'BasicObject', 'Core');

	Object.defineProperty(EditorTests.prototype, "editor", {
	outlet: true, get:function () { return this._editor; }, set:function (v) {if (!Object.hasOwnProperty(this, "_editor")) Object.defineProperty(this, "_editor", { writable: true, configurable: true }); this._editor = v; }});
	

EditorTests.prototype.runTests = function EditorTests_runTests() {
	
		if (!this.editor) return;

		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		};
	
	
EditorTests.prototype.changeSimulatedSystem = function EditorTests__changeSimulatedSystem() {

		setTimeout(function () {
			
			this.toggleSimulatedSystem();

			setTimeout(function () {
			
				this.toggleSimulatedSystem();
			
			}.bind(this), 2000);
			
		}.bind(this.editor), 100);
	};
	
	
EditorTests.prototype.selectSceneObject = function EditorTests__selectSceneObject() {

		setTimeout(function () {

			if (!this.objectsNode || !this.objectsNode.firstChild) return;
			this.treeController.selectNode(this.objectsNode.childNodes[1]);

		}.bind(this.editor), 100);
	};
	
	
EditorTests.prototype.selectNavigationBar = function EditorTests__selectNavigationBar() {

		setTimeout(function () {

			this.manipulator.select(this.contentFrameController.navigationBar, this.manipulator);

		}.bind(this.editor), 100);
			};
	
	
EditorTests.prototype.editCellPrototype = function EditorTests__editCellPrototype() {

		setTimeout(function () {
			if (this.context.isOffscreen) return;
			
			var listView = this.editedView.subviews[0];

			if (!listView || !listView.cellPrototypeView) return;
			
			
			this.manipulator.select(listView.cellPrototypeView.subviews[0], this.manipulator);
	
		}.bind(this.editor), 1000);
	};
	
	
EditorTests.prototype.navigateToDetailScene = function EditorTests__navigateToDetailScene() {
		
		
		
		setTimeout(function () {

			var list = this.editedView.subviews[0];
			if (!list || list.UTI !== 'appdoo.iOS.UITableView') return;

			var indexPath = { item: 0, section: 0 };
			
			if (list.usesDataSource) {
				var inputData = list.dataSource ? list.dataSource.dataForIndexPath(indexPath) : null;
				this.navigateToSceneWithID(list.detailSceneID, inputData, list.dataSource, indexPath);
			}
			else {
				var cell = list.staticSections[0].staticCells[1];
				this.navigateToSceneWithID(cell.detailSceneID);
			}

		}.bind(this.editor), 1000);
		};
	
		
EditorTests.prototype.showOverview = function EditorTests__showOverview() {

		setTimeout(function () {
			if (this.context.isOffscreen) return;
	
			if (window.foo2) return;

			setTimeout(function () {
				this.context.showOverview();
			}.bind(this), 50);
	
			window.foo2 = 'bar';

		}.bind(this.editor), 50);};
	
	
EditorTests.prototype.selectAll = function EditorTests__selectAll() {
		setTimeout(function () {
			this.selectAll();
		}.bind(this.editor), 1);};
	

EditorTests.prototype.changeProjectTitle = function EditorTests__changeProjectTitle() {
		setTimeout(function () {
			this.projectMetadataController.setValueForKeyPath('Hallo', 'projectName');
		}.bind(this.context),1000);
	};
	

EditorTests.prototype.selectAllAndChangeSomething = function EditorTests__selectAllAndChangeSomething() {
		
		this.editor.selectAll();
		
		setTimeout(function () {
			this.editor.selection.setValueForKeyPath('rgba(255,0,0,1)', 'CSSTextColor', this.editor.inspector);
		}.bind(this), 1000);
	};
	
	
EditorTests.prototype.deleteAndUndo = function EditorTests__deleteAndUndo() {
	
		setTimeout(function () {
			this.deleteSelection();
			setTimeout(function () {
				this.context.nativeProxy.sendMessage('undo');
			}.bind(this), 500);
		}.bind(this.editor), 500);
	};
	
	
EditorTests.prototype.changeInterfaceOrientation = function EditorTests__changeInterfaceOrientation() {

		setTimeout(function () {
			
			this.contentFrameController.interfaceOrientation = 1;
			
		}.bind(this.editor), 100);
	};
	
	
EditorTests.prototype.groupItems = function EditorTests__groupItems() {
		
		setTimeout(function () {
			this.groupItems(this.selection.itemsInOriginalOrder);
			setTimeout(function () {
				this.context.nativeProxy.sendMessage('undo');
			}.bind(this), 500);
		}.bind(this.editor), 500);
		};
	
	
EditorTests.prototype.performSubviewModification = function EditorTests__performSubviewModification() {

		setTimeout(function () {
			var subview = this.editedView.subviews[0];
			subview.editDefault(this);
			this.treeController.selectValue(subview.subviews[0]);
			subview.subviews[0].dataController.setValueForKeyPath('', 'name', this);
		}.bind(this.editor), 100);
	};
	
	
EditorTests.prototype.paste = function EditorTests__paste() {
		setTimeout(function () {
			this.paste();
		}.bind(this.editor), 100);};
	
	
EditorTests.prototype.duplicateSelection = function EditorTests__duplicateSelection() {
		setTimeout(function () {
			this.duplicateSelection();
		}.bind(this.editor), 100);};
	

EditorTests.prototype.rotate = function EditorTests__rotate() {
		setTimeout(function () {
			this.contentFrameController.rotate();
		}.bind(this.editor), 1000);

		setTimeout(function () {
			this.contentFrameController.rotate();
		}.bind(this.editor), 2000);};
	
	
EditorTests.prototype.encodeAndStringifySelection = function EditorTests__encodeAndStringifySelection() {
		setTimeout(function () {
			var str = JSON.stringify(this.selection.items[0].encode());
			alertd(str);
		}.bind(this.editor), 500);};
	

EditorTests.prototype.changeDestinationScene = function EditorTests__changeDestinationScene() {
		setTimeout(function () {

			var tableView = this.selection.contents[0];
			alertd(tableView);
			tableView.e_detailSceneID = 'Scene3';

		}.bind(this.editor), 2000);};
	

EditorTests.prototype.initPropertiesFromData = function EditorTests_initPropertiesFromData(data) {
try { __super.prototype.initPropertiesFromData.call(this, data); } catch (err) {}
if (data.hasOwnProperty("editor")) this.editor = data.editor;
};

EditorTests.prototype.decodeData = function EditorTests_decodeData(data) { var decoded;
try { decoded = __super.prototype.decodeData.call(this, data); } catch (err) { console.warn(err); decoded = clone(data); }
return decoded; };

EditorTests.prototype.encode = function EditorTests_encode() { var encoded;
try { encoded = __super.prototype.encode.call(this); } catch (err) { console.warn(err); encoded = this.context.encodeObject(this); }
return encoded; };

EditorTests.prototype.encodeCloned = function EditorTests_encodeCloned() { var encoded;
try { encoded = __super.prototype.encodeCloned.call(this); } catch (err) { console.warn(err); encoded = {}; }
return encoded; };

EditorTests.prototype.expectedTypeForProperty = function EditorTests_expectedTypeForProperty(key) {
	if (key === "editor") return "";
	if (__super) return __super.prototype.expectedTypeForProperty(key);
};

return EditorTests; }()));
{
(function () {
	setTimeout(function () {
		if (!window._context || window._context.isOffscreen) return;
		var editorTests = createComponentFromDomain('EditorTests', 'appdoo', window._context,
			{
				editor: window._context.editor
			}
		);
		editorTests.runTests();
	}, 100);
})();}