browser/devtools/webconsole/test/browser_webconsole_message_node_id.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/devtools/webconsole/test/browser_webconsole_message_node_id.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,31 @@
     1.4 +/* vim:set ts=2 sw=2 sts=2 et: */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console.html";
    1.10 +
    1.11 +function test() {
    1.12 +  addTab(TEST_URI);
    1.13 +  browser.addEventListener("DOMContentLoaded", onLoad, false);
    1.14 +}
    1.15 +
    1.16 +function onLoad() {
    1.17 +  browser.removeEventListener("DOMContentLoaded", onLoad, false);
    1.18 +  openConsole(null, function(hud) {
    1.19 +    content.console.log("a log message");
    1.20 +
    1.21 +    waitForMessages({
    1.22 +      webconsole: hud,
    1.23 +      messages: [{
    1.24 +        text: "a log message",
    1.25 +        category: CATEGORY_WEBDEV,
    1.26 +        severity: SEVERITY_LOG,
    1.27 +      }],
    1.28 +    }).then(([result]) => {
    1.29 +      let msg = [...result.matched][0];
    1.30 +      ok(msg.getAttribute("id"), "log message has an ID");
    1.31 +      finishTest();
    1.32 +    });
    1.33 +  });
    1.34 +}

mercurial