Advertisement
Guest User

Untitled

a guest
Feb 24th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. diff --git a/src/test/integration/tests/returnvalues.js b/src/test/integration/tests/returnvalues.js
  2. index 6237680..9e82d8b 100644
  3. --- a/src/test/integration/tests/returnvalues.js
  4. +++ b/src/test/integration/tests/returnvalues.js
  5. @@ -7,6 +7,7 @@ const {
  6. resume,
  7. stepIn,
  8. waitForPaused,
  9. + pauseTest
  10. } = require("../utils");
  11.  
  12. function getLabel(dbg, index) {
  13. @@ -25,6 +26,10 @@ async function testReturnValue(dbg, ctx, val) {
  14. evalInTab(dbg, `return_something(${val})`);
  15. await waitForPaused(dbg);
  16.  
  17. + if (val == "0") {
  18. + await pauseTest()
  19. + }
  20. +
  21. // "Step in" 3 times to get to the point where the debugger can
  22. // see the return value.
  23. await stepIn(dbg);
  24. diff --git a/src/test/integration/utils/index.js b/src/test/integration/utils/index.js
  25. index f5bfb95..164307c 100644
  26. --- a/src/test/integration/utils/index.js
  27. +++ b/src/test/integration/utils/index.js
  28. @@ -49,7 +49,8 @@ const {
  29. findSource,
  30. isPaused,
  31. isVisibleWithin,
  32. - getSelector
  33. + getSelector,
  34. + pauseTest
  35. } = require("./shared")
  36.  
  37. module.exports = {
  38. diff --git a/src/test/integration/utils/shared.js b/src/test/integration/utils/shared.js
  39. index 0d58763..5d0e945 100644
  40. --- a/src/test/integration/utils/shared.js
  41. +++ b/src/test/integration/utils/shared.js
  42. @@ -95,6 +95,20 @@ function info(msg) {
  43. console.log(message)
  44. }
  45.  
  46. +
  47. +window.resumeTest = undefined;
  48. +/**
  49. + * Pause the test and let you interact with the debugger.
  50. + * The test can be resumed by invoking `resumeTest` in the console.
  51. + *
  52. + * @memberof mochitest
  53. + * @static
  54. + */
  55. +function pauseTest() {
  56. + info("Test paused. Invoke resumeTest to continue.");
  57. + return new Promise(resolve => resumeTest = resolve);
  58. +}
  59. +
  60. module.exports = {
  61. findElement,
  62. findElementWithSelector,
  63. @@ -104,5 +118,6 @@ module.exports = {
  64. getSelector,
  65. isPaused,
  66. isVisibleWithin,
  67. - info
  68. + info,
  69. + pauseTest
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement