csscoverage.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. "use strict";
  5. const {Arg, RetVal, generateActorSpec} = require("devtools/shared/protocol");
  6. require("devtools/shared/specs/stylesheets");
  7. const cssUsageSpec = generateActorSpec({
  8. typeName: "cssUsage",
  9. events: {
  10. "state-change": {
  11. type: "stateChange",
  12. stateChange: Arg(0, "json")
  13. }
  14. },
  15. methods: {
  16. start: {
  17. request: { url: Arg(0, "boolean") }
  18. },
  19. stop: {},
  20. toggle: {},
  21. oneshot: {},
  22. createEditorReport: {
  23. request: { url: Arg(0, "string") },
  24. response: { reports: RetVal("array:json") }
  25. },
  26. createEditorReportForSheet: {
  27. request: { url: Arg(0, "stylesheet") },
  28. response: { reports: RetVal("array:json") }
  29. },
  30. createPageReport: {
  31. response: RetVal("json")
  32. },
  33. _testOnlyVisitedPages: {
  34. response: { value: RetVal("array:string") }
  35. },
  36. },
  37. });
  38. exports.cssUsageSpec = cssUsageSpec;