Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* vim:set ts=2 sw=2 sts=2 et: */ |
michael@0 | 2 | /* ***** BEGIN LICENSE BLOCK ***** |
michael@0 | 3 | * Any copyright is dedicated to the Public Domain. |
michael@0 | 4 | * http://creativecommons.org/publicdomain/zero/1.0/ |
michael@0 | 5 | * |
michael@0 | 6 | * Contributor(s): |
michael@0 | 7 | * Mihai Șucan <mihai.sucan@gmail.com> |
michael@0 | 8 | * |
michael@0 | 9 | * ***** END LICENSE BLOCK ***** */ |
michael@0 | 10 | |
michael@0 | 11 | const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-bug-601177-log-levels.html"; |
michael@0 | 12 | |
michael@0 | 13 | function test() |
michael@0 | 14 | { |
michael@0 | 15 | //requestLongerTimeout(20); |
michael@0 | 16 | //FIXME |
michael@0 | 17 | Services.prefs.setBoolPref("javascript.options.strict", true); |
michael@0 | 18 | registerCleanupFunction(function() { |
michael@0 | 19 | Services.prefs.clearUserPref("javascript.options.strict"); |
michael@0 | 20 | }); |
michael@0 | 21 | |
michael@0 | 22 | addTab("data:text/html;charset=utf-8,Web Console test for bug 601177: log levels"); |
michael@0 | 23 | |
michael@0 | 24 | browser.addEventListener("load", function onLoad() { |
michael@0 | 25 | browser.removeEventListener("load", onLoad, true); |
michael@0 | 26 | openConsole(null, consoleOpened); |
michael@0 | 27 | }, true); |
michael@0 | 28 | |
michael@0 | 29 | function consoleOpened(hud) |
michael@0 | 30 | { |
michael@0 | 31 | expectUncaughtException(); |
michael@0 | 32 | content.location = TEST_URI; |
michael@0 | 33 | |
michael@0 | 34 | info("waiting for messages"); |
michael@0 | 35 | |
michael@0 | 36 | waitForMessages({ |
michael@0 | 37 | webconsole: hud, |
michael@0 | 38 | messages: [ |
michael@0 | 39 | { |
michael@0 | 40 | text: "test-bug-601177-log-levels.html", |
michael@0 | 41 | category: CATEGORY_NETWORK, |
michael@0 | 42 | severity: SEVERITY_LOG, |
michael@0 | 43 | }, |
michael@0 | 44 | { |
michael@0 | 45 | text: "test-bug-601177-log-levels.js", |
michael@0 | 46 | category: CATEGORY_NETWORK, |
michael@0 | 47 | severity: SEVERITY_LOG, |
michael@0 | 48 | }, |
michael@0 | 49 | { |
michael@0 | 50 | text: "test-image.png", |
michael@0 | 51 | category: CATEGORY_NETWORK, |
michael@0 | 52 | severity: SEVERITY_LOG, |
michael@0 | 53 | }, |
michael@0 | 54 | { |
michael@0 | 55 | text: "foobar-known-to-fail.png", |
michael@0 | 56 | category: CATEGORY_NETWORK, |
michael@0 | 57 | severity: SEVERITY_ERROR, |
michael@0 | 58 | }, |
michael@0 | 59 | { |
michael@0 | 60 | text: "foobarBug601177exception", |
michael@0 | 61 | category: CATEGORY_JS, |
michael@0 | 62 | severity: SEVERITY_ERROR, |
michael@0 | 63 | }, |
michael@0 | 64 | { |
michael@0 | 65 | text: "undefinedPropertyBug601177", |
michael@0 | 66 | category: CATEGORY_JS, |
michael@0 | 67 | severity: SEVERITY_WARNING, |
michael@0 | 68 | }, |
michael@0 | 69 | { |
michael@0 | 70 | text: "foobarBug601177strictError", |
michael@0 | 71 | category: CATEGORY_JS, |
michael@0 | 72 | severity: SEVERITY_WARNING, |
michael@0 | 73 | }, |
michael@0 | 74 | ], |
michael@0 | 75 | }).then(finishTest); |
michael@0 | 76 | } |
michael@0 | 77 | } |