From 0580ebab8c8c363c0ab5235d3fdbf70197f3efda Mon Sep 17 00:00:00 2001 From: "gears.daemon" Date: Sat, 19 Jan 2008 02:01:23 +0000 Subject: [PATCH] [Author: ace] Adding checks inside internal tests to bypass debug-only logic for non-debug gears versions. Has the side effect that these tests will appear to pass for release builds that are not actually run. R=aa CC=gears-internal DELTA=24 (13 added, 7 deleted, 4 changed) OCL=6266384 SCL=6276978 git-svn-id: https://google-gears.googlecode.com/svn/trunk@708 fe895e04-df30-0410-9975-d76d301b4276 --- gears/test/testcases/internal_tests.js | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/gears/test/testcases/internal_tests.js b/gears/test/testcases/internal_tests.js index fd535e6..61662a6 100644 --- a/gears/test/testcases/internal_tests.js +++ b/gears/test/testcases/internal_tests.js @@ -23,17 +23,20 @@ // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -if (isDebug) { - var internalTests = google.gears.factory.create('beta.test'); - function testInternal() { +function testInternal() { + if (isDebug) { + var internalTests = google.gears.factory.create('beta.test'); assert(internalTests.RunTests(), 'Internal tests failed.'); } +} - // TODO(aa): Remove check when JsCallContext is implemented for Firefox. - if (typeof internalTests.testParamTypes != "undefined") { - function testParamTypes() { +function testParamTypes() { + if (isDebug) { + var internalTests = google.gears.factory.create('beta.test'); + // TODO(aa): Remove check when JsCallContext is implemented for Firefox. + if (typeof internalTests.testParamTypes != "undefined") { internalTests.testParamTypes(true, 42, 88.8, {}, "foo"); // We actually want to test that we got the right error message so that @@ -47,10 +50,13 @@ if (isDebug) { internalTests.testParamTypes(true, 42, 88.8, {}); }, 'Required argument 5 is missing.'); } + } +} - function testProperty() { - internalTests.testPropertyInt = 42; - assertEqual(42, internalTests.testPropertyInt); - } +function testProperty() { + if (isDebug) { + var internalTests = google.gears.factory.create('beta.test'); + internalTests.testPropertyInt = 42; + assertEqual(42, internalTests.testPropertyInt); } } -- 2.11.4.GIT