gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/trunk r11328: Test Keyboard class.


From: Benjamin Wolsey
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r11328: Test Keyboard class.
Date: Wed, 29 Jul 2009 15:41:03 +0200
User-agent: Bazaar (1.13.1)

------------------------------------------------------------
revno: 11328
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Wed 2009-07-29 15:41:03 +0200
message:
  Test Keyboard class.
added:
  testsuite/as3compile.all/Keyboard.as
modified:
  testsuite/as3compile.all/Makefile.am
    ------------------------------------------------------------
    revno: 11327.1.1
    committer: Benjamin Wolsey <address@hidden>
    branch nick: temp
    timestamp: Wed 2009-07-29 14:24:39 +0200
    message:
      Reduce code duplication, clean up, use ObjectURI more.
    modified:
      libcore/as_object.cpp
      libcore/as_object.h
    ------------------------------------------------------------
    revno: 11327.1.2
    committer: Benjamin Wolsey <address@hidden>
    branch nick: temp
    timestamp: Wed 2009-07-29 15:10:52 +0200
    message:
      Register more classes correctly. Use the string table for now, rather than
      adding everything to it.
    modified:
      libcore/asobj/Globals.cpp
    ------------------------------------------------------------
    revno: 11327.1.3
    committer: Benjamin Wolsey <address@hidden>
    branch nick: temp
    timestamp: Wed 2009-07-29 15:11:39 +0200
    message:
      Construct AVM2Global at a more opportune time.
    modified:
      libcore/vm/Machine.cpp
    ------------------------------------------------------------
    revno: 11327.1.4
    committer: Benjamin Wolsey <address@hidden>
    branch nick: temp
    timestamp: Wed 2009-07-29 15:11:54 +0200
    message:
      Use ObjectURI more.
    modified:
      libcore/PropertyList.cpp
      libcore/PropertyList.h
      libcore/asClass.cpp
      libcore/as_object.cpp
      libcore/as_object.h
=== added file 'testsuite/as3compile.all/Keyboard.as'
--- a/testsuite/as3compile.all/Keyboard.as      1970-01-01 00:00:00 +0000
+++ b/testsuite/as3compile.all/Keyboard.as      2009-07-29 13:41:03 +0000
@@ -0,0 +1,53 @@
+//
+//   Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+#include "check.as"
+
+package main {
+
+    import flash.display.MovieClip;
+    import flash.ui.Keyboard;
+
+    public class Main extends MovieClip {
+
+        DEJAGNU_OBJ;
+
+        public function Main() {
+
+            // Keyboard cannot be instantiated; it throws ArgumentError #2102
+            xcheck_equals(Keyboard.prototype, "[object Object]");
+            xcheck_equals(Keyboard.constructor, "[class Class]");
+            xcheck(Keyboard.hasOwnProperty("capsLock"));
+            xcheck(Keyboard.hasOwnProperty("numLock"));
+            xcheck(Keyboard.hasOwnProperty("isAccessible"));
+
+            // TODO: lots more
+            xcheck(Keyboard.hasOwnProperty("BACKSPACE"));
+            xcheck(Keyboard.hasOwnProperty("CAPS_LOCK"));
+
+            // These are in AIR, but not flash.
+            check(!Keyboard.hasOwnProperty("A"));
+            check(!Keyboard.hasOwnProperty("B"));
+            check(!Keyboard.hasOwnProperty("C"));
+            check(!Keyboard.hasOwnProperty("D"));
+            
+            totals(11);
+            done();
+        }
+    }
+}
+         

=== modified file 'testsuite/as3compile.all/Makefile.am'
--- a/testsuite/as3compile.all/Makefile.am      2009-07-02 09:23:08 +0000
+++ b/testsuite/as3compile.all/Makefile.am      2009-07-29 13:41:03 +0000
@@ -28,6 +28,7 @@
        Sprite.as \
        QName.as \
        System.as \
+       Keyboard.as \
        $(NULL)
 
 BOGUS_AS3TESTS = \


reply via email to

[Prev in Thread] Current Thread [Next in Thread]