michael@0: // -*- Mode: js2; tab-width: 2; indent-tabs-mode: nil; js2-basic-offset: 2; js2-skip-preprocessor-directives: t; -*- michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: Components.utils.import("resource://gre/modules/ctypes.jsm"); michael@0: Components.utils.import("resource://gre/modules/JNI.jsm"); michael@0: michael@0: add_task(function test_JNI() { michael@0: let iconSize = -1; michael@0: michael@0: let jni = null; michael@0: try { michael@0: jni = new JNI(); michael@0: let cls = jni.findClass("org/mozilla/gecko/GeckoAppShell"); michael@0: let method = jni.getStaticMethodID(cls, "getPreferredIconSize", "()I"); michael@0: iconSize = jni.callStaticIntMethod(cls, method); michael@0: } finally { michael@0: if (jni != null) { michael@0: jni.close(); michael@0: } michael@0: } michael@0: michael@0: do_check_neq(iconSize, -1); michael@0: }); michael@0: michael@0: run_next_test();