browser_cached_messages.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. // Test to see if the cached messages are displayed when the console UI is
  5. // opened.
  6. "use strict";
  7. const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
  8. "test/test-webconsole-error-observer.html";
  9. // On e10s, the exception is triggered in child process
  10. // and is ignored by test harness
  11. if (!Services.appinfo.browserTabsRemoteAutostart) {
  12. expectUncaughtException();
  13. }
  14. function test() {
  15. waitForExplicitFinish();
  16. loadTab(TEST_URI).then(testOpenUI);
  17. }
  18. function testOpenUI(aTestReopen) {
  19. openConsole().then((hud) => {
  20. waitForMessages({
  21. webconsole: hud,
  22. messages: [
  23. {
  24. text: "log Bazzle",
  25. category: CATEGORY_WEBDEV,
  26. severity: SEVERITY_LOG,
  27. },
  28. {
  29. text: "error Bazzle",
  30. category: CATEGORY_WEBDEV,
  31. severity: SEVERITY_ERROR,
  32. },
  33. {
  34. text: "bazBug611032",
  35. category: CATEGORY_JS,
  36. severity: SEVERITY_ERROR,
  37. },
  38. {
  39. text: "cssColorBug611032",
  40. category: CATEGORY_CSS,
  41. severity: SEVERITY_WARNING,
  42. },
  43. ],
  44. }).then(() => {
  45. closeConsole(gBrowser.selectedTab).then(() => {
  46. aTestReopen && info("will reopen the Web Console");
  47. executeSoon(aTestReopen ? testOpenUI : finishTest);
  48. });
  49. });
  50. });
  51. }