chrome-test.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // Parent config file for all mochitest files.
  2. "use strict";
  3. module.exports = {
  4. env: {
  5. browser: true,
  6. "mozilla/browser-window": true,
  7. },
  8. // All globals made available in the test environment.
  9. globals: {
  10. // SpecialPowers is injected into the window object via SimpleTest.js
  11. SpecialPowers: false,
  12. XPCNativeWrapper: false,
  13. extractJarToTmp: false,
  14. getChromeDir: false,
  15. getJar: false,
  16. getResolvedURI: false,
  17. getRootDirectory: false,
  18. },
  19. overrides: [
  20. {
  21. env: {
  22. // Ideally we wouldn't be using the simpletest env here, but our uses of
  23. // js files mean we pick up everything from the global scope, which could
  24. // be any one of a number of html files. So we just allow the basics...
  25. "mozilla/simpletest": true,
  26. },
  27. files: ["*.js"],
  28. },
  29. ],
  30. plugins: ["mozilla", "@microsoft/sdl"],
  31. rules: {
  32. // No using of insecure url, so no http urls
  33. "@microsoft/sdl/no-insecure-url": [
  34. "error",
  35. {
  36. exceptions: [
  37. "^http:\\/\\/mochi\\.test?.*",
  38. "^http:\\/\\/localhost?.*",
  39. "^http:\\/\\/127\\.0\\.0\\.1?.*",
  40. // Exempt xmlns urls
  41. "^http:\\/\\/www\\.w3\\.org?.*",
  42. "^http:\\/\\/www\\.mozilla\\.org\\/keymaster\\/gatekeeper?.*",
  43. // Exempt urls that start with ftp or ws.
  44. "^ws:?.*",
  45. "^ftp:?.*",
  46. ],
  47. varExceptions: ["insecure?.*"],
  48. },
  49. ],
  50. "mozilla/import-content-task-globals": "error",
  51. "mozilla/import-headjs-globals": "error",
  52. "mozilla/mark-test-function-used": "error",
  53. },
  54. };