Bug 592469 - Web Console cleanup: part 10 - tests cleanup; r=dcamp

This commit is contained in:
Mihai Sucan 2011-07-01 23:26:51 +03:00
parent b0f7c09a10
commit 156a54c47f
5 changed files with 0 additions and 231 deletions

View File

@ -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 \

View File

@ -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();
}

View File

@ -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 <ddahl@mozilla.com>
* Patrick Walton <pcwalton@mozilla.com>
* Julian Viereck <jviereck@mozilla.com>
* Mihai Sucan <mihai.sucan@gmail.com>
*
* 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();
}

View File

@ -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 <ddahl@mozilla.com>
* Patrick Walton <pcwalton@mozilla.com>
* Julian Viereck <jviereck@mozilla.com>
* Mihai Sucan <mihai.sucan@gmail.com>
*
* 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();
}

View File

@ -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 <ddahl@mozilla.com>
* Patrick Walton <pcwalton@mozilla.com>
* Julian Viereck <jviereck@mozilla.com>
* Mihai Sucan <mihai.sucan@gmail.com>
*
* 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();
}