browser_dbg_global-method-override.js 804 B

1234567891011121314151617181920212223242526
  1. /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
  2. /* Any copyright is dedicated to the Public Domain.
  3. * http://creativecommons.org/publicdomain/zero/1.0/ */
  4. /**
  5. * Tests that scripts that override properties of the global object, like
  6. * toString don't break the debugger. The test page used to cause the debugger
  7. * to throw when trying to attach to the thread actor.
  8. */
  9. const TAB_URL = EXAMPLE_URL + "doc_global-method-override.html";
  10. function test() {
  11. let options = {
  12. source: TAB_URL,
  13. line: 1
  14. };
  15. initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
  16. let gDebugger = aPanel.panelWin;
  17. ok(gDebugger, "Should have a debugger available.");
  18. is(gDebugger.gThreadClient.state, "attached", "Debugger should be attached.");
  19. closeDebuggerAndFinish(aPanel);
  20. });
  21. }