0

我想使用 flexmojos 3.9-SNAPSHOT 测试空气应用程序和空气库。然而,虽然 flexmojos 确实支持 air,但它会尝试使用 flash player 运行构建生成的 swf,并且由于我需要使用 air 原生库,我想使用 adl(AIR 调试启动器)运行测试。

为此,我将 github.com 中的 flexmojos 克隆到此存储库 (http://github.com/mi007/flexmojos)。然后,我创建了一个类,该类为生成并运行的 TestRunner.swf 文件创建了一个 -app.xml:adl TestRunner-app.xml

但是,在Test结束之前,它应该调用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,因为我能够远程登录到它。但是,由于某种原因,它无法从空中应用程序连接。

鉴于情况,我有以下问题:

1) 是否有任何好的文档可供我阅读以了解此安全框架的工作原理?我发现的唯一文档非常混乱。

2)有人对可能发生的事情有任何想法或暗示吗?

3) 我在某处读到 flexmojos 破解了安全框架,以便 flex 应用程序可以在测试期间毫无问题地打开到 localhost 的套接字。有没有关于如何完成的文档?

谢谢,

4

1 回答 1

0

您的评论中的答案非常接近...

您需要在 ~/Library/Preferences/Macromedia/Flash Player/#Security/FlashPlayerTrust 自己的文件中添加一行,覆盖您要运行的 swf。您可以直接手动执行此操作(将处理该文件夹中的所有文件)或使用Flash Player 设置管理器

于 2011-04-06T08:11:58.723 回答