browser-test.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. // Parent config file for all browser-chrome files.
  2. "use strict";
  3. module.exports = {
  4. env: {
  5. browser: true,
  6. "mozilla/browser-window": true,
  7. "mozilla/simpletest": true,
  8. // "node": true
  9. },
  10. // All globals made available in the test environment.
  11. globals: {
  12. // `$` is defined in SimpleTest.js
  13. $: false,
  14. Assert: false,
  15. BrowserTestUtils: false,
  16. ContentTask: false,
  17. ContentTaskUtils: false,
  18. EventUtils: false,
  19. IOUtils: false,
  20. PathUtils: false,
  21. PromiseDebugging: false,
  22. SpecialPowers: false,
  23. TestUtils: false,
  24. XPCNativeWrapper: false,
  25. addLoadEvent: false,
  26. add_setup: false,
  27. add_task: false,
  28. content: false,
  29. executeSoon: false,
  30. expectUncaughtException: false,
  31. export_assertions: false,
  32. extractJarToTmp: false,
  33. finish: false,
  34. gTestPath: false,
  35. getChromeDir: false,
  36. getJar: false,
  37. getResolvedURI: false,
  38. getRootDirectory: false,
  39. getTestFilePath: false,
  40. ignoreAllUncaughtExceptions: false,
  41. info: false,
  42. is: false,
  43. isnot: false,
  44. ok: false,
  45. record: false,
  46. registerCleanupFunction: false,
  47. requestLongerTimeout: false,
  48. setExpectedFailuresForSelfTest: false,
  49. stringContains: false,
  50. stringMatches: false,
  51. todo: false,
  52. todo_is: false,
  53. todo_isnot: false,
  54. waitForClipboard: false,
  55. waitForExplicitFinish: false,
  56. waitForFocus: false,
  57. },
  58. plugins: ["mozilla", "@microsoft/sdl"],
  59. rules: {
  60. // No using of insecure url, so no http urls
  61. "@microsoft/sdl/no-insecure-url": [
  62. "error",
  63. {
  64. exceptions: [
  65. "^http:\\/\\/mochi\\.test?.*",
  66. "^http:\\/\\/localhost?.*",
  67. "^http:\\/\\/127\\.0\\.0\\.1?.*",
  68. // Exempt xmlns urls
  69. "^http:\\/\\/www\\.w3\\.org?.*",
  70. "^http:\\/\\/www\\.mozilla\\.org\\/keymaster\\/gatekeeper?.*",
  71. // Exempt urls that start with ftp or ws.
  72. "^ws:?.*",
  73. "^ftp:?.*",
  74. ],
  75. varExceptions: ["insecure?.*"],
  76. },
  77. ],
  78. "mozilla/import-content-task-globals": "error",
  79. "mozilla/import-headjs-globals": "error",
  80. "mozilla/mark-test-function-used": "error",
  81. "mozilla/no-addtask-setup": "error",
  82. "mozilla/no-arbitrary-setTimeout": "error",
  83. },
  84. };