| 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
| 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
| 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 5 | |
| 6 | gTestfile = 'null-001.js'; |
| 7 | |
| 8 | /** |
| 9 | File Name: null-001.js |
| 10 | Description: |
| 11 | |
| 12 | When accessing a Java field whose value is null, JavaScript should read |
| 13 | the value as the JavaScript null object. |
| 14 | |
| 15 | To test this: |
| 16 | |
| 17 | 1. Call a java method that returns the Java null value |
| 18 | 2. Check the value of the returned object, which should be null |
| 19 | 3. Check the type of the returned object, which should be "object" |
| 20 | |
| 21 | @author [email protected] |
| 22 | @version 1.00 |
| 23 | */ |
| 24 | var SECTION = "LiveConnect"; |
| 25 | var VERSION = "1_3"; |
| 26 | var TITLE = "Java null to JavaScript Object"; |
| 27 | |
| 28 | startTest(); |
| 29 | writeHeaderToLog( SECTION + " "+ TITLE); |
| 30 | // display test information |
| 31 | |
| 32 | var hashMap = new java.util.HashMap(); |
| 33 | |
| 34 | new TestCase( |
| 35 | SECTION, |
| 36 | "var hashMap = new java.util.HashMap(); hashMap.get('unknown');", |
| 37 | null, |
| 38 | hashMap.get("unknown") ); |
| 39 | |
| 40 | new TestCase( |
| 41 | SECTION, |
| 42 | "typeof hashMap.get('unknown')", |
| 43 | "object", |
| 44 | typeof hashMap.get('unknown') ); |
| 45 | |
| 46 | |
| 47 | |
| 48 | test(); |
| 49 | |
| 50 | function CheckType( et, at ) { |
| 51 | } |
| 52 | function CheckValue( ev, av ) { |
| 53 | } |