cocos2d/cocos2d-swift — pull request #1135 by andykorth (2014-12-22 21:15:30+00:00)
Title: Fix package manager tests

These commits include some general cleanup and fixes to a few tests, but most notably for the PackageManager tests.

These tests rely on waiting for stuff scheduled on the cocos2d game loop, such as downloading packages. Unfortunately, waiting on the main loop causes the xcode unit tests to try to do their normal drawing code. This happens without a properly set up gl context.

There was already code that was attempting to call ```stopAnimation```, which stops the normal draw loop, but it wasn't working on my system due to the xcode unit testing system making repeated calls to ```viewWillAppear```, which keeps restarting the animation loop. CCDirectorIOS has been modified to prevent that behavior, and starts the main loop in a better place. While this could have detrimental side effects in weird situations, it does seem to work well for unit tests, actual normal app runs, and suspending and resuming the app. Furthermore, the V4 director code is scheduled for a rewrite, so this is a good time for a temporary fix.