Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想使用 c++ XPCOM 组件创建一个 Firefox 扩展,该组件又使用 javascript XPCOM 组件。是否有任何框架允许 C++ XPCOM 组件/firefox 扩展的测试驱动开发?
您可以复制 Mozilla用来测试本机代码的内容。您只需确保与 libxul 链接(这可能需要您构建 Firefox)。
可以在此处找到使用 TestHarness.h 的示例文件。
除了 sdwilsh 的建议之外,您还可以使用 mozilla 使用的另一个测试框架 - xpcshell tests。如果您构建 Firefox,这也是最容易设置的。