From 926bf1ca5d102a9b2c098db7443f52d57dc3d64e Mon Sep 17 00:00:00 2001 From: Michael Ratcliffe Date: Wed, 5 Nov 2014 16:00:52 +0000 Subject: [PATCH] Bug 1090913 - Make mochitests fail when it has 0 passes and 0 fails r=jmaher --- browser/base/content/test/newtab/browser.ini | 2 - .../browser_newtab_background_captures.js | 6 ++ .../test/newtab/browser_newtab_reflow_load.js | 2 + .../test/newtab/browser_newtab_reset.js | 28 --------- .../test/newtab/browser_newtab_tabsync.js | 61 ------------------- .../sessionstore/test/browser_707862.js | 4 ++ browser/components/shell/test/browser.ini | 1 + .../tabview/test/browser_tabview_bug598375.js | 4 ++ browser/devtools/commandline/test/browser.ini | 2 + browser/devtools/commandline/test/helpers.js | 5 ++ browser/devtools/framework/test/browser.ini | 1 + .../test/browser_toolbox_window_shortcuts.js | 6 -- .../test/browser_webgl-actor-test-02.js | 2 + browser/devtools/tilt/test/browser.ini | 1 + .../test/browser_tilt_02_notifications-seq.js | 8 +-- .../browser_tilt_02_notifications-tabs.js | 6 +- .../test/browser_tilt_02_notifications.js | 8 +-- .../tilt/test/browser_tilt_03_tab_switch.js | 8 ++- .../test/browser_tilt_04_initialization.js | 4 +- .../test/browser_tilt_05_destruction-esc.js | 4 +- .../test/browser_tilt_05_destruction-url.js | 4 +- .../tilt/test/browser_tilt_05_destruction.js | 4 +- .../browser_tilt_arcball-reset-typeahead.js | 5 +- .../tilt/test/browser_tilt_arcball-reset.js | 5 +- .../tilt/test/browser_tilt_controller.js | 4 +- .../devtools/tilt/test/browser_tilt_gl01.js | 2 + .../devtools/tilt/test/browser_tilt_gl02.js | 2 + .../devtools/tilt/test/browser_tilt_gl03.js | 2 + .../devtools/tilt/test/browser_tilt_gl04.js | 2 + .../devtools/tilt/test/browser_tilt_gl05.js | 2 + .../devtools/tilt/test/browser_tilt_gl06.js | 2 + .../devtools/tilt/test/browser_tilt_gl07.js | 2 + .../devtools/tilt/test/browser_tilt_gl08.js | 2 + .../tilt/test/browser_tilt_picking.js | 4 +- .../tilt/test/browser_tilt_picking_delete.js | 4 +- .../browser_tilt_picking_highlight01-offs.js | 4 +- .../test/browser_tilt_picking_highlight01.js | 4 +- .../test/browser_tilt_picking_highlight02.js | 4 +- .../test/browser_tilt_picking_highlight03.js | 4 +- .../test/browser_tilt_picking_inspector.js | 4 +- .../tilt/test/browser_tilt_picking_miv.js | 4 +- .../tilt/test/browser_tilt_visualizer.js | 2 + .../devtools/tilt/test/browser_tilt_zoom.js | 4 +- browser/devtools/tilt/test/head.js | 7 ++- ...browser_audionode-actor-get-param-flags.js | 15 +++-- dom/indexedDB/test/browser_bug839193.js | 5 ++ image/test/browser/browser.ini | 2 +- .../browser/browser_certificateManagerLeak.js | 5 ++ testing/mochitest/browser-test.js | 8 ++- .../test/browser/browser-common.ini | 1 + .../test/browser/browser_bug593535.js | 1 - 51 files changed, 144 insertions(+), 139 deletions(-) delete mode 100644 browser/base/content/test/newtab/browser_newtab_reset.js delete mode 100644 browser/base/content/test/newtab/browser_newtab_tabsync.js diff --git a/browser/base/content/test/newtab/browser.ini b/browser/base/content/test/newtab/browser.ini index c52dad9625e1..71a9417e9483 100644 --- a/browser/base/content/test/newtab/browser.ini +++ b/browser/base/content/test/newtab/browser.ini @@ -31,7 +31,6 @@ skip-if = os == "mac" # Intermittent failures, bug 898317 [browser_newtab_reflow_load.js] support-files = content-reflows.js -[browser_newtab_reset.js] [browser_newtab_search.js] support-files = searchEngineNoLogo.xml @@ -42,7 +41,6 @@ support-files = ../general/searchSuggestionEngine.xml ../general/searchSuggestionEngine.sjs [browser_newtab_sponsored_icon_click.js] -[browser_newtab_tabsync.js] [browser_newtab_undo.js] [browser_newtab_unpin.js] [browser_newtab_update.js] diff --git a/browser/base/content/test/newtab/browser_newtab_background_captures.js b/browser/base/content/test/newtab/browser_newtab_background_captures.js index 82ba365b7e22..f8ea7f982fb5 100644 --- a/browser/base/content/test/newtab/browser_newtab_background_captures.js +++ b/browser/base/content/test/newtab/browser_newtab_background_captures.js @@ -37,6 +37,12 @@ function runTests() { // for the hidden newtab docshell. let tab = gWindow.gBrowser.addTab("about:blank"); yield addNewTabPageTab(); + + // When newtab is loaded very quickly (which is what happens in 99% of cases) + // there is no need to wait so no tests are run. Because each test requires + // either a pass, fail or todo we run a dummy test here. + ok(true, "Each test requires at least one pass, fail or todo so here is a pass."); + let swapWaitCount = 0; let swapped = imports.BrowserNewTabPreloader.newTab(tab); while (!swapped) { diff --git a/browser/base/content/test/newtab/browser_newtab_reflow_load.js b/browser/base/content/test/newtab/browser_newtab_reflow_load.js index d73b0a541c45..28e1032e7d31 100644 --- a/browser/base/content/test/newtab/browser_newtab_reflow_load.js +++ b/browser/base/content/test/newtab/browser_newtab_reflow_load.js @@ -28,6 +28,8 @@ function runTests() { // Clean up. gBrowser.removeCurrentTab({animate: false}); + + ok(true, "Each test requires at least one pass, fail or todo so here is a pass."); } function whenBrowserLoaded(browser) { diff --git a/browser/base/content/test/newtab/browser_newtab_reset.js b/browser/base/content/test/newtab/browser_newtab_reset.js deleted file mode 100644 index 3503fbb8d014..000000000000 --- a/browser/base/content/test/newtab/browser_newtab_reset.js +++ /dev/null @@ -1,28 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - http://creativecommons.org/publicdomain/zero/1.0/ */ - -/* - * These tests make sure that resetting the 'New Tage Page' works as expected. - */ -function runTests() { - // Disabled until bug 716543 is fixed. - return; - - // create a new tab page and check its modified state after blocking a site - yield setLinks("0,1,2,3,4,5,6,7,8"); - setPinnedLinks(""); - - yield addNewTabPageTab(); - let resetButton = getContentDocument().getElementById("toolbar-button-reset"); - - checkGrid("0,1,2,3,4,5,6,7,8"); - ok(!resetButton.hasAttribute("modified"), "page is not modified"); - - yield blockCell(4); - checkGrid("0,1,2,3,5,6,7,8,"); - ok(resetButton.hasAttribute("modified"), "page is modified"); - - yield getContentWindow().gToolbar.reset(TestRunner.next); - checkGrid("0,1,2,3,4,5,6,7,8"); - ok(!resetButton.hasAttribute("modified"), "page is not modified"); -} diff --git a/browser/base/content/test/newtab/browser_newtab_tabsync.js b/browser/base/content/test/newtab/browser_newtab_tabsync.js deleted file mode 100644 index c2b61f8f3e57..000000000000 --- a/browser/base/content/test/newtab/browser_newtab_tabsync.js +++ /dev/null @@ -1,61 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - http://creativecommons.org/publicdomain/zero/1.0/ */ - -/* - * These tests make sure that all changes that are made to a specific - * 'New Tab Page' are synchronized with all other open 'New Tab Pages' - * automatically. All about:newtab pages should always be in the same - * state. - */ -function runTests() { - // Disabled until bug 716543 is fixed. - return; - - yield setLinks("0,1,2,3,4,5,6,7,8,9"); - setPinnedLinks(",1"); - - yield addNewTabPageTab(); - checkGrid("0,1p,2,3,4,5,6,7,8"); - - let resetButton = getContentDocument().getElementById("toolbar-button-reset"); - ok(!resetButton.hasAttribute("modified"), "page is not modified"); - - let oldSites = getGrid().sites; - let oldResetButton = resetButton; - - // create the new tab page - yield addNewTabPageTab(); - checkGrid("0,1p,2,3,4,5,6,7,8"); - - resetButton = getContentDocument().getElementById("toolbar-button-reset"); - ok(!resetButton.hasAttribute("modified"), "page is not modified"); - - // unpin a cell - yield unpinCell(1); - checkGrid("0,1,2,3,4,5,6,7,8"); - checkGrid("0,1,2,3,4,5,6,7,8", oldSites); - - // remove a cell - yield blockCell(1); - checkGrid("0,2,3,4,5,6,7,8,9"); - checkGrid("0,2,3,4,5,6,7,8,9", oldSites); - ok(resetButton.hasAttribute("modified"), "page is modified"); - ok(oldResetButton.hasAttribute("modified"), "page is modified"); - - // insert a new cell by dragging - yield simulateExternalDrop(1); - checkGrid("0,99p,2,3,4,5,6,7,8"); - checkGrid("0,99p,2,3,4,5,6,7,8", oldSites); - - // drag a cell around - yield simulateDrop(2, 1); - checkGrid("0,2p,99p,3,4,5,6,7,8"); - checkGrid("0,2p,99p,3,4,5,6,7,8", oldSites); - - // reset the new tab page - yield getContentWindow().gToolbar.reset(TestRunner.next); - checkGrid("0,1,2,3,4,5,6,7,8"); - checkGrid("0,1,2,3,4,5,6,7,8", oldSites); - ok(!resetButton.hasAttribute("modified"), "page is not modified"); - ok(!oldResetButton.hasAttribute("modified"), "page is not modified"); -} diff --git a/browser/components/sessionstore/test/browser_707862.js b/browser/components/sessionstore/test/browser_707862.js index db09e0d05772..5f3bf358c7c3 100644 --- a/browser/components/sessionstore/test/browser_707862.js +++ b/browser/components/sessionstore/test/browser_707862.js @@ -48,6 +48,10 @@ function test() { iframe.setAttribute("src", "about:mozilla"); }); }); + + // This test relies on the test timing out in order to indicate failure so + // let's add a dummy pass. + ok(true, "Each test requires at least one pass, fail or todo so here is a pass."); } function whenChildCount(aEntry, aChildCount, aCallback) { diff --git a/browser/components/shell/test/browser.ini b/browser/components/shell/test/browser.ini index 33f1c70e7e1f..dda258d87a90 100644 --- a/browser/components/shell/test/browser.ini +++ b/browser/components/shell/test/browser.ini @@ -2,3 +2,4 @@ [browser_420786.js] [browser_633221.js] +run-if = os == "linux" diff --git a/browser/components/tabview/test/browser_tabview_bug598375.js b/browser/components/tabview/test/browser_tabview_bug598375.js index 0005e743ff61..47af8280894b 100644 --- a/browser/components/tabview/test/browser_tabview_bug598375.js +++ b/browser/components/tabview/test/browser_tabview_bug598375.js @@ -18,4 +18,8 @@ function test() { EventUtils.synthesizeMouseAtCenter(button, {}, cw); }, cw); }); + + // This test relies on the test timing out in order to indicate failure so + // let's add a dummy pass. + ok(true, "Each test requires at least one pass, fail or todo so here is a pass."); } diff --git a/browser/devtools/commandline/test/browser.ini b/browser/devtools/commandline/test/browser.ini index 9a42d3515244..4a2d3ea1afec 100644 --- a/browser/devtools/commandline/test/browser.ini +++ b/browser/devtools/commandline/test/browser.ini @@ -90,6 +90,7 @@ skip-if = true || e10s # Disabled until TZ bug is fixed [browser_gcli_history.js] [browser_gcli_incomplete.js] [browser_gcli_inputter.js] +skip-if = true # Bug 1093205 - Test does not run in Firefox due to missing terminal bug [browser_gcli_intro.js] [browser_gcli_js.js] [browser_gcli_keyboard1.js] @@ -105,5 +106,6 @@ skip-if = true || e10s # Disabled until TZ bug is fixed [browser_gcli_split.js] [browser_gcli_tokenize.js] [browser_gcli_tooltip.js] +skip-if = true # Bug 1093205 - Test does not run in Firefox due to missing terminal [browser_gcli_types.js] [browser_gcli_union.js] diff --git a/browser/devtools/commandline/test/helpers.js b/browser/devtools/commandline/test/helpers.js index b10cc99d6896..dc33b183b934 100644 --- a/browser/devtools/commandline/test/helpers.js +++ b/browser/devtools/commandline/test/helpers.js @@ -1170,6 +1170,11 @@ helpers.audit = function(options, audits) { 'due to ' + audit.skipRemainingIf.name : ''; assert.log('Skipped ' + name + ' ' + skipReason); + + // Tests need at least one pass, fail or todo. Let's create a dummy pass + // in case there are none. + ok(true, "Each test requires at least one pass, fail or todo so here is a pass."); + return Promise.resolve(undefined); } } diff --git a/browser/devtools/framework/test/browser.ini b/browser/devtools/framework/test/browser.ini index f6356ebe63df..b3ddd6e7a210 100644 --- a/browser/devtools/framework/test/browser.ini +++ b/browser/devtools/framework/test/browser.ini @@ -39,6 +39,7 @@ skip-if = e10s # Bug 1069044 - destroyInspector may hang during shutdown [browser_toolbox_tool_remote_reopen.js] [browser_toolbox_window_reload_target.js] [browser_toolbox_window_shortcuts.js] +skip-if = os == "mac" && os_version == "10.8" || os == "win" && os_version == "5.1" # Bug 851129 - Re-enable browser_toolbox_window_shortcuts.js test after leaks are fixed [browser_toolbox_window_title_changes.js] [browser_toolbox_zoom.js] [browser_toolbox_custom_host.js] diff --git a/browser/devtools/framework/test/browser_toolbox_window_shortcuts.js b/browser/devtools/framework/test/browser_toolbox_window_shortcuts.js index 400e8f69f272..bd7248bab0bb 100644 --- a/browser/devtools/framework/test/browser_toolbox_window_shortcuts.js +++ b/browser/devtools/framework/test/browser_toolbox_window_shortcuts.js @@ -6,12 +6,6 @@ let Toolbox = devtools.Toolbox; let toolbox, toolIDs, idIndex, modifiedPrefs = []; function test() { - if (window.navigator.userAgent.indexOf("Mac OS X 10.8") != -1 || - window.navigator.userAgent.indexOf("Windows NT 5.1") != -1) { - info("Skipping Mac OSX 10.8 and Windows xp, see bug 838069"); - finish(); - return; - } addTab("about:blank").then(function() { toolIDs = []; for (let [id, definition] of gDevTools._tools) { diff --git a/browser/devtools/shadereditor/test/browser_webgl-actor-test-02.js b/browser/devtools/shadereditor/test/browser_webgl-actor-test-02.js index fb25f72f4039..836514aa4b93 100644 --- a/browser/devtools/shadereditor/test/browser_webgl-actor-test-02.js +++ b/browser/devtools/shadereditor/test/browser_webgl-actor-test-02.js @@ -13,6 +13,8 @@ function ifWebGLSupported() { ok(false, "A 'program-linked' notification shouldn't have been sent!"); }); + ok(true, "Each test requires at least one pass, fail or todo so here is a pass."); + yield reload(target); yield removeTab(target.tab); finish(); diff --git a/browser/devtools/tilt/test/browser.ini b/browser/devtools/tilt/test/browser.ini index af20a3e9e0dd..af573cb51d6d 100644 --- a/browser/devtools/tilt/test/browser.ini +++ b/browser/devtools/tilt/test/browser.ini @@ -9,6 +9,7 @@ support-files = head.js [browser_tilt_02_notifications-tabs.js] [browser_tilt_02_notifications.js] [browser_tilt_03_tab_switch.js] +skip-if = true # Bug 1093215 - Failed assertion [browser_tilt_04_initialization.js] [browser_tilt_05_destruction-esc.js] [browser_tilt_05_destruction-url.js] diff --git a/browser/devtools/tilt/test/browser_tilt_02_notifications-seq.js b/browser/devtools/tilt/test/browser_tilt_02_notifications-seq.js index f7c2133ecd80..2295213ddcd6 100644 --- a/browser/devtools/tilt/test/browser_tilt_02_notifications-seq.js +++ b/browser/devtools/tilt/test/browser_tilt_02_notifications-seq.js @@ -6,10 +6,12 @@ let tabEvents = ""; function test() { if (!isTiltEnabled()) { + aborting(); info("Skipping notifications test because Tilt isn't enabled."); return; } if (!isWebGLSupported()) { + aborting(); info("Skipping notifications test because WebGL isn't supported."); return; } @@ -29,7 +31,7 @@ function test() { info("Starting up the Tilt notifications test."); createTilt({}, false, function suddenDeath() { - info("Tilt could not be initialized properly."); + ok(false, "Tilt could not be initialized properly."); cleanup(); }); }); @@ -74,10 +76,6 @@ function obs_DESTROYED(win) { } function finalize(win) { - if (!tabEvents) { - return; - } - is(win, gBrowser.selectedBrowser.contentWindow, "Saw the correct window"); is(tabEvents, "STARTUP;INITIALIZING;INITIALIZED;DESTROYING;BEFORE_DESTROYED;DESTROYED;", "The notifications weren't fired in the correct order."); diff --git a/browser/devtools/tilt/test/browser_tilt_02_notifications-tabs.js b/browser/devtools/tilt/test/browser_tilt_02_notifications-tabs.js index 980a499c2092..6646b6a94adc 100644 --- a/browser/devtools/tilt/test/browser_tilt_02_notifications-tabs.js +++ b/browser/devtools/tilt/test/browser_tilt_02_notifications-tabs.js @@ -35,10 +35,12 @@ function after(notification, callback) { function test() { if (!isTiltEnabled()) { + aborting(); info("Skipping tab switch test because Tilt isn't enabled."); return; } if (!isWebGLSupported()) { + aborting(); info("Skipping tab switch test because WebGL isn't supported."); return; } @@ -71,7 +73,7 @@ let testSteps = [ createTilt({}, false, function suddenDeath() { - info("Tilt could not be initialized properly."); + ok(false, "Tilt could not be initialized properly."); cleanup(); }); }); @@ -87,7 +89,7 @@ let testSteps = [ createTilt({}, false, function suddenDeath() { - info("Tilt could not be initialized properly."); + ok(false, "Tilt could not be initialized properly."); cleanup(); }); }); diff --git a/browser/devtools/tilt/test/browser_tilt_02_notifications.js b/browser/devtools/tilt/test/browser_tilt_02_notifications.js index bec310371af7..6b67e1be1a18 100644 --- a/browser/devtools/tilt/test/browser_tilt_02_notifications.js +++ b/browser/devtools/tilt/test/browser_tilt_02_notifications.js @@ -8,10 +8,12 @@ let tabEvents = ""; function test() { if (!isTiltEnabled()) { + aborting(); info("Skipping notifications test because Tilt isn't enabled."); return; } if (!isWebGLSupported()) { + aborting(); info("Skipping notifications test because WebGL isn't supported."); return; } @@ -43,7 +45,7 @@ function createNewTab() { } }, false, function suddenDeath() { - info("Tilt could not be initialized properly."); + ok(false, "Tilt could not be initialized properly."); cleanup(); }); }); @@ -95,10 +97,6 @@ let testSteps = [ ]; function finalize(win) { - if (!tabEvents) { - return; - } - is(win, tab1.linkedBrowser.contentWindow, "Saw the correct window"); is(tabEvents, "STARTUP;INITIALIZING;HIDDEN;SHOWN;DESTROYING;", diff --git a/browser/devtools/tilt/test/browser_tilt_03_tab_switch.js b/browser/devtools/tilt/test/browser_tilt_03_tab_switch.js index 0ea5c886f4ec..0c54c57e4266 100644 --- a/browser/devtools/tilt/test/browser_tilt_03_tab_switch.js +++ b/browser/devtools/tilt/test/browser_tilt_03_tab_switch.js @@ -6,6 +6,10 @@ let tab0, tab1, tab2; let testStep = -1; function test() { + // This test relies on a timeout to indicate pass or fail. All tests need at + // least one pass, fail or todo so let's create a dummy pass. + ok(true, "Each test requires at least one pass, fail or todo so here is a pass."); + if (!isTiltEnabled()) { info("Skipping tab switch test because Tilt isn't enabled."); return; @@ -32,7 +36,7 @@ function createTab1() { } }, false, function suddenDeath() { - info("Tilt could not be initialized properly."); + ok(false, "Tilt could not be initialized properly."); cleanup(); }); }); @@ -49,7 +53,7 @@ function createTab2() { } }, false, function suddenDeath() { - info("Tilt could not be initialized properly."); + ok(false, "Tilt could not be initialized properly."); cleanup(); }); }); diff --git a/browser/devtools/tilt/test/browser_tilt_04_initialization.js b/browser/devtools/tilt/test/browser_tilt_04_initialization.js index 314fb22e6645..da0a936a262e 100644 --- a/browser/devtools/tilt/test/browser_tilt_04_initialization.js +++ b/browser/devtools/tilt/test/browser_tilt_04_initialization.js @@ -4,10 +4,12 @@ function test() { if (!isTiltEnabled()) { + aborting(); info("Skipping initialization test because Tilt isn't enabled."); return; } if (!isWebGLSupported()) { + aborting(); info("Skipping initialization test because WebGL isn't supported."); return; } @@ -45,7 +47,7 @@ function test() { } }, true, function suddenDeath() { - info("Tilt could not be initialized properly."); + ok(false, "Tilt could not be initialized properly."); cleanup(); }); }); diff --git a/browser/devtools/tilt/test/browser_tilt_05_destruction-esc.js b/browser/devtools/tilt/test/browser_tilt_05_destruction-esc.js index 503f7925451a..7e0fd57722be 100644 --- a/browser/devtools/tilt/test/browser_tilt_05_destruction-esc.js +++ b/browser/devtools/tilt/test/browser_tilt_05_destruction-esc.js @@ -6,10 +6,12 @@ let tiltOpened = false; function test() { if (!isTiltEnabled()) { + aborting(); info("Skipping destruction test because Tilt isn't enabled."); return; } if (!isWebGLSupported()) { + aborting(); info("Skipping destruction test because WebGL isn't supported."); return; } @@ -27,7 +29,7 @@ function test() { } }, false, function suddenDeath() { - info("Tilt could not be initialized properly."); + ok(false, "Tilt could not be initialized properly."); cleanup(); }); }); diff --git a/browser/devtools/tilt/test/browser_tilt_05_destruction-url.js b/browser/devtools/tilt/test/browser_tilt_05_destruction-url.js index 61d428218f1b..734fcda2f2b5 100644 --- a/browser/devtools/tilt/test/browser_tilt_05_destruction-url.js +++ b/browser/devtools/tilt/test/browser_tilt_05_destruction-url.js @@ -6,10 +6,12 @@ let tiltOpened = false; function test() { if (!isTiltEnabled()) { + aborting(); info("Skipping destruction test because Tilt isn't enabled."); return; } if (!isWebGLSupported()) { + aborting(); info("Skipping destruction test because WebGL isn't supported."); return; } @@ -27,7 +29,7 @@ function test() { } }, false, function suddenDeath() { - info("Tilt could not be initialized properly."); + ok(false, "Tilt could not be initialized properly."); cleanup(); }); }); diff --git a/browser/devtools/tilt/test/browser_tilt_05_destruction.js b/browser/devtools/tilt/test/browser_tilt_05_destruction.js index a083fa1bcbc1..e3f3852b4f42 100644 --- a/browser/devtools/tilt/test/browser_tilt_05_destruction.js +++ b/browser/devtools/tilt/test/browser_tilt_05_destruction.js @@ -6,10 +6,12 @@ let tiltOpened = false; function test() { if (!isTiltEnabled()) { + aborting(); info("Skipping destruction test because Tilt isn't enabled."); return; } if (!isWebGLSupported()) { + aborting(); info("Skipping destruction test because WebGL isn't supported."); return; } @@ -27,7 +29,7 @@ function test() { } }, false, function suddenDeath() { - info("Tilt could not be initialized properly."); + ok(false, "Tilt could not be initialized properly."); cleanup(); }); }); diff --git a/browser/devtools/tilt/test/browser_tilt_arcball-reset-typeahead.js b/browser/devtools/tilt/test/browser_tilt_arcball-reset-typeahead.js index 366bfa323180..a80879cd6769 100644 --- a/browser/devtools/tilt/test/browser_tilt_arcball-reset-typeahead.js +++ b/browser/devtools/tilt/test/browser_tilt_arcball-reset-typeahead.js @@ -6,10 +6,12 @@ let tiltOpened = false; function test() { if (!isTiltEnabled()) { + aborting(); info("Skipping part of the arcball test because Tilt isn't enabled."); return; } if (!isWebGLSupported()) { + aborting(); info("Skipping part of the arcball test because WebGL isn't supported."); return; } @@ -36,7 +38,7 @@ function test() { } }, false, function suddenDeath() { - info("Tilt could not be initialized properly."); + ok(false, "Tilt could not be initialized properly."); cleanup(); }); }); @@ -46,7 +48,6 @@ function performTest(canvas, arcball, callback) { is(document.activeElement, canvas, "The visualizer canvas should be focused when performing this test."); - info("Starting arcball reset test."); // start translating and rotating sometime at random diff --git a/browser/devtools/tilt/test/browser_tilt_arcball-reset.js b/browser/devtools/tilt/test/browser_tilt_arcball-reset.js index 72e11236e679..11f130fdb393 100644 --- a/browser/devtools/tilt/test/browser_tilt_arcball-reset.js +++ b/browser/devtools/tilt/test/browser_tilt_arcball-reset.js @@ -6,10 +6,12 @@ let tiltOpened = false; function test() { if (!isTiltEnabled()) { + aborting(); info("Skipping part of the arcball test because Tilt isn't enabled."); return; } if (!isWebGLSupported()) { + aborting(); info("Skipping part of the arcball test because WebGL isn't supported."); return; } @@ -34,7 +36,7 @@ function test() { } }, false, function suddenDeath() { - info("Tilt could not be initialized properly."); + ok(false, "Tilt could not be initialized properly."); cleanup(); }); }); @@ -44,7 +46,6 @@ function performTest(canvas, arcball, callback) { is(document.activeElement, canvas, "The visualizer canvas should be focused when performing this test."); - info("Starting arcball reset test."); // start translating and rotating sometime at random diff --git a/browser/devtools/tilt/test/browser_tilt_controller.js b/browser/devtools/tilt/test/browser_tilt_controller.js index 0dbf37aadeeb..d11260f140ec 100644 --- a/browser/devtools/tilt/test/browser_tilt_controller.js +++ b/browser/devtools/tilt/test/browser_tilt_controller.js @@ -4,10 +4,12 @@ function test() { if (!isTiltEnabled()) { + aborting(); info("Skipping controller test because Tilt isn't enabled."); return; } if (!isWebGLSupported()) { + aborting(); info("Skipping controller test because WebGL isn't supported."); return; } @@ -122,7 +124,7 @@ function test() { } }, true, function suddenDeath() { - info("Tilt could not be initialized properly."); + ok(false, "Tilt could not be initialized properly."); cleanup(); }); }); diff --git a/browser/devtools/tilt/test/browser_tilt_gl01.js b/browser/devtools/tilt/test/browser_tilt_gl01.js index 7f931d7a39cf..d424717261e4 100644 --- a/browser/devtools/tilt/test/browser_tilt_gl01.js +++ b/browser/devtools/tilt/test/browser_tilt_gl01.js @@ -14,6 +14,7 @@ function onWebGLSuccess() { function test() { if (!isWebGLSupported()) { + aborting(); info("Skipping tilt_gl01 because WebGL isn't supported on this hardware."); return; } @@ -24,6 +25,7 @@ function test() { let gl = renderer.context; if (!isWebGLAvailable) { + aborting(); return; } diff --git a/browser/devtools/tilt/test/browser_tilt_gl02.js b/browser/devtools/tilt/test/browser_tilt_gl02.js index a55acdd4136f..b885e3f8e404 100644 --- a/browser/devtools/tilt/test/browser_tilt_gl02.js +++ b/browser/devtools/tilt/test/browser_tilt_gl02.js @@ -14,6 +14,7 @@ function onWebGLSuccess() { function test() { if (!isWebGLSupported()) { + aborting(); info("Skipping tilt_gl02 because WebGL isn't supported on this hardware."); return; } @@ -24,6 +25,7 @@ function test() { let gl = renderer.context; if (!isWebGLAvailable) { + aborting(); return; } diff --git a/browser/devtools/tilt/test/browser_tilt_gl03.js b/browser/devtools/tilt/test/browser_tilt_gl03.js index 491f9279be8a..509eb1182036 100644 --- a/browser/devtools/tilt/test/browser_tilt_gl03.js +++ b/browser/devtools/tilt/test/browser_tilt_gl03.js @@ -14,6 +14,7 @@ function onWebGLSuccess() { function test() { if (!isWebGLSupported()) { + aborting(); info("Skipping tilt_gl03 because WebGL isn't supported on this hardware."); return; } @@ -24,6 +25,7 @@ function test() { let gl = renderer.context; if (!isWebGLAvailable) { + aborting(); return; } diff --git a/browser/devtools/tilt/test/browser_tilt_gl04.js b/browser/devtools/tilt/test/browser_tilt_gl04.js index 4ccfd472a5bf..8136c5c232bd 100644 --- a/browser/devtools/tilt/test/browser_tilt_gl04.js +++ b/browser/devtools/tilt/test/browser_tilt_gl04.js @@ -14,6 +14,7 @@ function onWebGLSuccess() { function test() { if (!isWebGLSupported()) { + aborting(); info("Skipping tilt_gl04 because WebGL isn't supported on this hardware."); return; } @@ -24,6 +25,7 @@ function test() { let gl = renderer.context; if (!isWebGLAvailable) { + aborting(); return; } diff --git a/browser/devtools/tilt/test/browser_tilt_gl05.js b/browser/devtools/tilt/test/browser_tilt_gl05.js index ffc4d1bb64c5..6432ec3e6cb7 100644 --- a/browser/devtools/tilt/test/browser_tilt_gl05.js +++ b/browser/devtools/tilt/test/browser_tilt_gl05.js @@ -14,6 +14,7 @@ function onWebGLSuccess() { function test() { if (!isWebGLSupported()) { + aborting(); info("Skipping tilt_gl05 because WebGL isn't supported on this hardware."); return; } @@ -24,6 +25,7 @@ function test() { let gl = renderer.context; if (!isWebGLAvailable) { + aborting(); return; } diff --git a/browser/devtools/tilt/test/browser_tilt_gl06.js b/browser/devtools/tilt/test/browser_tilt_gl06.js index 0f900d1b186e..7a0080eb1575 100644 --- a/browser/devtools/tilt/test/browser_tilt_gl06.js +++ b/browser/devtools/tilt/test/browser_tilt_gl06.js @@ -14,6 +14,7 @@ function onWebGLSuccess() { function test() { if (!isWebGLSupported()) { + aborting(); info("Skipping tilt_gl06 because WebGL isn't supported on this hardware."); return; } @@ -24,6 +25,7 @@ function test() { let gl = renderer.context; if (!isWebGLAvailable) { + aborting(); return; } diff --git a/browser/devtools/tilt/test/browser_tilt_gl07.js b/browser/devtools/tilt/test/browser_tilt_gl07.js index 671a4fa2cbcd..17ff9b91eb04 100644 --- a/browser/devtools/tilt/test/browser_tilt_gl07.js +++ b/browser/devtools/tilt/test/browser_tilt_gl07.js @@ -14,6 +14,7 @@ function onWebGLSuccess() { function test() { if (!isWebGLSupported()) { + aborting(); info("Skipping tilt_gl07 because WebGL isn't supported on this hardware."); return; } @@ -24,6 +25,7 @@ function test() { let gl = renderer.context; if (!isWebGLAvailable) { + aborting(); return; } diff --git a/browser/devtools/tilt/test/browser_tilt_gl08.js b/browser/devtools/tilt/test/browser_tilt_gl08.js index 10fff4932668..936de6f24947 100644 --- a/browser/devtools/tilt/test/browser_tilt_gl08.js +++ b/browser/devtools/tilt/test/browser_tilt_gl08.js @@ -14,6 +14,7 @@ function onWebGLSuccess() { function test() { if (!isWebGLSupported()) { + aborting(); info("Skipping tilt_gl08 because WebGL isn't supported on this hardware."); return; } @@ -24,6 +25,7 @@ function test() { let gl = renderer.context; if (!isWebGLAvailable) { + aborting(); return; } diff --git a/browser/devtools/tilt/test/browser_tilt_picking.js b/browser/devtools/tilt/test/browser_tilt_picking.js index c79056a3b4cf..a40f2658815d 100644 --- a/browser/devtools/tilt/test/browser_tilt_picking.js +++ b/browser/devtools/tilt/test/browser_tilt_picking.js @@ -6,10 +6,12 @@ let pickDone = false; function test() { if (!isTiltEnabled()) { + aborting(); info("Skipping picking test because Tilt isn't enabled."); return; } if (!isWebGLSupported()) { + aborting(); info("Skipping picking test because WebGL isn't supported."); return; } @@ -41,7 +43,7 @@ function test() { } }, false, function suddenDeath() { - info("Tilt could not be initialized properly."); + ok(false, "Tilt could not be initialized properly."); cleanup(); }); }); diff --git a/browser/devtools/tilt/test/browser_tilt_picking_delete.js b/browser/devtools/tilt/test/browser_tilt_picking_delete.js index c45d44b03446..bf16f31e65bc 100644 --- a/browser/devtools/tilt/test/browser_tilt_picking_delete.js +++ b/browser/devtools/tilt/test/browser_tilt_picking_delete.js @@ -7,10 +7,12 @@ let presenter; function test() { if (!isTiltEnabled()) { + aborting(); info("Skipping picking delete test because Tilt isn't enabled."); return; } if (!isWebGLSupported()) { + aborting(); info("Skipping picking delete test because WebGL isn't supported."); return; } @@ -43,7 +45,7 @@ function test() { } }, false, function suddenDeath() { - info("Tilt could not be initialized properly."); + ok(false, "Tilt could not be initialized properly."); cleanup(); }); }); diff --git a/browser/devtools/tilt/test/browser_tilt_picking_highlight01-offs.js b/browser/devtools/tilt/test/browser_tilt_picking_highlight01-offs.js index abfd4f586ffd..4f5b6f06a4b1 100644 --- a/browser/devtools/tilt/test/browser_tilt_picking_highlight01-offs.js +++ b/browser/devtools/tilt/test/browser_tilt_picking_highlight01-offs.js @@ -7,10 +7,12 @@ let presenter; function test() { if (!isTiltEnabled()) { + aborting(); info("Skipping highlight test because Tilt isn't enabled."); return; } if (!isWebGLSupported()) { + aborting(); info("Skipping highlight test because WebGL isn't supported."); return; } @@ -34,7 +36,7 @@ function test() { } }, false, function suddenDeath() { - info("Tilt could not be initialized properly."); + ok(false, "Tilt could not be initialized properly."); cleanup(); }); }); diff --git a/browser/devtools/tilt/test/browser_tilt_picking_highlight01.js b/browser/devtools/tilt/test/browser_tilt_picking_highlight01.js index 82871270ef33..8ad2c2ae419f 100644 --- a/browser/devtools/tilt/test/browser_tilt_picking_highlight01.js +++ b/browser/devtools/tilt/test/browser_tilt_picking_highlight01.js @@ -7,10 +7,12 @@ let presenter; function test() { if (!isTiltEnabled()) { + aborting(); info("Skipping highlight test because Tilt isn't enabled."); return; } if (!isWebGLSupported()) { + aborting(); info("Skipping highlight test because WebGL isn't supported."); return; } @@ -34,7 +36,7 @@ function test() { } }, false, function suddenDeath() { - info("Tilt could not be initialized properly."); + ok(false, "Tilt could not be initialized properly."); cleanup(); }); }); diff --git a/browser/devtools/tilt/test/browser_tilt_picking_highlight02.js b/browser/devtools/tilt/test/browser_tilt_picking_highlight02.js index fc8d0fc51577..b6f20121e619 100644 --- a/browser/devtools/tilt/test/browser_tilt_picking_highlight02.js +++ b/browser/devtools/tilt/test/browser_tilt_picking_highlight02.js @@ -7,10 +7,12 @@ let presenter; function test() { if (!isTiltEnabled()) { + aborting(); info("Skipping highlight test because Tilt isn't enabled."); return; } if (!isWebGLSupported()) { + aborting(); info("Skipping highlight test because WebGL isn't supported."); return; } @@ -31,7 +33,7 @@ function test() { } }, false, function suddenDeath() { - info("Tilt could not be initialized properly."); + ok(false, "Tilt could not be initialized properly."); cleanup(); }); }); diff --git a/browser/devtools/tilt/test/browser_tilt_picking_highlight03.js b/browser/devtools/tilt/test/browser_tilt_picking_highlight03.js index 721189f65c37..56e311b9a472 100644 --- a/browser/devtools/tilt/test/browser_tilt_picking_highlight03.js +++ b/browser/devtools/tilt/test/browser_tilt_picking_highlight03.js @@ -7,10 +7,12 @@ let presenter; function test() { if (!isTiltEnabled()) { + aborting(); info("Skipping highlight test because Tilt isn't enabled."); return; } if (!isWebGLSupported()) { + aborting(); info("Skipping highlight test because WebGL isn't supported."); return; } @@ -31,7 +33,7 @@ function test() { } }, false, function suddenDeath() { - info("Tilt could not be initialized properly."); + ok(false, "Tilt could not be initialized properly."); cleanup(); }); }); diff --git a/browser/devtools/tilt/test/browser_tilt_picking_inspector.js b/browser/devtools/tilt/test/browser_tilt_picking_inspector.js index 0ec302a07d13..688f3d07f0aa 100644 --- a/browser/devtools/tilt/test/browser_tilt_picking_inspector.js +++ b/browser/devtools/tilt/test/browser_tilt_picking_inspector.js @@ -6,10 +6,12 @@ let presenter; function test() { if (!isTiltEnabled()) { + aborting(); info("Skipping highlight test because Tilt isn't enabled."); return; } if (!isWebGLSupported()) { + aborting(); info("Skipping highlight test because WebGL isn't supported."); return; } @@ -33,7 +35,7 @@ function test() { } }, false, function suddenDeath() { - info("Tilt could not be initialized properly."); + ok(false, "Tilt could not be initialized properly."); cleanup(); }); }); diff --git a/browser/devtools/tilt/test/browser_tilt_picking_miv.js b/browser/devtools/tilt/test/browser_tilt_picking_miv.js index 64b911a0020a..28f01dab7015 100644 --- a/browser/devtools/tilt/test/browser_tilt_picking_miv.js +++ b/browser/devtools/tilt/test/browser_tilt_picking_miv.js @@ -7,10 +7,12 @@ let presenter; function test() { if (!isTiltEnabled()) { + aborting(); info("Skipping highlight test because Tilt isn't enabled."); return; } if (!isWebGLSupported()) { + aborting(); info("Skipping highlight test because WebGL isn't supported."); return; } @@ -34,7 +36,7 @@ function test() { } }, false, function suddenDeath() { - info("Tilt could not be initialized properly."); + ok(false, "Tilt could not be initialized properly."); cleanup(); }); }); diff --git a/browser/devtools/tilt/test/browser_tilt_visualizer.js b/browser/devtools/tilt/test/browser_tilt_visualizer.js index bc7c2bc180cf..74f906ff02b3 100644 --- a/browser/devtools/tilt/test/browser_tilt_visualizer.js +++ b/browser/devtools/tilt/test/browser_tilt_visualizer.js @@ -4,10 +4,12 @@ function test() { if (!isTiltEnabled()) { + aborting(); info("Skipping notifications test because Tilt isn't enabled."); return; } if (!isWebGLSupported()) { + aborting(); info("Skipping visualizer test because WebGL isn't supported."); return; } diff --git a/browser/devtools/tilt/test/browser_tilt_zoom.js b/browser/devtools/tilt/test/browser_tilt_zoom.js index af6ac2c91414..687eb40b1b11 100644 --- a/browser/devtools/tilt/test/browser_tilt_zoom.js +++ b/browser/devtools/tilt/test/browser_tilt_zoom.js @@ -8,10 +8,12 @@ let tiltOpened = false; function test() { if (!isTiltEnabled()) { + aborting(); info("Skipping controller test because Tilt isn't enabled."); return; } if (!isWebGLSupported()) { + aborting(); info("Skipping controller test because WebGL isn't supported."); return; } @@ -78,7 +80,7 @@ function test() { } }, false, function suddenDeath() { - info("Tilt could not be initialized properly."); + ok(false, "Tilt could not be initialized properly."); cleanup(); }); }); diff --git a/browser/devtools/tilt/test/head.js b/browser/devtools/tilt/test/head.js index 90f6b6d59be6..8d3dbf696afb 100644 --- a/browser/devtools/tilt/test/head.js +++ b/browser/devtools/tilt/test/head.js @@ -13,7 +13,6 @@ let tempScope = {}; Components.utils.import("resource://gre/modules/devtools/LayoutHelpers.jsm", tempScope); let LayoutHelpers = tempScope.LayoutHelpers; - const DEFAULT_HTML = "data:text/html," + "" + "" + @@ -208,3 +207,9 @@ function getPickablePoint(presenter) { return vec3.project(center, viewport, renderer.mvMatrix, renderer.projMatrix); } + +function aborting() { + // Tilt aborting and we need at least one pass, fail or todo so let's add a + // dummy pass. + ok(true, "Test aborted early."); +} diff --git a/browser/devtools/webaudioeditor/test/browser_audionode-actor-get-param-flags.js b/browser/devtools/webaudioeditor/test/browser_audionode-actor-get-param-flags.js index a71e6d2a2c6c..e60a697e9e3d 100644 --- a/browser/devtools/webaudioeditor/test/browser_audionode-actor-get-param-flags.js +++ b/browser/devtools/webaudioeditor/test/browser_audionode-actor-get-param-flags.js @@ -20,12 +20,15 @@ function spawnTest () { "ChannelSplitterNode", "ChannelMergerNode", "DynamicsCompressorNode", "OscillatorNode" ]; - nodeTypes.forEach(function (type, i) { + // For some reason nodeTypes.forEach and params.forEach fail here so we use + // simple for loops. + for (let i = 0; i < nodeTypes.length; i++) { + let type = nodeTypes[i]; let params = allNodeParams[i]; - params.forEach(function ({param, value, flags}) { - let testFlags = yield nodes[i].getParamFlag(param); - ok(typeof testFlags === "object", type + " has flags from #getParamFlag(" + param + ")"); + for (let {param, value, flags} of params) { + let testFlags = yield nodes[i].getParamFlags(param); + ok(typeof testFlags === "object", type + " has flags from #getParamFlags(" + param + ")"); if (param === "buffer") { is(flags.Buffer, true, "`buffer` params have Buffer flag"); @@ -38,8 +41,8 @@ function spawnTest () { } else { is(Object.keys(flags), 0, type + "-" + param + " has no flags set") } - }); - }); + } + } yield removeTab(target.tab); finish(); diff --git a/dom/indexedDB/test/browser_bug839193.js b/dom/indexedDB/test/browser_bug839193.js index 94872434b304..3e982d7d6331 100644 --- a/dom/indexedDB/test/browser_bug839193.js +++ b/dom/indexedDB/test/browser_bug839193.js @@ -29,6 +29,11 @@ function onUnload() { // will be apparent by the checks the harness performs. function test() { waitForExplicitFinish(); + + // This test relies on the test timing out in order to indicate failure so + // let's add a dummy pass. + ok(true, "Each test requires at least one pass, fail or todo so here is a pass."); + Services.obs.addObserver(onLoad, "bug839193-loaded", false); Services.obs.addObserver(onUnload, "bug839193-unloaded", false); diff --git a/image/test/browser/browser.ini b/image/test/browser/browser.ini index a825a8c734b4..46f56acdb242 100644 --- a/image/test/browser/browser.ini +++ b/image/test/browser/browser.ini @@ -10,4 +10,4 @@ support-files = [browser_bug666317.js] skip-if = e10s # Bug 948194 - Decoded Images seem to not be discarded on memory-pressure notification with e10s enabled [browser_image.js] -skip-if = e10s +skip-if = e10s || !debug # Test is only to run on debug builds diff --git a/security/manager/ssl/tests/mochitest/browser/browser_certificateManagerLeak.js b/security/manager/ssl/tests/mochitest/browser/browser_certificateManagerLeak.js index f1bcfb4df370..3c751037ae6b 100644 --- a/security/manager/ssl/tests/mochitest/browser/browser_certificateManagerLeak.js +++ b/security/manager/ssl/tests/mochitest/browser/browser_certificateManagerLeak.js @@ -21,6 +21,11 @@ function onUnload() { // there are no actual checks here. function test() { waitForExplicitFinish(); + + // This test relies on the test timing out in order to indicate failure so + // let's add a dummy pass. + ok(true, "Each test requires at least one pass, fail or todo so here is a pass."); + gBugWindow = window.openDialog("chrome://pippki/content/certManager.xul"); gBugWindow.addEventListener("load", onLoad); } diff --git a/testing/mochitest/browser-test.js b/testing/mochitest/browser-test.js index 9c8e21b31c0f..e051afb77ec9 100644 --- a/testing/mochitest/browser-test.js +++ b/testing/mochitest/browser-test.js @@ -354,7 +354,13 @@ Tester.prototype = { catch (ex) { this.currentTest.addResult(new testResult(false, "Cleanup function threw an exception", ex, false)); } - }; + } + + if (this.currentTest.passCount === 0 && + this.currentTest.failCount === 0 && + this.currentTest.todoCount === 0) { + this.currentTest.addResult(new testResult(false, "This test contains no passes, no fails and no todos. Maybe it threw a silent exception? Make sure you use waitForExplicitFinish() if you need it.", "", false)); + } if (testScope.__expected == 'fail' && testScope.__num_failed <= 0) { this.currentTest.addResult(new testResult(false, "We expected at least one assertion to fail because this test file was marked as fail-if in the manifest", "", false)); diff --git a/toolkit/mozapps/extensions/test/browser/browser-common.ini b/toolkit/mozapps/extensions/test/browser/browser-common.ini index cc3b694bf1a2..598ddfba95ba 100644 --- a/toolkit/mozapps/extensions/test/browser/browser-common.ini +++ b/toolkit/mozapps/extensions/test/browser/browser-common.ini @@ -25,6 +25,7 @@ skip-if = e10s # Bug ?????? - EventUtils.synthesizeKey not e10s friendly [browser_bug591465.js] [browser_bug591663.js] [browser_bug593535.js] +skip-if = true # Bug 1093190 - Disabled due to leak [browser_bug596336.js] [browser_bug608316.js] [browser_bug610764.js] diff --git a/toolkit/mozapps/extensions/test/browser/browser_bug593535.js b/toolkit/mozapps/extensions/test/browser/browser_bug593535.js index d2cf52231d0c..a78ef9a23d12 100644 --- a/toolkit/mozapps/extensions/test/browser/browser_bug593535.js +++ b/toolkit/mozapps/extensions/test/browser/browser_bug593535.js @@ -12,7 +12,6 @@ const QUERY = "NOTFOUND"; var gProvider; function test() { - return; waitForExplicitFinish(); // Turn on searching for this test