Package net.sourceforge.htmlunit.corejs.javascript

Examples of net.sourceforge.htmlunit.corejs.javascript.NativeArray


        TestsResult result = new TestsResult();

        executeTimer();

        ScriptResult scriptResult = page.executeJavaScript("window.simulationContext.results");
        NativeArray array = (NativeArray) scriptResult.getJavaScriptResult();

        for (int i = 0; i < array.getLength(); i++) {
            NativeObject object = (NativeObject) array.get(i, array);
            String data = null;
            Object dataObject = object.get("data", object);

            if (!(dataObject instanceof Undefined)) {
                data = (String) dataObject;
View Full Code Here


                       } catch (RhinoException rex) {
                           ToolErrorReporter.reportException(
                               cx.getErrorReporter(), rex);
                       }
                   }
                   NativeArray h = global.history;
                   h.put((int)h.getLength(), h, source);
               }
           }
           ps.println();
       } else {
           processFile(cx, global, filename);
View Full Code Here

      }
      return ((Number) value).longValue();
    }
   
    if (value instanceof NativeArray) {
      final NativeArray array = (NativeArray)value;
     
      JavaScriptResultsCollection collection = new JavaScriptResultsCollection() {
        public int getLength() { return (int) array.getLength(); }
        public Object item(int index) { return array.get(index);
      };
     
      return parseJavascriptResultsList(collection);
    }

    if (value instanceof HTMLCollection) {
      final HTMLCollection array = (HTMLCollection) value;

      JavaScriptResultsCollection collection = new JavaScriptResultsCollection() {
        public int getLength() { return array.getLength(); }
        public Object item(int index) { return array.get(index);
      };

      return parseJavascriptResultsList(collection);
    }
   
View Full Code Here

                        } catch (RhinoException rex) {
                            ToolErrorReporter.reportException(
                                cx.getErrorReporter(), rex);
                        }
                    }
                    NativeArray h = global.history;
                    h.put((int)h.getLength(), h, source);
                }
            }
            ps.println();
        } else {
            processFile(cx, global, filename);
View Full Code Here

     * Retrieves a collection of rectangles that describes the layout of the contents of an object
     * or range within the client. Each rectangle describes a single line.
     * @return a collection of rectangles that describes the layout of the contents
     */
    public Object jsxFunction_getClientRects() {
        return new NativeArray(0);
    }
View Full Code Here

        TestsResult result = new TestsResult();

        executeTimer();

        ScriptResult scriptResult = page.executeJavaScript("window.simulationContext.results");
        NativeArray array = (NativeArray) scriptResult.getJavaScriptResult();

        for (int i = 0; i < array.getLength(); i++) {
            NativeObject object = (NativeObject) array.get(i, array);
            String data = null;
            Object dataObject = object.get("data", object);

            if (!(dataObject instanceof Undefined)) {
                data = (String) dataObject;
View Full Code Here

     * @param js
     */
    private void assertArray(Object java, Object js) {
        assert js instanceof NativeArray;

        NativeArray array = (NativeArray) js;

        // check array size
        assert Array.getLength(java) == array.getLength();

        // check each items
        for (int i = 0; i < array.getLength(); i++) {
            assertObject(Array.get(java, i), array.get(i, null));
        }
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.htmlunit.corejs.javascript.NativeArray

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.