From 4460464e79ed2c2352145bef0b99c6eb4a3b91f4 Mon Sep 17 00:00:00 2001 From: Mihai Sucan Date: Fri, 28 Sep 2012 13:19:39 +0100 Subject: [PATCH] Backed out changeset 89ab8685729d (bug 768096) --- toolkit/devtools/webconsole/Makefile.in | 2 +- toolkit/devtools/webconsole/test/Makefile.in | 28 -- toolkit/devtools/webconsole/test/common.js | 128 --------- toolkit/devtools/webconsole/test/data.json | 1 - .../test/network_requests_iframe.html | 43 --- .../devtools/webconsole/test/test_basics.html | 69 ----- .../webconsole/test/test_cached_messages.html | 179 ------------ .../webconsole/test/test_consoleapi.html | 148 ---------- .../devtools/webconsole/test/test_jsterm.html | 146 ---------- .../webconsole/test/test_network_get.html | 243 ---------------- .../webconsole/test/test_network_post.html | 267 ------------------ .../webconsole/test/test_object_actor.html | 172 ----------- .../webconsole/test/test_page_errors.html | 98 ------- 13 files changed, 1 insertion(+), 1523 deletions(-) delete mode 100644 toolkit/devtools/webconsole/test/Makefile.in delete mode 100644 toolkit/devtools/webconsole/test/common.js delete mode 100644 toolkit/devtools/webconsole/test/data.json delete mode 100644 toolkit/devtools/webconsole/test/network_requests_iframe.html delete mode 100644 toolkit/devtools/webconsole/test/test_basics.html delete mode 100644 toolkit/devtools/webconsole/test/test_cached_messages.html delete mode 100644 toolkit/devtools/webconsole/test/test_consoleapi.html delete mode 100644 toolkit/devtools/webconsole/test/test_jsterm.html delete mode 100644 toolkit/devtools/webconsole/test/test_network_get.html delete mode 100644 toolkit/devtools/webconsole/test/test_network_post.html delete mode 100644 toolkit/devtools/webconsole/test/test_object_actor.html delete mode 100644 toolkit/devtools/webconsole/test/test_page_errors.html diff --git a/toolkit/devtools/webconsole/Makefile.in b/toolkit/devtools/webconsole/Makefile.in index b18701a007a..e2f3ae0ee30 100644 --- a/toolkit/devtools/webconsole/Makefile.in +++ b/toolkit/devtools/webconsole/Makefile.in @@ -9,7 +9,7 @@ VPATH = @srcdir@ include $(DEPTH)/config/autoconf.mk -TEST_DIRS += test +#TEST_DIRS += tests include $(topsrcdir)/config/rules.mk diff --git a/toolkit/devtools/webconsole/test/Makefile.in b/toolkit/devtools/webconsole/test/Makefile.in deleted file mode 100644 index 59029ba53a8..00000000000 --- a/toolkit/devtools/webconsole/test/Makefile.in +++ /dev/null @@ -1,28 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -DEPTH = @DEPTH@ -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ -relativesrcdir = @relativesrcdir@ - -include $(DEPTH)/config/autoconf.mk - -# Mochitest tests -MOCHITEST_FILES = \ - test_basics.html \ - test_cached_messages.html \ - test_page_errors.html \ - test_consoleapi.html \ - test_jsterm.html \ - test_object_actor.html \ - test_network_get.html \ - test_network_post.html \ - network_requests_iframe.html \ - data.json \ - common.js \ - $(NULL) - -include $(topsrcdir)/config/rules.mk diff --git a/toolkit/devtools/webconsole/test/common.js b/toolkit/devtools/webconsole/test/common.js deleted file mode 100644 index 55df7f0e269..00000000000 --- a/toolkit/devtools/webconsole/test/common.js +++ /dev/null @@ -1,128 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ - -netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); - -const {classes: Cc, interfaces: Ci, utils: Cu} = Components; - -Cu.import("resource://gre/modules/Services.jsm"); -Cu.import("resource://gre/modules/devtools/dbg-server.jsm"); -Cu.import("resource://gre/modules/devtools/dbg-client.jsm"); -Cu.import("resource://gre/modules/devtools/WebConsoleUtils.jsm"); - -function initCommon() -{ - // Always log packets when running tests. - Services.prefs.setBoolPref("devtools.debugger.log", true); -} - -function initDebuggerServer() -{ - if (!DebuggerServer.initialized) { - DebuggerServer.init(); - DebuggerServer.addBrowserActors(); - } -} - -function connectToDebugger(aCallback) -{ - initCommon(); - initDebuggerServer(); - - let transport = DebuggerServer.connectPipe(); - let client = new DebuggerClient(transport); - - let dbgState = { dbgClient: client }; - client.connect(aCallback.bind(null, dbgState)); -} - -function attachConsole(aListeners, aCallback) -{ - function _onAttachConsole(aState, aResponse, aWebConsoleClient) - { - if (aResponse.error) { - Cu.reportError("attachConsole failed: " + aResponse.error + " " + - aResponse.message); - } - - aState.client = aWebConsoleClient; - - aCallback(aState, aResponse); - } - - connectToDebugger(function _onConnect(aState) { - aState.dbgClient.listTabs(function _onListTabs(aResponse) { - if (aResponse.error) { - Cu.reportError("listTabs failed: " + aResponse.error + " " + - aResponse.message); - aCallback(aState, aResponse); - return; - } - let tab = aResponse.tabs[aResponse.selected]; - aState.actor = tab.consoleActor; - aState.dbgClient.attachConsole(tab.consoleActor, aListeners, - _onAttachConsole.bind(null, aState)); - }); - }); -} - -function closeDebugger(aState, aCallback) -{ - aState.dbgClient.close(aCallback); - aState.dbgClient = null; - aState.client = null; -} - -function checkConsoleAPICall(aCall, aExpected) -{ - if (aExpected.level != "trace" && aExpected.arguments) { - is(aCall.arguments.length, aExpected.arguments.length, - "number of arguments"); - } - - checkObject(aCall, aExpected); -} - -function checkObject(aObject, aExpected) -{ - for (let name of Object.keys(aExpected)) - { - let expected = aExpected[name]; - let value = aObject[name]; - if (value === undefined) { - ok(false, "'" + name + "' is undefined"); - } - else if (typeof expected == "string" || - typeof expected == "number" || - typeof expected == "boolean") { - is(value, expected, "property '" + name + "'"); - } - else if (expected instanceof RegExp) { - ok(expected.test(value), name + ": " + expected); - } - else if (Array.isArray(expected)) { - info("checking array for property '" + name + "'"); - checkObject(value, expected); - } - else if (typeof expected == "object") { - info("checking object for property '" + name + "'"); - checkObject(value, expected); - } - } -} - -function checkHeadersOrCookies(aArray, aExpected) -{ - for (let elem of aArray) { - if (!(elem.name in aExpected)) { - continue; - } - let expected = aExpected[elem.name]; - if (expected instanceof RegExp) { - ok(expected.test(elem.value), elem.name + ": " + expected); - } - else { - is(elem.value, expected, elem.name); - } - } -} diff --git a/toolkit/devtools/webconsole/test/data.json b/toolkit/devtools/webconsole/test/data.json deleted file mode 100644 index 471d240b5d2..00000000000 --- a/toolkit/devtools/webconsole/test/data.json +++ /dev/null @@ -1 +0,0 @@ -{ id: "test JSON data", myArray: [ "foo", "bar", "baz", "biff" ] } \ No newline at end of file diff --git a/toolkit/devtools/webconsole/test/network_requests_iframe.html b/toolkit/devtools/webconsole/test/network_requests_iframe.html deleted file mode 100644 index ca5b6ece992..00000000000 --- a/toolkit/devtools/webconsole/test/network_requests_iframe.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - Console HTTP test page - - - - -

