/services/sync/tests/tps/test_bug531489.js

http://github.com/zpao/v8monkey · JavaScript · 62 lines · 35 code · 9 blank · 18 comment · 0 complexity · 4d33a7446ff33a0b39cf48e3f289e2fa 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(["bookmarks"]);
  9. var phases = { "phase1": "profile1",
  10. "phase2": "profile2",
  11. "phase3": "profile1"};
  12. /*
  13. * Bookmark asset lists: these define bookmarks that are used during the test
  14. */
  15. // the initial list of bookmarks to add to the browser
  16. var bookmarks_initial = {
  17. "menu": [
  18. { folder: "foldera" },
  19. { uri: "http://www.google.com",
  20. title: "Google"
  21. }
  22. ],
  23. "menu/foldera": [
  24. { uri: "http://www.google.com",
  25. title: "Google"
  26. }
  27. ],
  28. "toolbar": [
  29. { uri: "http://www.google.com",
  30. title: "Google"
  31. }
  32. ]
  33. };
  34. /*
  35. * Test phases
  36. */
  37. // Add three bookmarks with the same url to different locations and sync.
  38. Phase('phase1', [
  39. [Bookmarks.add, bookmarks_initial],
  40. [Bookmarks.verify, bookmarks_initial],
  41. [Sync]
  42. ]);
  43. // Sync to profile2 and verify that all three bookmarks are present
  44. Phase('phase2', [
  45. [Sync],
  46. [Bookmarks.verify, bookmarks_initial]
  47. ]);
  48. // Sync again to profile1 and verify that all three bookmarks are still
  49. // present.
  50. Phase('phase3', [
  51. [Sync],
  52. [Bookmarks.verify, bookmarks_initial]
  53. ]);