From 156a54c47f6ccc1aa8ba71f1aacb2ab351cd468b Mon Sep 17 00:00:00 2001 From: Mihai Sucan Date: Fri, 1 Jul 2011 23:26:51 +0300 Subject: [PATCH] Bug 592469 - Web Console cleanup: part 10 - tests cleanup; r=dcamp --- .../hudservice/tests/browser/Makefile.in | 4 -- ..._webconsole_bug_642108_refForOutputNode.js | 36 ---------- .../browser_webconsole_display_accessors.js | 67 ------------------- ...bconsole_get_content_window_from_hud_id.js | 64 ------------------ ...browser_webconsole_get_heads_up_display.js | 60 ----------------- 5 files changed, 231 deletions(-) delete mode 100644 toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_642108_refForOutputNode.js delete mode 100644 toolkit/components/console/hudservice/tests/browser/browser_webconsole_display_accessors.js delete mode 100644 toolkit/components/console/hudservice/tests/browser/browser_webconsole_get_content_window_from_hud_id.js delete mode 100644 toolkit/components/console/hudservice/tests/browser/browser_webconsole_get_heads_up_display.js diff --git a/toolkit/components/console/hudservice/tests/browser/Makefile.in b/toolkit/components/console/hudservice/tests/browser/Makefile.in index 0f20459a1f0..8062d7853e1 100644 --- a/toolkit/components/console/hudservice/tests/browser/Makefile.in +++ b/toolkit/components/console/hudservice/tests/browser/Makefile.in @@ -61,10 +61,7 @@ _BROWSER_TEST_FILES = \ browser_webconsole_console_logging_api.js \ browser_webconsole_consoleonpage.js \ browser_webconsole_chrome.js \ - browser_webconsole_display_accessors.js \ browser_webconsole_execution_scope.js \ - browser_webconsole_get_content_window_from_hud_id.js \ - browser_webconsole_get_heads_up_display.js \ browser_webconsole_history.js \ browser_webconsole_hud_getters.js \ browser_webconsole_js_input_and_output_styling.js \ @@ -130,7 +127,6 @@ _BROWSER_TEST_FILES = \ browser_webconsole_bug_618311_private_browsing.js \ browser_webconsole_bug_626484_output_copy_order.js \ browser_webconsole_bug_632347_iterators_generators.js \ - browser_webconsole_bug_642108_refForOutputNode.js \ browser_webconsole_bug_642108_pruneTest.js \ browser_webconsole_bug_585956_console_trace.js \ browser_webconsole_bug_595223_file_uri.js \ diff --git a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_642108_refForOutputNode.js b/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_642108_refForOutputNode.js deleted file mode 100644 index ce2f918c850..00000000000 --- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_642108_refForOutputNode.js +++ /dev/null @@ -1,36 +0,0 @@ -/* vim:set ts=2 sw=2 sts=2 et: */ -/* ***** BEGIN LICENSE BLOCK ***** - * Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ - * - * ***** END LICENSE BLOCK ***** */ - -// Tests that the getHudReferenceForOutputNode returns a reference when passed -// a hudBox (xul:vbox) or an output box (richlistbox). - -const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html"; - -function test() { - addTab(TEST_URI); - browser.addEventListener("DOMContentLoaded", testHudRef, - false); -} - -function testHudRef() { - browser.removeEventListener("DOMContentLoaded",testHudRef, false); - - openConsole(); - let hudId = HUDService.displaysIndex()[0]; - let hudBox = HUDService.getHeadsUpDisplay(hudId); - let hudRef = HUDService.getHudReferenceForOutputNode(hudBox); - - ok(hudRef, "We have a hudRef"); - - let outBox = HUDService.getOutputNodeById(hudId); - let hudRef2 = HUDService.getHudReferenceForOutputNode(outBox); - - ok(hudRef2, "We have the second hudRef"); - is(hudRef, hudRef2, "The two hudRefs are identical"); - - finishTest(); -} diff --git a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_display_accessors.js b/toolkit/components/console/hudservice/tests/browser/browser_webconsole_display_accessors.js deleted file mode 100644 index a87c6ed08ae..00000000000 --- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_display_accessors.js +++ /dev/null @@ -1,67 +0,0 @@ -/* vim:set ts=2 sw=2 sts=2 et: */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is DevTools test code. - * - * The Initial Developer of the Original Code is Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * David Dahl - * Patrick Walton - * Julian Viereck - * Mihai Sucan - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -// Tests that HUDService.displays() and HUDService.displaysIndex() work. - -const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html"; - -function test() { - addTab(TEST_URI); - browser.addEventListener("DOMContentLoaded", testDisplayAccessors, false); -} - -function testDisplayAccessors() { - browser.removeEventListener("DOMContentLoaded", testDisplayAccessors, - false); - - openConsole(); - - var idx = HUDService.displaysIndex(); - - let hudId = idx[0]; - - ok(typeof idx == "object", "displays is an object"); - ok(typeof idx.push == "function", "displaysIndex is an array"); - - var len = idx.length; - ok(idx.length > 0, "idx.length > 0: " + len); - - finishTest(); -} diff --git a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_get_content_window_from_hud_id.js b/toolkit/components/console/hudservice/tests/browser/browser_webconsole_get_content_window_from_hud_id.js deleted file mode 100644 index d86b56afaca..00000000000 --- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_get_content_window_from_hud_id.js +++ /dev/null @@ -1,64 +0,0 @@ -/* vim:set ts=2 sw=2 sts=2 et: */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is DevTools test code. - * - * The Initial Developer of the Original Code is Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * David Dahl - * Patrick Walton - * Julian Viereck - * Mihai Sucan - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -// Tests the HUDService.getContentWindowFromHUDId() method. - -const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html"; - -function test() { - addTab(TEST_URI); - browser.addEventListener("DOMContentLoaded", - testGetContentWindowFromHUDId, false); -} - -function testGetContentWindowFromHUDId() { - browser.removeEventListener("DOMContentLoaded", - testGetContentWindowFromHUDId, false); - - openConsole(); - - let hudId = HUDService.displaysIndex()[0]; - - let window = HUDService.getContentWindowFromHUDId(hudId); - ok(window.document, "we have a contentWindow"); - - finishTest(); -} - diff --git a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_get_heads_up_display.js b/toolkit/components/console/hudservice/tests/browser/browser_webconsole_get_heads_up_display.js deleted file mode 100644 index fcd4f13827d..00000000000 --- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_get_heads_up_display.js +++ /dev/null @@ -1,60 +0,0 @@ -/* vim:set ts=2 sw=2 sts=2 et: */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is DevTools test code. - * - * The Initial Developer of the Original Code is Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * David Dahl - * Patrick Walton - * Julian Viereck - * Mihai Sucan - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -// Tests the HUDService.getHeadsUpDisplay() method. - -const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html"; - -function test() { - addTab(TEST_URI); - browser.addEventListener("DOMContentLoaded", testGetHeadsUpDisplay, - false); -} - -function testGetHeadsUpDisplay() { - browser.removeEventListener("DOMContentLoaded", testGetHeadsUpDisplay, - false); - openConsole(); - hudId = HUDService.displaysIndex()[0]; - hud = HUDService.getHeadsUpDisplay(hudId); - ok(hud.getAttribute("id") == hudId, "found HUD node by Id."); - finishTest(); -} -