browser_cmd_measure.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* Any copyright is dedicated to the Public Domain.
  2. * http://creativecommons.org/publicdomain/zero/1.0/ */
  3. "use strict";
  4. // Tests the highlight command, ensure no invalid arguments are given
  5. const TEST_PAGE = "data:text/html;charset=utf-8,foo";
  6. function test() {
  7. return Task.spawn(spawnTest).then(finish, helpers.handleError);
  8. }
  9. function* spawnTest() {
  10. let options = yield helpers.openTab(TEST_PAGE);
  11. yield helpers.openToolbar(options);
  12. yield helpers.audit(options, [
  13. {
  14. setup: "measure",
  15. check: {
  16. input: "measure",
  17. markup: "VVVVVVV",
  18. status: "VALID"
  19. }
  20. },
  21. {
  22. setup: "measure on",
  23. check: {
  24. input: "measure on",
  25. markup: "VVVVVVVVEE",
  26. status: "ERROR"
  27. },
  28. exec: {
  29. output: "Error: Too many arguments"
  30. }
  31. },
  32. {
  33. setup: "measure --visible",
  34. check: {
  35. input: "measure --visible",
  36. markup: "VVVVVVVVEEEEEEEEE",
  37. status: "ERROR"
  38. },
  39. exec: {
  40. output: "Error: Too many arguments"
  41. }
  42. }
  43. ]);
  44. yield helpers.closeToolbar(options);
  45. yield helpers.closeTab(options);
  46. }