Web Console HTTP Logging Testpage

-

This page is used to test the HTTP logging.

- -
-
-
-
- - diff --git a/toolkit/devtools/webconsole/test/test_basics.html b/toolkit/devtools/webconsole/test/test_basics.html deleted file mode 100644 index 5a0cebdb0b0..00000000000 --- a/toolkit/devtools/webconsole/test/test_basics.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - Basic Web Console Actor tests - - - - - -

Basic Web Console Actor tests

- - - - diff --git a/toolkit/devtools/webconsole/test/test_cached_messages.html b/toolkit/devtools/webconsole/test/test_cached_messages.html deleted file mode 100644 index 5ded47c409e..00000000000 --- a/toolkit/devtools/webconsole/test/test_cached_messages.html +++ /dev/null @@ -1,179 +0,0 @@ - - - - - Test for cached messages - - - - - -

Test for cached messages

- - - - - - diff --git a/toolkit/devtools/webconsole/test/test_consoleapi.html b/toolkit/devtools/webconsole/test/test_consoleapi.html deleted file mode 100644 index 8fc42fc4b54..00000000000 --- a/toolkit/devtools/webconsole/test/test_consoleapi.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - - Test for the Console API - - - - - -

Test for the Console API

- - - - diff --git a/toolkit/devtools/webconsole/test/test_jsterm.html b/toolkit/devtools/webconsole/test/test_jsterm.html deleted file mode 100644 index 7f22c94d3ca..00000000000 --- a/toolkit/devtools/webconsole/test/test_jsterm.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - - Test for JavaScript terminal functionality - - - - - -

Test for JavaScript terminal functionality

- - - - diff --git a/toolkit/devtools/webconsole/test/test_network_get.html b/toolkit/devtools/webconsole/test/test_network_get.html deleted file mode 100644 index 7f4d34f1cc0..00000000000 --- a/toolkit/devtools/webconsole/test/test_network_get.html +++ /dev/null @@ -1,243 +0,0 @@ - - - - - Test for the network actor (GET request) - - - - - -

Test for the network actor (GET request)

- - - - - - diff --git a/toolkit/devtools/webconsole/test/test_network_post.html b/toolkit/devtools/webconsole/test/test_network_post.html deleted file mode 100644 index 8cbff8132f8..00000000000 --- a/toolkit/devtools/webconsole/test/test_network_post.html +++ /dev/null @@ -1,267 +0,0 @@ - - - - - Test for the network actor (POST request) - - - - - -

Test for the network actor (POST request)

- - - - - - diff --git a/toolkit/devtools/webconsole/test/test_object_actor.html b/toolkit/devtools/webconsole/test/test_object_actor.html deleted file mode 100644 index f7f29da3b5e..00000000000 --- a/toolkit/devtools/webconsole/test/test_object_actor.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - Test for the object actor - - - - - -

Test for the object actor

- - - - diff --git a/toolkit/devtools/webconsole/test/test_page_errors.html b/toolkit/devtools/webconsole/test/test_page_errors.html deleted file mode 100644 index 7ced3c52f96..00000000000 --- a/toolkit/devtools/webconsole/test/test_page_errors.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - Test for page errors - - - - - -

Test for page errors

- - - -