summaryrefslogtreecommitdiffstats
path: root/devtools/client/webconsole/test/browser/browser_webconsole_repeat_different_objects.js
blob: 23ab0e5fd5ed14b032955de95ad4eca1a544f160 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/publicdomain/zero/1.0/ */

// Test that makes sure messages are not considered repeated when console.log()
// is invoked with different objects, see bug 865288.

"use strict";

const TEST_URI = "data:text/html,Test repeated objects";

add_task(async function() {
  const hud = await openNewTabAndConsole(TEST_URI);

  const onMessages = waitForMessages({
    hud,
    messages: [{ text: "abba" }, { text: "abba" }, { text: "abba" }],
  });

  SpecialPowers.spawn(gBrowser.selectedBrowser, [], () => {
    for (let i = 0; i < 3; i++) {
      const o = { id: "abba" };
      content.console.log("abba", o);
    }
  });

  info("waiting for 3 console.log objects, with the exact same text content");
  const messages = await onMessages;
  is(messages.length, 3, "There are 3 messages, as expected.");
});