我想使用Flexmojos3.9-SNAPSHOT测试air应用程序和air库。然而,虽然flexmojos确实支持air,但它尝试使用flash player运行构建生成的swf,因为我需要使用air本地库,所以我希望使用adl (AIR调试启动器)运行测试。
为此,我将github.com中的flexmojos克隆到此存储库(http://github.com/mi007/flexmojos)。然后,我创建了一个类,该类为生成并运行的TestRunner.swf文件创建了一个-app.xml:
但是,在测试结束之前,它应该调用端口13540中的服务器来报告一些情况。当发生这种情况时,我会得到以下错误:
Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: app:/TestRunner.swf cannot load data from 127.0.0.1:13540.
at org.sonatype.flexmojos.unitestingsupport::ControlSocket/connect()[/Users/rafael/p2d/others/flexmojos/flexmojos-testing/flexmojos-unittest-support/src/main/flex/org/sonatype/flexmojos/unitestingsupport/ControlSocket.as:46]
at org.sonatype.flexmojos.unitestingsupport::TestApplication/runTests()[/Users/rafael/p2d/others/flexmojos/flexmojos-testing/flexmojos-unittest-support/src/main/flex/org/sonatype/flexmojos/unitestingsupport/TestApplication.as:52]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[C:\autobuild\galaga\frameworks\projects\framework\src\mx\core\UIComponent.as:9408]
at mx.core::UIComponent/set initialized()[C:\autobuild\galaga\frameworks\projects\framework\src\mx\core\UIComponent.as:1169]
at mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\galaga\frameworks\projects\framework\src\mx\managers\LayoutManager.as:718]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\galaga\frameworks\projects\framework\src\mx\core\UIComponent.as:8733]
at mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\galaga\frameworks\projects\framework\src\mx\core\UIComponent.as:8673]我知道它之前在端口13539中成功地调用了服务器,因为它在控制台上打印测试结果。我还知道它正在打开端口13540,因为我能够远程登录到它。但是,由于某些原因,它无法从air应用程序连接。
鉴于目前的情况,我有以下问题:
1)有没有什么好的文档可以让我了解这个安全框架是如何工作的?我发现的唯一文档非常令人困惑。
2)有没有人对可能发生的事情有任何想法或提示?
3)我在某处读到flexmojos破解了安全框架,以便flex应用程序可以在测试期间向localhost打开套接字而不会出现问题。有没有关于如何做到这一点的文档?
谢谢,
发布于 2011-04-06 16:11:59
你已经非常接近你评论中的答案了。
您需要自己在~/Library/Preferences/Macromedia/Flash Player/#Security/FlashPlayerTrust中的文件中添加一行,以涵盖要运行的swf。您可以直接手动完成此操作(将处理该文件夹中的所有文件)或使用Flash Player Settings Manager。
https://stackoverflow.com/questions/3973429
复制相似问题