/services/sync/tests/tps/test_privbrw_formdata.js

http://github.com/zpao/v8monkey · JavaScript · 73 lines · 48 code · 10 blank · 15 comment · 0 complexity · f3c0b16be93fc2a8e2afd1197d8cb7b7 MD5 · raw file

  1. /* Any copyright is dedicated to the Public Domain.
  2. http://creativecommons.org/publicdomain/zero/1.0/ */
  3. /*
  4. * The list of phases mapped to their corresponding profiles. The object
  5. * here must be in strict JSON format, as it will get parsed by the Python
  6. * testrunner (no single quotes, extra comma's, etc).
  7. */
  8. EnableEngines(["forms"]);
  9. var phases = { "phase1": "profile1",
  10. "phase2": "profile2",
  11. "phase3": "profile1",
  12. "phase4": "profile2" };
  13. /*
  14. * Form data
  15. */
  16. // the form data to add to the browser
  17. var formdata1 = [
  18. { fieldname: "name",
  19. value: "xyz",
  20. date: -1
  21. },
  22. { fieldname: "email",
  23. value: "abc@gmail.com",
  24. date: -2
  25. },
  26. { fieldname: "username",
  27. value: "joe"
  28. }
  29. ];
  30. // the form data to add in private browsing mode
  31. var formdata2 = [
  32. { fieldname: "password",
  33. value: "secret",
  34. date: -1
  35. },
  36. { fieldname: "city",
  37. value: "mtview"
  38. }
  39. ];
  40. /*
  41. * Test phases
  42. */
  43. Phase('phase1', [
  44. [Formdata.add, formdata1],
  45. [Formdata.verify, formdata1],
  46. [Sync]
  47. ]);
  48. Phase('phase2', [
  49. [Sync],
  50. [Formdata.verify, formdata1]
  51. ]);
  52. Phase('phase3', [
  53. [Sync],
  54. [SetPrivateBrowsing, true],
  55. [Formdata.add, formdata2],
  56. [Formdata.verify, formdata2],
  57. [Sync],
  58. ]);
  59. Phase('phase4', [
  60. [Sync],
  61. [Formdata.verify, formdata1],
  62. [Formdata.verifyNot, formdata2]
  63. ]);