closure 1.1.692
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +6 -0
- data/.yardopts +3 -0
- data/LICENSE +202 -0
- data/README.md +26 -0
- data/beanshell/LICENSE +12 -0
- data/beanshell/bsh-core-2.0b4.jar +0 -0
- data/closure-compiler/COPYING +202 -0
- data/closure-compiler/README +278 -0
- data/closure-compiler/compiler.jar +0 -0
- data/closure-library/AUTHORS +12 -0
- data/closure-library/LICENSE +176 -0
- data/closure-library/README +6 -0
- data/closure-library/all_tests.html +113 -0
- data/closure-library/alltests.js +16 -0
- data/closure-library/closure/bin/build/closurebuilder.py +257 -0
- data/closure-library/closure/bin/build/depstree.py +186 -0
- data/closure-library/closure/bin/build/depstree_test.py +127 -0
- data/closure-library/closure/bin/build/depswriter.py +197 -0
- data/closure-library/closure/bin/build/jscompiler.py +69 -0
- data/closure-library/closure/bin/build/source.py +86 -0
- data/closure-library/closure/bin/build/source_test.py +57 -0
- data/closure-library/closure/bin/build/treescan.py +78 -0
- data/closure-library/closure/bin/calcdeps.py +570 -0
- data/closure-library/closure/bin/scopify.py +211 -0
- data/closure-library/closure/css/inlay/g-base.css +82 -0
- data/closure-library/closure/css/inlay/g-fixed.css +158 -0
- data/closure-library/closure/css/inlay/g-ratio.css +253 -0
- data/closure-library/closure/goog/array/array.js +1300 -0
- data/closure-library/closure/goog/array/array_test.html +1524 -0
- data/closure-library/closure/goog/asserts/asserts.js +277 -0
- data/closure-library/closure/goog/asserts/asserts_test.html +163 -0
- data/closure-library/closure/goog/async/conditionaldelay.js +238 -0
- data/closure-library/closure/goog/async/conditionaldelay_test.html +227 -0
- data/closure-library/closure/goog/async/delay.js +174 -0
- data/closure-library/closure/goog/async/delay_test.html +148 -0
- data/closure-library/closure/goog/async/throttle.js +189 -0
- data/closure-library/closure/goog/async/throttle_test.html +102 -0
- data/closure-library/closure/goog/base.js +1471 -0
- data/closure-library/closure/goog/base_test.html +1166 -0
- data/closure-library/closure/goog/bootstrap/webworkers.js +37 -0
- data/closure-library/closure/goog/color/alpha.js +436 -0
- data/closure-library/closure/goog/color/alpha_test.html +234 -0
- data/closure-library/closure/goog/color/color.js +757 -0
- data/closure-library/closure/goog/color/color_test.html +645 -0
- data/closure-library/closure/goog/color/names.js +176 -0
- data/closure-library/closure/goog/crypt/arc4.js +141 -0
- data/closure-library/closure/goog/crypt/arc4_test.html +42 -0
- data/closure-library/closure/goog/crypt/base64.js +267 -0
- data/closure-library/closure/goog/crypt/base64_test.html +106 -0
- data/closure-library/closure/goog/crypt/basen.js +242 -0
- data/closure-library/closure/goog/crypt/basen_test.html +167 -0
- data/closure-library/closure/goog/crypt/crypt.js +103 -0
- data/closure-library/closure/goog/crypt/crypt_test.html +68 -0
- data/closure-library/closure/goog/crypt/hash32.js +184 -0
- data/closure-library/closure/goog/crypt/hash32_test.html +287 -0
- data/closure-library/closure/goog/crypt/sha1.js +238 -0
- data/closure-library/closure/goog/crypt/sha1_test.html +47 -0
- data/closure-library/closure/goog/css/autocomplete.css +43 -0
- data/closure-library/closure/goog/css/bubble.css +84 -0
- data/closure-library/closure/goog/css/button.css +38 -0
- data/closure-library/closure/goog/css/charpicker.css +201 -0
- data/closure-library/closure/goog/css/checkbox.css +38 -0
- data/closure-library/closure/goog/css/colormenubutton.css +25 -0
- data/closure-library/closure/goog/css/colorpalette.css +54 -0
- data/closure-library/closure/goog/css/colorpicker-simplegrid.css +50 -0
- data/closure-library/closure/goog/css/combobox.css +57 -0
- data/closure-library/closure/goog/css/common.css +41 -0
- data/closure-library/closure/goog/css/css3button.css +77 -0
- data/closure-library/closure/goog/css/css3menubutton.css +23 -0
- data/closure-library/closure/goog/css/custombutton.css +164 -0
- data/closure-library/closure/goog/css/datepicker.css +148 -0
- data/closure-library/closure/goog/css/dialog.css +72 -0
- data/closure-library/closure/goog/css/dimensionpicker.css +47 -0
- data/closure-library/closure/goog/css/dragdropdetector.css +48 -0
- data/closure-library/closure/goog/css/editor/bubble.css +73 -0
- data/closure-library/closure/goog/css/editor/dialog.css +66 -0
- data/closure-library/closure/goog/css/editor/linkdialog.css +36 -0
- data/closure-library/closure/goog/css/editortoolbar.css +225 -0
- data/closure-library/closure/goog/css/filteredmenu.css +30 -0
- data/closure-library/closure/goog/css/filterobservingmenuitem.css +25 -0
- data/closure-library/closure/goog/css/flatbutton.css +65 -0
- data/closure-library/closure/goog/css/flatmenubutton.css +63 -0
- data/closure-library/closure/goog/css/hovercard.css +51 -0
- data/closure-library/closure/goog/css/hsvapalette.css +231 -0
- data/closure-library/closure/goog/css/hsvpalette.css +179 -0
- data/closure-library/closure/goog/css/imagelessbutton.css +160 -0
- data/closure-library/closure/goog/css/imagelessmenubutton.css +23 -0
- data/closure-library/closure/goog/css/inputdatepicker.css +12 -0
- data/closure-library/closure/goog/css/linkbutton.css +26 -0
- data/closure-library/closure/goog/css/menu.css +27 -0
- data/closure-library/closure/goog/css/menubutton.css +169 -0
- data/closure-library/closure/goog/css/menuitem.css +96 -0
- data/closure-library/closure/goog/css/menuseparator.css +19 -0
- data/closure-library/closure/goog/css/multitestrunner.css +121 -0
- data/closure-library/closure/goog/css/offline.css +147 -0
- data/closure-library/closure/goog/css/palette.css +36 -0
- data/closure-library/closure/goog/css/popupdatepicker.css +17 -0
- data/closure-library/closure/goog/css/roundedpanel.css +29 -0
- data/closure-library/closure/goog/css/roundedtab.css +158 -0
- data/closure-library/closure/goog/css/submenu.css +28 -0
- data/closure-library/closure/goog/css/tab.css +91 -0
- data/closure-library/closure/goog/css/tabbar.css +52 -0
- data/closure-library/closure/goog/css/tablesorter.css +14 -0
- data/closure-library/closure/goog/css/toolbar.css +400 -0
- data/closure-library/closure/goog/css/tooltip.css +14 -0
- data/closure-library/closure/goog/css/tree.css +147 -0
- data/closure-library/closure/goog/css/tristatemenuitem.css +43 -0
- data/closure-library/closure/goog/cssom/cssom.js +447 -0
- data/closure-library/closure/goog/cssom/cssom_test.html +343 -0
- data/closure-library/closure/goog/cssom/cssom_test_import_1.css +11 -0
- data/closure-library/closure/goog/cssom/cssom_test_import_2.css +10 -0
- data/closure-library/closure/goog/cssom/cssom_test_link_1.css +10 -0
- data/closure-library/closure/goog/cssom/iframe/style.js +1020 -0
- data/closure-library/closure/goog/cssom/iframe/style_test.html +391 -0
- data/closure-library/closure/goog/cssom/iframe/style_test_import.css +10 -0
- data/closure-library/closure/goog/datasource/datamanager.js +566 -0
- data/closure-library/closure/goog/datasource/datasource.js +646 -0
- data/closure-library/closure/goog/datasource/datasource_test.html +265 -0
- data/closure-library/closure/goog/datasource/expr.js +544 -0
- data/closure-library/closure/goog/datasource/expr_test.html +97 -0
- data/closure-library/closure/goog/datasource/fastdatanode.js +792 -0
- data/closure-library/closure/goog/datasource/fastdatanode_test.html +254 -0
- data/closure-library/closure/goog/datasource/jsdatasource.js +460 -0
- data/closure-library/closure/goog/datasource/jsondatasource.js +146 -0
- data/closure-library/closure/goog/datasource/jsxmlhttpdatasource.js +191 -0
- data/closure-library/closure/goog/datasource/jsxmlhttpdatasource_test.html +94 -0
- data/closure-library/closure/goog/datasource/xmldatasource.js +407 -0
- data/closure-library/closure/goog/date/date.js +1642 -0
- data/closure-library/closure/goog/date/date_test.html +1293 -0
- data/closure-library/closure/goog/date/datelike.js +27 -0
- data/closure-library/closure/goog/date/daterange.js +398 -0
- data/closure-library/closure/goog/date/daterange_test.html +213 -0
- data/closure-library/closure/goog/date/relative.js +425 -0
- data/closure-library/closure/goog/date/relative_test.html +124 -0
- data/closure-library/closure/goog/date/utcdatetime.js +178 -0
- data/closure-library/closure/goog/date/utcdatetime_test.html +119 -0
- data/closure-library/closure/goog/debug/console.js +138 -0
- data/closure-library/closure/goog/debug/debug.js +452 -0
- data/closure-library/closure/goog/debug/debug_test.html +32 -0
- data/closure-library/closure/goog/debug/debugwindow.js +582 -0
- data/closure-library/closure/goog/debug/devcss/devcss.js +435 -0
- data/closure-library/closure/goog/debug/devcss/devcss_test.html +365 -0
- data/closure-library/closure/goog/debug/devcss/devcssrunner.js +26 -0
- data/closure-library/closure/goog/debug/divconsole.js +141 -0
- data/closure-library/closure/goog/debug/enhanceerror_test.html +138 -0
- data/closure-library/closure/goog/debug/entrypointregistry.js +111 -0
- data/closure-library/closure/goog/debug/entrypointregistry_test.html +63 -0
- data/closure-library/closure/goog/debug/error.js +47 -0
- data/closure-library/closure/goog/debug/error_test.html +85 -0
- data/closure-library/closure/goog/debug/errorhandler.js +234 -0
- data/closure-library/closure/goog/debug/errorhandler_async_test.html +112 -0
- data/closure-library/closure/goog/debug/errorhandler_test.html +186 -0
- data/closure-library/closure/goog/debug/errorhandlerweakdep.js +38 -0
- data/closure-library/closure/goog/debug/errorreporter.js +324 -0
- data/closure-library/closure/goog/debug/errorreporter_test.html +289 -0
- data/closure-library/closure/goog/debug/fancywindow.js +265 -0
- data/closure-library/closure/goog/debug/formatter.js +314 -0
- data/closure-library/closure/goog/debug/gcdiagnostics.js +143 -0
- data/closure-library/closure/goog/debug/logbuffer.js +147 -0
- data/closure-library/closure/goog/debug/logbuffer_test.html +105 -0
- data/closure-library/closure/goog/debug/logger.js +809 -0
- data/closure-library/closure/goog/debug/logger_test.html +208 -0
- data/closure-library/closure/goog/debug/logrecord.js +271 -0
- data/closure-library/closure/goog/debug/reflect.js +159 -0
- data/closure-library/closure/goog/debug/reflect_test.html +81 -0
- data/closure-library/closure/goog/debug/relativetimeprovider.js +83 -0
- data/closure-library/closure/goog/debug/tracer.js +750 -0
- data/closure-library/closure/goog/debug/tracer_test.html +57 -0
- data/closure-library/closure/goog/demos/advancedtooltip.html +78 -0
- data/closure-library/closure/goog/demos/animationqueue.html +149 -0
- data/closure-library/closure/goog/demos/autocomplete-basic.html +56 -0
- data/closure-library/closure/goog/demos/autocompleteremote.html +40 -0
- data/closure-library/closure/goog/demos/autocompleteremotedata.js +18 -0
- data/closure-library/closure/goog/demos/autocompleterichremote.html +137 -0
- data/closure-library/closure/goog/demos/autocompleterichremotedata.js +33 -0
- data/closure-library/closure/goog/demos/bidiinput.html +72 -0
- data/closure-library/closure/goog/demos/bubble.html +250 -0
- data/closure-library/closure/goog/demos/button.html +395 -0
- data/closure-library/closure/goog/demos/charcounter.html +57 -0
- data/closure-library/closure/goog/demos/charpicker.html +64 -0
- data/closure-library/closure/goog/demos/checkbox.html +122 -0
- data/closure-library/closure/goog/demos/color-contrast.html +60 -0
- data/closure-library/closure/goog/demos/colormenubutton.html +213 -0
- data/closure-library/closure/goog/demos/colorpicker.html +43 -0
- data/closure-library/closure/goog/demos/combobox.html +125 -0
- data/closure-library/closure/goog/demos/container.html +670 -0
- data/closure-library/closure/goog/demos/control.html +477 -0
- data/closure-library/closure/goog/demos/css/demo.css +75 -0
- data/closure-library/closure/goog/demos/css/emojipicker.css +36 -0
- data/closure-library/closure/goog/demos/css/emojisprite.css +92 -0
- data/closure-library/closure/goog/demos/css3button.html +166 -0
- data/closure-library/closure/goog/demos/css3menubutton.html +285 -0
- data/closure-library/closure/goog/demos/cssspriteanimation.html +80 -0
- data/closure-library/closure/goog/demos/datepicker.html +183 -0
- data/closure-library/closure/goog/demos/debug.html +119 -0
- data/closure-library/closure/goog/demos/depsgraph.html +221 -0
- data/closure-library/closure/goog/demos/dialog.html +156 -0
- data/closure-library/closure/goog/demos/dimensionpicker.html +108 -0
- data/closure-library/closure/goog/demos/dimensionpicker_rtl.html +123 -0
- data/closure-library/closure/goog/demos/dom_selection.html +88 -0
- data/closure-library/closure/goog/demos/drag.html +191 -0
- data/closure-library/closure/goog/demos/dragdrop.html +263 -0
- data/closure-library/closure/goog/demos/dragdropdetector.html +46 -0
- data/closure-library/closure/goog/demos/dragdropdetector_target.html +17 -0
- data/closure-library/closure/goog/demos/dragger.html +83 -0
- data/closure-library/closure/goog/demos/draglistgroup.html +261 -0
- data/closure-library/closure/goog/demos/drilldownrow.html +78 -0
- data/closure-library/closure/goog/demos/editor/deps.js +20 -0
- data/closure-library/closure/goog/demos/editor/editor.html +139 -0
- data/closure-library/closure/goog/demos/editor/field_basic.html +74 -0
- data/closure-library/closure/goog/demos/editor/helloworld.html +91 -0
- data/closure-library/closure/goog/demos/editor/helloworld.js +81 -0
- data/closure-library/closure/goog/demos/editor/helloworld_test.html +75 -0
- data/closure-library/closure/goog/demos/editor/helloworlddialog.js +163 -0
- data/closure-library/closure/goog/demos/editor/helloworlddialog_test.html +100 -0
- data/closure-library/closure/goog/demos/editor/helloworlddialogplugin.js +110 -0
- data/closure-library/closure/goog/demos/editor/helloworlddialogplugin_test.html +198 -0
- data/closure-library/closure/goog/demos/editor/seamlessfield.html +106 -0
- data/closure-library/closure/goog/demos/effects.html +142 -0
- data/closure-library/closure/goog/demos/emoji/200.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/201.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/202.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/203.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/204.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/205.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/206.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2BC.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2BD.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2BE.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2BF.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2C0.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2C1.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2C2.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2C3.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2C4.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2C5.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2C6.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2C7.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2C8.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2C9.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2CA.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2CB.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2CC.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2CD.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2CE.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2CF.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2D0.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2D1.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2D2.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2D3.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2D4.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2D5.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2D6.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2D7.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2D8.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2D9.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2DA.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2DB.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2DC.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2DD.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2DE.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2DF.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2E0.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2E1.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2E2.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2E3.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2E4.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2E5.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2E6.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2E7.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2E8.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2E9.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2EA.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2EB.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2EC.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2ED.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2EE.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2EF.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2F0.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2F1.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2F2.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2F3.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2F4.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2F5.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2F6.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2F7.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2F8.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2F9.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2FA.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2FB.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2FC.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2FD.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2FE.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2FF.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/none.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/sprite.png +0 -0
- data/closure-library/closure/goog/demos/emoji/sprite2.png +0 -0
- data/closure-library/closure/goog/demos/emoji/unknown.gif +0 -0
- data/closure-library/closure/goog/demos/event-propagation.html +192 -0
- data/closure-library/closure/goog/demos/events.html +99 -0
- data/closure-library/closure/goog/demos/eventtarget.html +70 -0
- data/closure-library/closure/goog/demos/filedrophandler.html +63 -0
- data/closure-library/closure/goog/demos/filteredmenu.html +118 -0
- data/closure-library/closure/goog/demos/focushandler.html +58 -0
- data/closure-library/closure/goog/demos/gauge.html +158 -0
- data/closure-library/closure/goog/demos/graphics/advancedcoordinates.html +141 -0
- data/closure-library/closure/goog/demos/graphics/advancedcoordinates2.html +130 -0
- data/closure-library/closure/goog/demos/graphics/basicelements.html +264 -0
- data/closure-library/closure/goog/demos/graphics/events.html +113 -0
- data/closure-library/closure/goog/demos/graphics/modifyelements.html +195 -0
- data/closure-library/closure/goog/demos/graphics/subpixel.html +80 -0
- data/closure-library/closure/goog/demos/graphics/tiger.html +105 -0
- data/closure-library/closure/goog/demos/graphics/tigerdata.js +2840 -0
- data/closure-library/closure/goog/demos/history1.html +132 -0
- data/closure-library/closure/goog/demos/history2.html +100 -0
- data/closure-library/closure/goog/demos/history3.html +106 -0
- data/closure-library/closure/goog/demos/history3js.html +36 -0
- data/closure-library/closure/goog/demos/history_blank.html +25 -0
- data/closure-library/closure/goog/demos/hovercard.html +177 -0
- data/closure-library/closure/goog/demos/hsvapalette.html +55 -0
- data/closure-library/closure/goog/demos/hsvpalette.html +56 -0
- data/closure-library/closure/goog/demos/html5history.html +87 -0
- data/closure-library/closure/goog/demos/imagelessbutton.html +221 -0
- data/closure-library/closure/goog/demos/imagelessmenubutton.html +285 -0
- data/closure-library/closure/goog/demos/imagelessroundedcorner.html +231 -0
- data/closure-library/closure/goog/demos/index.html +19 -0
- data/closure-library/closure/goog/demos/index_nav.html +253 -0
- data/closure-library/closure/goog/demos/index_splash.html +22 -0
- data/closure-library/closure/goog/demos/inline_block_quirks.html +125 -0
- data/closure-library/closure/goog/demos/inline_block_standards.html +126 -0
- data/closure-library/closure/goog/demos/inputdatepicker.html +60 -0
- data/closure-library/closure/goog/demos/inputhandler.html +72 -0
- data/closure-library/closure/goog/demos/jsonprettyprinter.html +80 -0
- data/closure-library/closure/goog/demos/keyboardshortcuts.html +112 -0
- data/closure-library/closure/goog/demos/keyhandler.html +127 -0
- data/closure-library/closure/goog/demos/labelinput.html +42 -0
- data/closure-library/closure/goog/demos/menu.html +220 -0
- data/closure-library/closure/goog/demos/menubutton.html +318 -0
- data/closure-library/closure/goog/demos/mousewheelhandler.html +109 -0
- data/closure-library/closure/goog/demos/offline.html +268 -0
- data/closure-library/closure/goog/demos/onlinehandler.html +77 -0
- data/closure-library/closure/goog/demos/palette.html +302 -0
- data/closure-library/closure/goog/demos/pastehandler.html +54 -0
- data/closure-library/closure/goog/demos/plaintextspellchecker.html +106 -0
- data/closure-library/closure/goog/demos/popup.html +200 -0
- data/closure-library/closure/goog/demos/popupcolorpicker.html +49 -0
- data/closure-library/closure/goog/demos/popupdatepicker.html +53 -0
- data/closure-library/closure/goog/demos/popupemojipicker.html +407 -0
- data/closure-library/closure/goog/demos/popupmenu.html +89 -0
- data/closure-library/closure/goog/demos/progressbar.html +97 -0
- data/closure-library/closure/goog/demos/prompt.html +92 -0
- data/closure-library/closure/goog/demos/quadtree.html +107 -0
- data/closure-library/closure/goog/demos/ratings.html +120 -0
- data/closure-library/closure/goog/demos/richtextspellchecker.html +92 -0
- data/closure-library/closure/goog/demos/roundedpanel.html +139 -0
- data/closure-library/closure/goog/demos/samplecomponent.html +75 -0
- data/closure-library/closure/goog/demos/samplecomponent.js +206 -0
- data/closure-library/closure/goog/demos/scrollfloater.html +117 -0
- data/closure-library/closure/goog/demos/select.html +324 -0
- data/closure-library/closure/goog/demos/selectionmenubutton.html +186 -0
- data/closure-library/closure/goog/demos/serverchart.html +122 -0
- data/closure-library/closure/goog/demos/silverlightclipboardbutton.html +71 -0
- data/closure-library/closure/goog/demos/slider.html +110 -0
- data/closure-library/closure/goog/demos/splitbehavior.html +164 -0
- data/closure-library/closure/goog/demos/splitpane.html +243 -0
- data/closure-library/closure/goog/demos/stopevent.html +171 -0
- data/closure-library/closure/goog/demos/submenus.html +130 -0
- data/closure-library/closure/goog/demos/submenus2.html +150 -0
- data/closure-library/closure/goog/demos/tabbar.html +289 -0
- data/closure-library/closure/goog/demos/tablesorter.html +116 -0
- data/closure-library/closure/goog/demos/tabpane.html +302 -0
- data/closure-library/closure/goog/demos/textarea.html +128 -0
- data/closure-library/closure/goog/demos/timers.html +291 -0
- data/closure-library/closure/goog/demos/toolbar.html +703 -0
- data/closure-library/closure/goog/demos/tooltip.html +91 -0
- data/closure-library/closure/goog/demos/tracer.html +92 -0
- data/closure-library/closure/goog/demos/tree/demo.html +126 -0
- data/closure-library/closure/goog/demos/tree/testdata.js +260 -0
- data/closure-library/closure/goog/demos/tweakui.html +121 -0
- data/closure-library/closure/goog/demos/twothumbslider.html +121 -0
- data/closure-library/closure/goog/demos/useragent.html +173 -0
- data/closure-library/closure/goog/demos/viewportsizemonitor.html +71 -0
- data/closure-library/closure/goog/demos/xpc/blank.html +7 -0
- data/closure-library/closure/goog/demos/xpc/index.html +89 -0
- data/closure-library/closure/goog/demos/xpc/inner.html +58 -0
- data/closure-library/closure/goog/demos/xpc/minimal/blank.html +7 -0
- data/closure-library/closure/goog/demos/xpc/minimal/index.html +105 -0
- data/closure-library/closure/goog/demos/xpc/minimal/inner.html +75 -0
- data/closure-library/closure/goog/demos/xpc/minimal/relay.html +7 -0
- data/closure-library/closure/goog/demos/xpc/relay.html +7 -0
- data/closure-library/closure/goog/demos/xpc/xpcdemo.js +304 -0
- data/closure-library/closure/goog/demos/zippy.html +127 -0
- data/closure-library/closure/goog/deps.js +672 -0
- data/closure-library/closure/goog/disposable/disposable.js +167 -0
- data/closure-library/closure/goog/disposable/disposable_test.html +202 -0
- data/closure-library/closure/goog/dom/a11y.js +438 -0
- data/closure-library/closure/goog/dom/a11y_test.html +86 -0
- data/closure-library/closure/goog/dom/abstractmultirange.js +77 -0
- data/closure-library/closure/goog/dom/abstractrange.js +514 -0
- data/closure-library/closure/goog/dom/abstractrange_test.html +73 -0
- data/closure-library/closure/goog/dom/annotate.js +352 -0
- data/closure-library/closure/goog/dom/annotate_test.html +187 -0
- data/closure-library/closure/goog/dom/browserfeature.js +50 -0
- data/closure-library/closure/goog/dom/browserrange/abstractrange.js +316 -0
- data/closure-library/closure/goog/dom/browserrange/browserrange.js +149 -0
- data/closure-library/closure/goog/dom/browserrange/browserrange_test.html +562 -0
- data/closure-library/closure/goog/dom/browserrange/geckorange.js +82 -0
- data/closure-library/closure/goog/dom/browserrange/ierange.js +970 -0
- data/closure-library/closure/goog/dom/browserrange/operarange.js +83 -0
- data/closure-library/closure/goog/dom/browserrange/w3crange.js +364 -0
- data/closure-library/closure/goog/dom/browserrange/webkitrange.js +112 -0
- data/closure-library/closure/goog/dom/classes.js +233 -0
- data/closure-library/closure/goog/dom/classes_test.html +228 -0
- data/closure-library/closure/goog/dom/controlrange.js +511 -0
- data/closure-library/closure/goog/dom/controlrange_test.html +246 -0
- data/closure-library/closure/goog/dom/dataset.js +90 -0
- data/closure-library/closure/goog/dom/dataset_test.html +104 -0
- data/closure-library/closure/goog/dom/dom.js +2424 -0
- data/closure-library/closure/goog/dom/dom_quirks_test.html +104 -0
- data/closure-library/closure/goog/dom/dom_test.html +103 -0
- data/closure-library/closure/goog/dom/dom_test.js +1129 -0
- data/closure-library/closure/goog/dom/fontsizemonitor.js +159 -0
- data/closure-library/closure/goog/dom/fontsizemonitor_test.html +283 -0
- data/closure-library/closure/goog/dom/forms.js +403 -0
- data/closure-library/closure/goog/dom/forms_test.html +483 -0
- data/closure-library/closure/goog/dom/iframe.js +128 -0
- data/closure-library/closure/goog/dom/iframe_test.html +87 -0
- data/closure-library/closure/goog/dom/iter.js +127 -0
- data/closure-library/closure/goog/dom/iter_test.html +97 -0
- data/closure-library/closure/goog/dom/multirange.js +519 -0
- data/closure-library/closure/goog/dom/multirange_test.html +67 -0
- data/closure-library/closure/goog/dom/nodeiterator.js +85 -0
- data/closure-library/closure/goog/dom/nodeiterator_test.html +49 -0
- data/closure-library/closure/goog/dom/nodeoffset.js +111 -0
- data/closure-library/closure/goog/dom/nodeoffset_test.html +88 -0
- data/closure-library/closure/goog/dom/pattern/abstractpattern.js +60 -0
- data/closure-library/closure/goog/dom/pattern/allchildren.js +73 -0
- data/closure-library/closure/goog/dom/pattern/callback/callback.js +82 -0
- data/closure-library/closure/goog/dom/pattern/callback/counter.js +72 -0
- data/closure-library/closure/goog/dom/pattern/callback/test.js +77 -0
- data/closure-library/closure/goog/dom/pattern/childmatches.js +152 -0
- data/closure-library/closure/goog/dom/pattern/endtag.js +53 -0
- data/closure-library/closure/goog/dom/pattern/fulltag.js +92 -0
- data/closure-library/closure/goog/dom/pattern/matcher.js +150 -0
- data/closure-library/closure/goog/dom/pattern/matcher_test.html +204 -0
- data/closure-library/closure/goog/dom/pattern/nodetype.js +57 -0
- data/closure-library/closure/goog/dom/pattern/pattern.js +93 -0
- data/closure-library/closure/goog/dom/pattern/pattern_test.html +614 -0
- data/closure-library/closure/goog/dom/pattern/repeat.js +188 -0
- data/closure-library/closure/goog/dom/pattern/sequence.js +139 -0
- data/closure-library/closure/goog/dom/pattern/starttag.js +53 -0
- data/closure-library/closure/goog/dom/pattern/tag.js +149 -0
- data/closure-library/closure/goog/dom/pattern/text.js +69 -0
- data/closure-library/closure/goog/dom/range.js +220 -0
- data/closure-library/closure/goog/dom/range_test.html +702 -0
- data/closure-library/closure/goog/dom/rangeendpoint.js +32 -0
- data/closure-library/closure/goog/dom/savedcaretrange.js +203 -0
- data/closure-library/closure/goog/dom/savedcaretrange_test.html +235 -0
- data/closure-library/closure/goog/dom/savedrange.js +74 -0
- data/closure-library/closure/goog/dom/savedrange_test.html +61 -0
- data/closure-library/closure/goog/dom/selection.js +470 -0
- data/closure-library/closure/goog/dom/selection_test.html +329 -0
- data/closure-library/closure/goog/dom/tagiterator.js +365 -0
- data/closure-library/closure/goog/dom/tagiterator_test.html +589 -0
- data/closure-library/closure/goog/dom/tagname.js +121 -0
- data/closure-library/closure/goog/dom/tagname_test.html +37 -0
- data/closure-library/closure/goog/dom/textrange.js +611 -0
- data/closure-library/closure/goog/dom/textrange_test.html +127 -0
- data/closure-library/closure/goog/dom/textrangeiterator.js +246 -0
- data/closure-library/closure/goog/dom/textrangeiterator_test.html +142 -0
- data/closure-library/closure/goog/dom/viewportsizemonitor.js +220 -0
- data/closure-library/closure/goog/dom/viewportsizemonitor_test.html +166 -0
- data/closure-library/closure/goog/dom/xml.js +187 -0
- data/closure-library/closure/goog/dom/xml_test.html +77 -0
- data/closure-library/closure/goog/editor/browserfeature.js +251 -0
- data/closure-library/closure/goog/editor/browserfeature_test.html +124 -0
- data/closure-library/closure/goog/editor/clicktoeditwrapper.js +438 -0
- data/closure-library/closure/goog/editor/clicktoeditwrapper_test.html +137 -0
- data/closure-library/closure/goog/editor/command.js +74 -0
- data/closure-library/closure/goog/editor/defines.js +34 -0
- data/closure-library/closure/goog/editor/field.js +2594 -0
- data/closure-library/closure/goog/editor/field_test.html +1000 -0
- data/closure-library/closure/goog/editor/focus.js +32 -0
- data/closure-library/closure/goog/editor/focus_test.html +66 -0
- data/closure-library/closure/goog/editor/icontent.js +296 -0
- data/closure-library/closure/goog/editor/icontent_test.html +209 -0
- data/closure-library/closure/goog/editor/link.js +279 -0
- data/closure-library/closure/goog/editor/link_test.html +234 -0
- data/closure-library/closure/goog/editor/node.js +435 -0
- data/closure-library/closure/goog/editor/node_test.html +590 -0
- data/closure-library/closure/goog/editor/plugin.js +444 -0
- data/closure-library/closure/goog/editor/plugin_test.html +187 -0
- data/closure-library/closure/goog/editor/plugins/abstractbubbleplugin.js +535 -0
- data/closure-library/closure/goog/editor/plugins/abstractbubbleplugin_test.html +227 -0
- data/closure-library/closure/goog/editor/plugins/abstractdialogplugin.js +336 -0
- data/closure-library/closure/goog/editor/plugins/abstractdialogplugin_test.html +399 -0
- data/closure-library/closure/goog/editor/plugins/abstracttabhandler.js +78 -0
- data/closure-library/closure/goog/editor/plugins/abstracttabhandler_test.html +91 -0
- data/closure-library/closure/goog/editor/plugins/basictextformatter.js +1740 -0
- data/closure-library/closure/goog/editor/plugins/basictextformatter_test.html +1171 -0
- data/closure-library/closure/goog/editor/plugins/blockquote.js +422 -0
- data/closure-library/closure/goog/editor/plugins/blockquote_test.html +149 -0
- data/closure-library/closure/goog/editor/plugins/emoticons.js +83 -0
- data/closure-library/closure/goog/editor/plugins/emoticons_test.html +67 -0
- data/closure-library/closure/goog/editor/plugins/enterhandler.js +730 -0
- data/closure-library/closure/goog/editor/plugins/enterhandler_test.html +739 -0
- data/closure-library/closure/goog/editor/plugins/headerformatter.js +95 -0
- data/closure-library/closure/goog/editor/plugins/headerformatter_test.html +100 -0
- data/closure-library/closure/goog/editor/plugins/linkbubble.js +458 -0
- data/closure-library/closure/goog/editor/plugins/linkbubble_test.html +309 -0
- data/closure-library/closure/goog/editor/plugins/linkdialogplugin.js +222 -0
- data/closure-library/closure/goog/editor/plugins/linkdialogplugin_test.html +370 -0
- data/closure-library/closure/goog/editor/plugins/listtabhandler.js +66 -0
- data/closure-library/closure/goog/editor/plugins/listtabhandler_test.html +177 -0
- data/closure-library/closure/goog/editor/plugins/loremipsum.js +186 -0
- data/closure-library/closure/goog/editor/plugins/loremipsum_test.html +169 -0
- data/closure-library/closure/goog/editor/plugins/removeformatting.js +772 -0
- data/closure-library/closure/goog/editor/plugins/removeformatting_test.html +920 -0
- data/closure-library/closure/goog/editor/plugins/spacestabhandler.js +93 -0
- data/closure-library/closure/goog/editor/plugins/spacestabhandler_test.html +186 -0
- data/closure-library/closure/goog/editor/plugins/tableeditor.js +496 -0
- data/closure-library/closure/goog/editor/plugins/tableeditor_test.html +299 -0
- data/closure-library/closure/goog/editor/plugins/tagonenterhandler.js +741 -0
- data/closure-library/closure/goog/editor/plugins/tagonenterhandler_test.html +481 -0
- data/closure-library/closure/goog/editor/plugins/undoredo.js +1014 -0
- data/closure-library/closure/goog/editor/plugins/undoredo_test.html +525 -0
- data/closure-library/closure/goog/editor/plugins/undoredomanager.js +337 -0
- data/closure-library/closure/goog/editor/plugins/undoredomanager_test.html +394 -0
- data/closure-library/closure/goog/editor/plugins/undoredostate.js +84 -0
- data/closure-library/closure/goog/editor/plugins/undoredostate_test.html +44 -0
- data/closure-library/closure/goog/editor/range.js +602 -0
- data/closure-library/closure/goog/editor/range_test.html +880 -0
- data/closure-library/closure/goog/editor/seamlessfield.js +720 -0
- data/closure-library/closure/goog/editor/seamlessfield_quirks_test.html +30 -0
- data/closure-library/closure/goog/editor/seamlessfield_test.html +33 -0
- data/closure-library/closure/goog/editor/seamlessfield_test.js +392 -0
- data/closure-library/closure/goog/editor/style.js +222 -0
- data/closure-library/closure/goog/editor/style_test.html +177 -0
- data/closure-library/closure/goog/editor/table.js +566 -0
- data/closure-library/closure/goog/editor/table_test.html +522 -0
- data/closure-library/closure/goog/events/actioneventwrapper.js +131 -0
- data/closure-library/closure/goog/events/actioneventwrapper_test.html +176 -0
- data/closure-library/closure/goog/events/actionhandler.js +189 -0
- data/closure-library/closure/goog/events/actionhandler_test.html +82 -0
- data/closure-library/closure/goog/events/browserevent.js +412 -0
- data/closure-library/closure/goog/events/browserevent_test.html +145 -0
- data/closure-library/closure/goog/events/browserfeature.js +43 -0
- data/closure-library/closure/goog/events/event.js +123 -0
- data/closure-library/closure/goog/events/event_test.html +70 -0
- data/closure-library/closure/goog/events/eventhandler.js +348 -0
- data/closure-library/closure/goog/events/eventhandler_test.html +230 -0
- data/closure-library/closure/goog/events/events.js +1101 -0
- data/closure-library/closure/goog/events/events_test.html +362 -0
- data/closure-library/closure/goog/events/eventtarget.js +197 -0
- data/closure-library/closure/goog/events/eventtarget_test.html +423 -0
- data/closure-library/closure/goog/events/eventtype.js +107 -0
- data/closure-library/closure/goog/events/eventwrapper.js +67 -0
- data/closure-library/closure/goog/events/filedrophandler.js +224 -0
- data/closure-library/closure/goog/events/filedrophandler_test.html +258 -0
- data/closure-library/closure/goog/events/focushandler.js +111 -0
- data/closure-library/closure/goog/events/imehandler.js +365 -0
- data/closure-library/closure/goog/events/imehandler_test.html +271 -0
- data/closure-library/closure/goog/events/inputhandler.js +218 -0
- data/closure-library/closure/goog/events/keycodes.js +314 -0
- data/closure-library/closure/goog/events/keycodes_test.html +72 -0
- data/closure-library/closure/goog/events/keyhandler.js +522 -0
- data/closure-library/closure/goog/events/keyhandler_test.html +621 -0
- data/closure-library/closure/goog/events/keynames.js +124 -0
- data/closure-library/closure/goog/events/listener.js +160 -0
- data/closure-library/closure/goog/events/mousewheelhandler.js +280 -0
- data/closure-library/closure/goog/events/mousewheelhandler_test.html +331 -0
- data/closure-library/closure/goog/events/onlinehandler.js +176 -0
- data/closure-library/closure/goog/events/onlinelistener_test.html +214 -0
- data/closure-library/closure/goog/events/pastehandler.js +444 -0
- data/closure-library/closure/goog/events/pastehandler_test.html +354 -0
- data/closure-library/closure/goog/events/pools.js +342 -0
- data/closure-library/closure/goog/format/emailaddress.js +329 -0
- data/closure-library/closure/goog/format/emailaddress_test.html +179 -0
- data/closure-library/closure/goog/format/format.js +451 -0
- data/closure-library/closure/goog/format/format_test.html +257 -0
- data/closure-library/closure/goog/format/htmlprettyprinter.js +406 -0
- data/closure-library/closure/goog/format/htmlprettyprinter_test.html +205 -0
- data/closure-library/closure/goog/format/jsonprettyprinter.js +405 -0
- data/closure-library/closure/goog/format/jsonprettyprinter_test.html +111 -0
- data/closure-library/closure/goog/fs/entry.js +406 -0
- data/closure-library/closure/goog/fs/error.js +103 -0
- data/closure-library/closure/goog/fs/filesaver.js +214 -0
- data/closure-library/closure/goog/fs/filesystem.js +59 -0
- data/closure-library/closure/goog/fs/filewriter.js +106 -0
- data/closure-library/closure/goog/fs/fs.js +183 -0
- data/closure-library/closure/goog/fs/fs_test.html +270 -0
- data/closure-library/closure/goog/functions/functions.js +219 -0
- data/closure-library/closure/goog/functions/functions_test.html +198 -0
- data/closure-library/closure/goog/fx/abstractdragdrop.js +1451 -0
- data/closure-library/closure/goog/fx/abstractdragdrop_test.html +430 -0
- data/closure-library/closure/goog/fx/animation.js +621 -0
- data/closure-library/closure/goog/fx/animationqueue.js +348 -0
- data/closure-library/closure/goog/fx/cssspriteanimation.js +112 -0
- data/closure-library/closure/goog/fx/cssspriteanimation_test.html +125 -0
- data/closure-library/closure/goog/fx/dom.js +610 -0
- data/closure-library/closure/goog/fx/dragdrop.js +49 -0
- data/closure-library/closure/goog/fx/dragdropgroup.js +107 -0
- data/closure-library/closure/goog/fx/dragdropgroup_test.html +234 -0
- data/closure-library/closure/goog/fx/dragger.js +731 -0
- data/closure-library/closure/goog/fx/dragger_test.html +415 -0
- data/closure-library/closure/goog/fx/draglistgroup.js +1159 -0
- data/closure-library/closure/goog/fx/draglistgroup_test.html +231 -0
- data/closure-library/closure/goog/fx/dragscrollsupport.js +274 -0
- data/closure-library/closure/goog/fx/dragscrollsupport_test.html +253 -0
- data/closure-library/closure/goog/fx/easing.js +50 -0
- data/closure-library/closure/goog/fx/fx.js +30 -0
- data/closure-library/closure/goog/fx/fx_test.html +157 -0
- data/closure-library/closure/goog/gears/basestore.js +523 -0
- data/closure-library/closure/goog/gears/basestore_test.html +247 -0
- data/closure-library/closure/goog/gears/database.js +935 -0
- data/closure-library/closure/goog/gears/database_test.html +699 -0
- data/closure-library/closure/goog/gears/fakeworkerpool.js +252 -0
- data/closure-library/closure/goog/gears/fakeworkerpool_test.html +188 -0
- data/closure-library/closure/goog/gears/gears.js +228 -0
- data/closure-library/closure/goog/gears/gears_test.html +78 -0
- data/closure-library/closure/goog/gears/httprequest.js +77 -0
- data/closure-library/closure/goog/gears/loggerclient.js +131 -0
- data/closure-library/closure/goog/gears/loggerclient_test.html +171 -0
- data/closure-library/closure/goog/gears/loggerserver.js +158 -0
- data/closure-library/closure/goog/gears/loggerserver_test.html +118 -0
- data/closure-library/closure/goog/gears/logstore.js +479 -0
- data/closure-library/closure/goog/gears/logstore_test.html +600 -0
- data/closure-library/closure/goog/gears/managedresourcestore.js +553 -0
- data/closure-library/closure/goog/gears/managedresourcestore_test.html +453 -0
- data/closure-library/closure/goog/gears/multipartformdata.js +203 -0
- data/closure-library/closure/goog/gears/multipartformdata_test.html +220 -0
- data/closure-library/closure/goog/gears/statustype.js +37 -0
- data/closure-library/closure/goog/gears/urlcapture.js +370 -0
- data/closure-library/closure/goog/gears/urlcapture_test.html +392 -0
- data/closure-library/closure/goog/gears/worker.js +201 -0
- data/closure-library/closure/goog/gears/workerchannel.js +205 -0
- data/closure-library/closure/goog/gears/workerchannel_test.html +207 -0
- data/closure-library/closure/goog/gears/workerpool.js +241 -0
- data/closure-library/closure/goog/gears/workerpool_test.html +203 -0
- data/closure-library/closure/goog/graphics/abstractgraphics.js +439 -0
- data/closure-library/closure/goog/graphics/affinetransform.js +497 -0
- data/closure-library/closure/goog/graphics/affinetransform_test.html +316 -0
- data/closure-library/closure/goog/graphics/canvaselement.js +776 -0
- data/closure-library/closure/goog/graphics/canvasgraphics.js +632 -0
- data/closure-library/closure/goog/graphics/element.js +145 -0
- data/closure-library/closure/goog/graphics/ellipseelement.js +59 -0
- data/closure-library/closure/goog/graphics/ext/coordinates.js +158 -0
- data/closure-library/closure/goog/graphics/ext/coordinates_test.html +74 -0
- data/closure-library/closure/goog/graphics/ext/element.js +970 -0
- data/closure-library/closure/goog/graphics/ext/element_test.html +144 -0
- data/closure-library/closure/goog/graphics/ext/ellipse.js +58 -0
- data/closure-library/closure/goog/graphics/ext/ext.js +29 -0
- data/closure-library/closure/goog/graphics/ext/graphics.js +209 -0
- data/closure-library/closure/goog/graphics/ext/group.js +213 -0
- data/closure-library/closure/goog/graphics/ext/image.js +62 -0
- data/closure-library/closure/goog/graphics/ext/path.js +140 -0
- data/closure-library/closure/goog/graphics/ext/path_test.html +46 -0
- data/closure-library/closure/goog/graphics/ext/rectangle.js +53 -0
- data/closure-library/closure/goog/graphics/ext/shape.js +144 -0
- data/closure-library/closure/goog/graphics/ext/strokeandfillelement.js +69 -0
- data/closure-library/closure/goog/graphics/fill.js +29 -0
- data/closure-library/closure/goog/graphics/font.js +59 -0
- data/closure-library/closure/goog/graphics/graphics.js +124 -0
- data/closure-library/closure/goog/graphics/groupelement.js +54 -0
- data/closure-library/closure/goog/graphics/imageelement.js +67 -0
- data/closure-library/closure/goog/graphics/lineargradient.js +131 -0
- data/closure-library/closure/goog/graphics/path.js +508 -0
- data/closure-library/closure/goog/graphics/path_test.html +359 -0
- data/closure-library/closure/goog/graphics/pathelement.js +50 -0
- data/closure-library/closure/goog/graphics/paths.js +86 -0
- data/closure-library/closure/goog/graphics/paths_test.html +97 -0
- data/closure-library/closure/goog/graphics/rectelement.js +59 -0
- data/closure-library/closure/goog/graphics/solidfill.js +70 -0
- data/closure-library/closure/goog/graphics/stroke.js +63 -0
- data/closure-library/closure/goog/graphics/strokeandfillelement.js +110 -0
- data/closure-library/closure/goog/graphics/svgelement.js +262 -0
- data/closure-library/closure/goog/graphics/svggraphics.js +813 -0
- data/closure-library/closure/goog/graphics/textelement.js +51 -0
- data/closure-library/closure/goog/graphics/vmlelement.js +380 -0
- data/closure-library/closure/goog/graphics/vmlgraphics.js +863 -0
- data/closure-library/closure/goog/history/event.js +54 -0
- data/closure-library/closure/goog/history/eventtype.js +30 -0
- data/closure-library/closure/goog/history/history.js +979 -0
- data/closure-library/closure/goog/history/html5history.js +303 -0
- data/closure-library/closure/goog/history/html5history_test.html +163 -0
- data/closure-library/closure/goog/i18n/bidi.js +772 -0
- data/closure-library/closure/goog/i18n/bidi_test.html +414 -0
- data/closure-library/closure/goog/i18n/bidiformatter.js +488 -0
- data/closure-library/closure/goog/i18n/bidiformatter_test.html +343 -0
- data/closure-library/closure/goog/i18n/charlistdecompressor.js +157 -0
- data/closure-library/closure/goog/i18n/charlistdecompressor_test.html +65 -0
- data/closure-library/closure/goog/i18n/charpickerdata.js +3185 -0
- data/closure-library/closure/goog/i18n/currency.js +385 -0
- data/closure-library/closure/goog/i18n/currency_test.html +202 -0
- data/closure-library/closure/goog/i18n/currencycodemap.js +210 -0
- data/closure-library/closure/goog/i18n/datetimeformat.js +636 -0
- data/closure-library/closure/goog/i18n/datetimeformat_test.html +436 -0
- data/closure-library/closure/goog/i18n/datetimeparse.js +1111 -0
- data/closure-library/closure/goog/i18n/datetimeparse_test.html +796 -0
- data/closure-library/closure/goog/i18n/datetimepatterns.js +1586 -0
- data/closure-library/closure/goog/i18n/datetimepatternsext.js +7386 -0
- data/closure-library/closure/goog/i18n/datetimesymbols.js +3350 -0
- data/closure-library/closure/goog/i18n/datetimesymbolsext.js +12938 -0
- data/closure-library/closure/goog/i18n/graphemebreak.js +181 -0
- data/closure-library/closure/goog/i18n/graphemebreak_test.html +72 -0
- data/closure-library/closure/goog/i18n/messageformat.js +553 -0
- data/closure-library/closure/goog/i18n/messageformat_test.html +323 -0
- data/closure-library/closure/goog/i18n/mime.js +100 -0
- data/closure-library/closure/goog/i18n/mime_test.html +51 -0
- data/closure-library/closure/goog/i18n/numberformat.js +763 -0
- data/closure-library/closure/goog/i18n/numberformat_test.html +605 -0
- data/closure-library/closure/goog/i18n/numberformatsymbols.js +10358 -0
- data/closure-library/closure/goog/i18n/pluralrules.js +695 -0
- data/closure-library/closure/goog/i18n/timezone.js +341 -0
- data/closure-library/closure/goog/i18n/timezone_test.html +163 -0
- data/closure-library/closure/goog/i18n/uchar.js +1160 -0
- data/closure-library/closure/goog/i18n/uchar_test.html +72 -0
- data/closure-library/closure/goog/images/blank.gif +0 -0
- data/closure-library/closure/goog/images/bubble_close.jpg +0 -0
- data/closure-library/closure/goog/images/bubble_left.gif +0 -0
- data/closure-library/closure/goog/images/bubble_right.gif +0 -0
- data/closure-library/closure/goog/images/button-bg.gif +0 -0
- data/closure-library/closure/goog/images/check-outline.gif +0 -0
- data/closure-library/closure/goog/images/check-sprite.gif +0 -0
- data/closure-library/closure/goog/images/check.gif +0 -0
- data/closure-library/closure/goog/images/close_box.gif +0 -0
- data/closure-library/closure/goog/images/color-swatch-tick.gif +0 -0
- data/closure-library/closure/goog/images/dialog_close_box.gif +0 -0
- data/closure-library/closure/goog/images/dimension-highlighted.png +0 -0
- data/closure-library/closure/goog/images/dimension-unhighlighted.png +0 -0
- data/closure-library/closure/goog/images/dropdn.gif +0 -0
- data/closure-library/closure/goog/images/dropdn_disabled.gif +0 -0
- data/closure-library/closure/goog/images/dropdown.gif +0 -0
- data/closure-library/closure/goog/images/gears_bluedot.gif +0 -0
- data/closure-library/closure/goog/images/gears_offline.gif +0 -0
- data/closure-library/closure/goog/images/gears_online.gif +0 -0
- data/closure-library/closure/goog/images/gears_paused.gif +0 -0
- data/closure-library/closure/goog/images/gears_syncing.gif +0 -0
- data/closure-library/closure/goog/images/hsv-sprite-sm.gif +0 -0
- data/closure-library/closure/goog/images/hsv-sprite-sm.png +0 -0
- data/closure-library/closure/goog/images/hsv-sprite.gif +0 -0
- data/closure-library/closure/goog/images/hsv-sprite.png +0 -0
- data/closure-library/closure/goog/images/hsva-sprite-sm.gif +0 -0
- data/closure-library/closure/goog/images/hsva-sprite-sm.png +0 -0
- data/closure-library/closure/goog/images/hsva-sprite.gif +0 -0
- data/closure-library/closure/goog/images/hsva-sprite.png +0 -0
- data/closure-library/closure/goog/images/left_anchor_bubble_bot.gif +0 -0
- data/closure-library/closure/goog/images/left_anchor_bubble_top.gif +0 -0
- data/closure-library/closure/goog/images/menu-arrows.gif +0 -0
- data/closure-library/closure/goog/images/minus.png +0 -0
- data/closure-library/closure/goog/images/no_anchor_bubble_bot.gif +0 -0
- data/closure-library/closure/goog/images/no_anchor_bubble_top.gif +0 -0
- data/closure-library/closure/goog/images/offlineicons.png +0 -0
- data/closure-library/closure/goog/images/plus.png +0 -0
- data/closure-library/closure/goog/images/ratingstars.gif +0 -0
- data/closure-library/closure/goog/images/right_anchor_bubble_bot.gif +0 -0
- data/closure-library/closure/goog/images/right_anchor_bubble_top.gif +0 -0
- data/closure-library/closure/goog/images/toolbar-bg.png +0 -0
- data/closure-library/closure/goog/images/toolbar-separator.gif +0 -0
- data/closure-library/closure/goog/images/toolbar_icons.gif +0 -0
- data/closure-library/closure/goog/images/tree/I.png +0 -0
- data/closure-library/closure/goog/images/tree/cleardot.gif +0 -0
- data/closure-library/closure/goog/images/tree/tree.gif +0 -0
- data/closure-library/closure/goog/images/tree/tree.png +0 -0
- data/closure-library/closure/goog/images/ui_controls.jpg +0 -0
- data/closure-library/closure/goog/iter/iter.js +627 -0
- data/closure-library/closure/goog/iter/iter_test.html +443 -0
- data/closure-library/closure/goog/json/json.js +302 -0
- data/closure-library/closure/goog/json/json_test.html +501 -0
- data/closure-library/closure/goog/locale/countries.js +288 -0
- data/closure-library/closure/goog/locale/countrylanguagenames_test.html +233 -0
- data/closure-library/closure/goog/locale/defaultlocalenameconstants.js +847 -0
- data/closure-library/closure/goog/locale/genericfontnames.js +73 -0
- data/closure-library/closure/goog/locale/genericfontnames_test.html +97 -0
- data/closure-library/closure/goog/locale/genericfontnamesdata.js +328 -0
- data/closure-library/closure/goog/locale/locale.js +397 -0
- data/closure-library/closure/goog/locale/nativenameconstants.js +1354 -0
- data/closure-library/closure/goog/locale/scriptToLanguages.js +482 -0
- data/closure-library/closure/goog/locale/timezonedetection.js +117 -0
- data/closure-library/closure/goog/locale/timezonedetection_test.html +130 -0
- data/closure-library/closure/goog/locale/timezonefingerprint.js +250 -0
- data/closure-library/closure/goog/locale/timezonelist.js +129 -0
- data/closure-library/closure/goog/locale/timezonelist_test.html +165 -0
- data/closure-library/closure/goog/math/bezier.js +244 -0
- data/closure-library/closure/goog/math/bezier_test.html +70 -0
- data/closure-library/closure/goog/math/box.js +236 -0
- data/closure-library/closure/goog/math/box_test.html +139 -0
- data/closure-library/closure/goog/math/coordinate.js +136 -0
- data/closure-library/closure/goog/math/coordinate3.js +168 -0
- data/closure-library/closure/goog/math/coordinate3_test.html +208 -0
- data/closure-library/closure/goog/math/coordinate_test.html +92 -0
- data/closure-library/closure/goog/math/integer.js +736 -0
- data/closure-library/closure/goog/math/integer_test.html +1653 -0
- data/closure-library/closure/goog/math/line.js +177 -0
- data/closure-library/closure/goog/math/line_test.html +62 -0
- data/closure-library/closure/goog/math/long.js +801 -0
- data/closure-library/closure/goog/math/long_test.html +1571 -0
- data/closure-library/closure/goog/math/math.js +355 -0
- data/closure-library/closure/goog/math/math_test.html +254 -0
- data/closure-library/closure/goog/math/matrix.js +669 -0
- data/closure-library/closure/goog/math/matrix_test.html +427 -0
- data/closure-library/closure/goog/math/range.js +146 -0
- data/closure-library/closure/goog/math/range_test.html +103 -0
- data/closure-library/closure/goog/math/rangeset.js +368 -0
- data/closure-library/closure/goog/math/rangeset_test.html +619 -0
- data/closure-library/closure/goog/math/rect.js +340 -0
- data/closure-library/closure/goog/math/rect_test.html +315 -0
- data/closure-library/closure/goog/math/size.js +201 -0
- data/closure-library/closure/goog/math/size_test.html +174 -0
- data/closure-library/closure/goog/math/vec2.js +255 -0
- data/closure-library/closure/goog/math/vec2_test.html +203 -0
- data/closure-library/closure/goog/math/vec3.js +327 -0
- data/closure-library/closure/goog/math/vec3_test.html +231 -0
- data/closure-library/closure/goog/memoize/memoize.js +98 -0
- data/closure-library/closure/goog/memoize/memoize_test.html +157 -0
- data/closure-library/closure/goog/messaging/abstractchannel.js +209 -0
- data/closure-library/closure/goog/messaging/abstractchannel_test.html +90 -0
- data/closure-library/closure/goog/messaging/bufferedchannel.js +277 -0
- data/closure-library/closure/goog/messaging/bufferedchannel_test.html +205 -0
- data/closure-library/closure/goog/messaging/deferredchannel.js +79 -0
- data/closure-library/closure/goog/messaging/deferredchannel_test.html +107 -0
- data/closure-library/closure/goog/messaging/loggerclient.js +131 -0
- data/closure-library/closure/goog/messaging/loggerclient_test.html +102 -0
- data/closure-library/closure/goog/messaging/loggerserver.js +94 -0
- data/closure-library/closure/goog/messaging/loggerserver_test.html +101 -0
- data/closure-library/closure/goog/messaging/messagechannel.js +115 -0
- data/closure-library/closure/goog/messaging/messaging.js +34 -0
- data/closure-library/closure/goog/messaging/messaging_test.html +42 -0
- data/closure-library/closure/goog/messaging/multichannel.js +303 -0
- data/closure-library/closure/goog/messaging/multichannel_test.html +122 -0
- data/closure-library/closure/goog/messaging/portchannel.js +341 -0
- data/closure-library/closure/goog/messaging/portchannel_test.html +359 -0
- data/closure-library/closure/goog/messaging/testdata/portchannel_worker.js +37 -0
- data/closure-library/closure/goog/module/abstractmoduleloader.js +46 -0
- data/closure-library/closure/goog/module/basemodule.js +45 -0
- data/closure-library/closure/goog/module/basemoduleloader.js +210 -0
- data/closure-library/closure/goog/module/loader.js +269 -0
- data/closure-library/closure/goog/module/module.js +166 -0
- data/closure-library/closure/goog/module/moduleinfo.js +336 -0
- data/closure-library/closure/goog/module/moduleinfo_test.html +109 -0
- data/closure-library/closure/goog/module/moduleloadcallback.js +84 -0
- data/closure-library/closure/goog/module/moduleloadcallback_test.html +57 -0
- data/closure-library/closure/goog/module/moduleloader.js +250 -0
- data/closure-library/closure/goog/module/moduleloader_test.html +244 -0
- data/closure-library/closure/goog/module/modulemanager.js +1008 -0
- data/closure-library/closure/goog/module/modulemanager_test.html +1240 -0
- data/closure-library/closure/goog/module/testdata/modA_1.js +22 -0
- data/closure-library/closure/goog/module/testdata/modA_2.js +24 -0
- data/closure-library/closure/goog/module/testdata/modB_1.js +24 -0
- data/closure-library/closure/goog/net/browserchannel.js +2441 -0
- data/closure-library/closure/goog/net/browserchannel_test.html +1176 -0
- data/closure-library/closure/goog/net/browsertestchannel.js +552 -0
- data/closure-library/closure/goog/net/bulkloader.js +174 -0
- data/closure-library/closure/goog/net/bulkloader_test.html +232 -0
- data/closure-library/closure/goog/net/bulkloaderhelper.js +129 -0
- data/closure-library/closure/goog/net/channeldebug.js +288 -0
- data/closure-library/closure/goog/net/channelrequest.js +1125 -0
- data/closure-library/closure/goog/net/channelrequest_test.html +158 -0
- data/closure-library/closure/goog/net/cookies.js +401 -0
- data/closure-library/closure/goog/net/cookies_test.html +255 -0
- data/closure-library/closure/goog/net/crossdomainrpc.js +848 -0
- data/closure-library/closure/goog/net/crossdomainrpc_test.gif +0 -0
- data/closure-library/closure/goog/net/crossdomainrpc_test.html +120 -0
- data/closure-library/closure/goog/net/crossdomainrpc_test_response.html +59 -0
- data/closure-library/closure/goog/net/errorcode.js +130 -0
- data/closure-library/closure/goog/net/eventtype.js +37 -0
- data/closure-library/closure/goog/net/iframe_xhr_test.html +142 -0
- data/closure-library/closure/goog/net/iframe_xhr_test_response.html +17 -0
- data/closure-library/closure/goog/net/iframeio.js +1342 -0
- data/closure-library/closure/goog/net/iframeio_different_base_test.data +2 -0
- data/closure-library/closure/goog/net/iframeio_different_base_test.html +42 -0
- data/closure-library/closure/goog/net/iframeio_test.html +368 -0
- data/closure-library/closure/goog/net/iframeloadmonitor.js +199 -0
- data/closure-library/closure/goog/net/iframeloadmonitor_test.html +113 -0
- data/closure-library/closure/goog/net/iframeloadmonitor_test_frame.html +12 -0
- data/closure-library/closure/goog/net/iframeloadmonitor_test_frame2.html +12 -0
- data/closure-library/closure/goog/net/iframeloadmonitor_test_frame3.html +12 -0
- data/closure-library/closure/goog/net/imageloader.js +237 -0
- data/closure-library/closure/goog/net/imageloader_test.html +200 -0
- data/closure-library/closure/goog/net/imageloader_testimg1.gif +0 -0
- data/closure-library/closure/goog/net/imageloader_testimg2.gif +0 -0
- data/closure-library/closure/goog/net/imageloader_testimg3.gif +0 -0
- data/closure-library/closure/goog/net/jsonp.js +379 -0
- data/closure-library/closure/goog/net/jsonp_test.html +328 -0
- data/closure-library/closure/goog/net/mockiframeio.js +318 -0
- data/closure-library/closure/goog/net/mockxhrlite.js +34 -0
- data/closure-library/closure/goog/net/mockxhrlite_test.html +109 -0
- data/closure-library/closure/goog/net/multiiframeloadmonitor.js +116 -0
- data/closure-library/closure/goog/net/multiiframeloadmonitor_test.html +172 -0
- data/closure-library/closure/goog/net/networktester.js +383 -0
- data/closure-library/closure/goog/net/networktester_test.html +227 -0
- data/closure-library/closure/goog/net/tmpnetwork.js +168 -0
- data/closure-library/closure/goog/net/wrapperxmlhttpfactory.js +68 -0
- data/closure-library/closure/goog/net/xhrio.js +1093 -0
- data/closure-library/closure/goog/net/xhrio_test.html +603 -0
- data/closure-library/closure/goog/net/xhriopool.js +87 -0
- data/closure-library/closure/goog/net/xhrlite.js +119 -0
- data/closure-library/closure/goog/net/xhrlite_test.html +156 -0
- data/closure-library/closure/goog/net/xhrlitepool.js +37 -0
- data/closure-library/closure/goog/net/xhrmanager.js +763 -0
- data/closure-library/closure/goog/net/xhrmonitor.js +254 -0
- data/closure-library/closure/goog/net/xhrmonitor_test.html +199 -0
- data/closure-library/closure/goog/net/xmlhttp.js +215 -0
- data/closure-library/closure/goog/net/xmlhttpfactory.js +64 -0
- data/closure-library/closure/goog/net/xpc/crosspagechannel.js +624 -0
- data/closure-library/closure/goog/net/xpc/crosspagechannel_test.html +422 -0
- data/closure-library/closure/goog/net/xpc/frameelementmethodtransport.js +251 -0
- data/closure-library/closure/goog/net/xpc/iframepollingtransport.js +822 -0
- data/closure-library/closure/goog/net/xpc/iframerelaytransport.js +288 -0
- data/closure-library/closure/goog/net/xpc/nativemessagingtransport.js +280 -0
- data/closure-library/closure/goog/net/xpc/nativemessagingtransport_test.html +164 -0
- data/closure-library/closure/goog/net/xpc/nixtransport.js +454 -0
- data/closure-library/closure/goog/net/xpc/relay.js +72 -0
- data/closure-library/closure/goog/net/xpc/testdata/inner_peer.html +106 -0
- data/closure-library/closure/goog/net/xpc/transport.js +104 -0
- data/closure-library/closure/goog/net/xpc/xpc.js +238 -0
- data/closure-library/closure/goog/object/object.js +553 -0
- data/closure-library/closure/goog/object/object_test.html +376 -0
- data/closure-library/closure/goog/positioning/absoluteposition.js +73 -0
- data/closure-library/closure/goog/positioning/abstractposition.js +47 -0
- data/closure-library/closure/goog/positioning/anchoredposition.js +78 -0
- data/closure-library/closure/goog/positioning/anchoredviewportposition.js +126 -0
- data/closure-library/closure/goog/positioning/anchoredviewportposition_test.html +117 -0
- data/closure-library/closure/goog/positioning/anchoredviewportposition_test_iframe.html +35 -0
- data/closure-library/closure/goog/positioning/clientposition.js +75 -0
- data/closure-library/closure/goog/positioning/menuanchoredposition.js +97 -0
- data/closure-library/closure/goog/positioning/positioning.js +476 -0
- data/closure-library/closure/goog/positioning/positioning_test.html +877 -0
- data/closure-library/closure/goog/positioning/positioning_test_iframe1.html +16 -0
- data/closure-library/closure/goog/positioning/positioning_test_iframe2.html +13 -0
- data/closure-library/closure/goog/positioning/positioning_test_quirk.html +9 -0
- data/closure-library/closure/goog/positioning/positioning_test_standard.html +13 -0
- data/closure-library/closure/goog/positioning/viewportclientposition.js +102 -0
- data/closure-library/closure/goog/positioning/viewportclientposition_test.html +172 -0
- data/closure-library/closure/goog/positioning/viewportposition.js +63 -0
- data/closure-library/closure/goog/proto/proto.js +43 -0
- data/closure-library/closure/goog/proto/serializer.js +68 -0
- data/closure-library/closure/goog/proto/serializer_test.html +43 -0
- data/closure-library/closure/goog/proto2/descriptor.js +198 -0
- data/closure-library/closure/goog/proto2/descriptor_test.html +60 -0
- data/closure-library/closure/goog/proto2/fielddescriptor.js +288 -0
- data/closure-library/closure/goog/proto2/fielddescriptor_test.html +124 -0
- data/closure-library/closure/goog/proto2/lazydeserializer.js +69 -0
- data/closure-library/closure/goog/proto2/message.js +726 -0
- data/closure-library/closure/goog/proto2/message_test.html +356 -0
- data/closure-library/closure/goog/proto2/objectserializer.js +159 -0
- data/closure-library/closure/goog/proto2/objectserializer_test.html +423 -0
- data/closure-library/closure/goog/proto2/package_test.pb.js +164 -0
- data/closure-library/closure/goog/proto2/pbliteserializer.js +150 -0
- data/closure-library/closure/goog/proto2/pbliteserializer_test.html +267 -0
- data/closure-library/closure/goog/proto2/proto_test.html +693 -0
- data/closure-library/closure/goog/proto2/serializer.js +148 -0
- data/closure-library/closure/goog/proto2/test.pb.js +2820 -0
- data/closure-library/closure/goog/proto2/util.js +54 -0
- data/closure-library/closure/goog/pubsub/pubsub.js +326 -0
- data/closure-library/closure/goog/pubsub/pubsub_test.html +635 -0
- data/closure-library/closure/goog/reflect/reflect.js +50 -0
- data/closure-library/closure/goog/spell/spellcheck.js +474 -0
- data/closure-library/closure/goog/spell/spellcheck_test.html +112 -0
- data/closure-library/closure/goog/string/path.js +100 -0
- data/closure-library/closure/goog/string/path_test.html +59 -0
- data/closure-library/closure/goog/string/string.js +1207 -0
- data/closure-library/closure/goog/string/string_test.html +877 -0
- data/closure-library/closure/goog/string/stringbuffer.js +167 -0
- data/closure-library/closure/goog/string/stringbuffer_test.html +101 -0
- data/closure-library/closure/goog/string/stringformat.js +247 -0
- data/closure-library/closure/goog/string/stringformat_test.html +211 -0
- data/closure-library/closure/goog/structs/avltree.js +769 -0
- data/closure-library/closure/goog/structs/avltree_test.html +241 -0
- data/closure-library/closure/goog/structs/circularbuffer.js +219 -0
- data/closure-library/closure/goog/structs/circularbuffer_test.html +105 -0
- data/closure-library/closure/goog/structs/heap.js +332 -0
- data/closure-library/closure/goog/structs/heap_test.html +220 -0
- data/closure-library/closure/goog/structs/inversionmap.js +159 -0
- data/closure-library/closure/goog/structs/inversionmap_test.html +157 -0
- data/closure-library/closure/goog/structs/linkedmap.js +472 -0
- data/closure-library/closure/goog/structs/linkedmap_test.html +300 -0
- data/closure-library/closure/goog/structs/map.js +446 -0
- data/closure-library/closure/goog/structs/map_test.html +430 -0
- data/closure-library/closure/goog/structs/node.js +74 -0
- data/closure-library/closure/goog/structs/pool.js +344 -0
- data/closure-library/closure/goog/structs/pool_test.html +265 -0
- data/closure-library/closure/goog/structs/prioritypool.js +147 -0
- data/closure-library/closure/goog/structs/prioritypool_test.html +478 -0
- data/closure-library/closure/goog/structs/priorityqueue.js +64 -0
- data/closure-library/closure/goog/structs/priorityqueue_test.html +179 -0
- data/closure-library/closure/goog/structs/quadtree.js +571 -0
- data/closure-library/closure/goog/structs/quadtree_test.html +179 -0
- data/closure-library/closure/goog/structs/queue.js +157 -0
- data/closure-library/closure/goog/structs/queue_test.html +140 -0
- data/closure-library/closure/goog/structs/set.js +251 -0
- data/closure-library/closure/goog/structs/set_test.html +551 -0
- data/closure-library/closure/goog/structs/simplepool.js +203 -0
- data/closure-library/closure/goog/structs/stringset.js +404 -0
- data/closure-library/closure/goog/structs/stringset_test.html +251 -0
- data/closure-library/closure/goog/structs/structs.js +341 -0
- data/closure-library/closure/goog/structs/structs_test.html +1050 -0
- data/closure-library/closure/goog/structs/treenode.js +312 -0
- data/closure-library/closure/goog/structs/treenode_test.html +285 -0
- data/closure-library/closure/goog/structs/trie.js +368 -0
- data/closure-library/closure/goog/structs/trie_test.html +378 -0
- data/closure-library/closure/goog/style/cursor.js +125 -0
- data/closure-library/closure/goog/style/cursor_test.html +131 -0
- data/closure-library/closure/goog/style/style.js +1804 -0
- data/closure-library/closure/goog/style/style_quirks_test.html +1928 -0
- data/closure-library/closure/goog/style/style_test.html +2073 -0
- data/closure-library/closure/goog/style/style_test_iframe_quirk.html +29 -0
- data/closure-library/closure/goog/style/style_test_iframe_standard.html +30 -0
- data/closure-library/closure/goog/style/style_test_quirk.html +9 -0
- data/closure-library/closure/goog/style/style_test_standard.html +11 -0
- data/closure-library/closure/goog/testing/asserts.js +970 -0
- data/closure-library/closure/goog/testing/asserts_test.html +966 -0
- data/closure-library/closure/goog/testing/async/mockcontrol.js +174 -0
- data/closure-library/closure/goog/testing/async/mockcontrol_test.html +224 -0
- data/closure-library/closure/goog/testing/asynctestcase.js +812 -0
- data/closure-library/closure/goog/testing/asynctestcase_async_test.html +102 -0
- data/closure-library/closure/goog/testing/asynctestcase_noasync_test.html +98 -0
- data/closure-library/closure/goog/testing/benchmark.js +87 -0
- data/closure-library/closure/goog/testing/benchmarks/jsbinarysizebutton.js +64 -0
- data/closure-library/closure/goog/testing/benchmarks/jsbinarysizebutton_test.html +58 -0
- data/closure-library/closure/goog/testing/benchmarks/jsbinarysizetoolbar.js +66 -0
- data/closure-library/closure/goog/testing/benchmarks/jsbinarysizetoolbar_test.html +49 -0
- data/closure-library/closure/goog/testing/continuationtestcase.js +682 -0
- data/closure-library/closure/goog/testing/continuationtestcase_test.html +349 -0
- data/closure-library/closure/goog/testing/deferredtestcase.js +157 -0
- data/closure-library/closure/goog/testing/deferredtestcase_test.html +152 -0
- data/closure-library/closure/goog/testing/dom.js +596 -0
- data/closure-library/closure/goog/testing/dom_test.html +438 -0
- data/closure-library/closure/goog/testing/editor/dom.js +293 -0
- data/closure-library/closure/goog/testing/editor/dom_test.html +295 -0
- data/closure-library/closure/goog/testing/editor/fieldmock.js +90 -0
- data/closure-library/closure/goog/testing/editor/testhelper.js +168 -0
- data/closure-library/closure/goog/testing/editor/testhelper_test.html +176 -0
- data/closure-library/closure/goog/testing/events/eventobserver.js +85 -0
- data/closure-library/closure/goog/testing/events/eventobserver_test.html +70 -0
- data/closure-library/closure/goog/testing/events/events.js +540 -0
- data/closure-library/closure/goog/testing/events/events_test.html +434 -0
- data/closure-library/closure/goog/testing/events/matchers.js +41 -0
- data/closure-library/closure/goog/testing/events/matchers_test.html +40 -0
- data/closure-library/closure/goog/testing/expectedfailures.js +236 -0
- data/closure-library/closure/goog/testing/expectedfailures_test.html +122 -0
- data/closure-library/closure/goog/testing/fs/blob.js +74 -0
- data/closure-library/closure/goog/testing/fs/blob_test.html +53 -0
- data/closure-library/closure/goog/testing/fs/directoryentry_test.html +185 -0
- data/closure-library/closure/goog/testing/fs/entry.js +511 -0
- data/closure-library/closure/goog/testing/fs/entry_test.html +153 -0
- data/closure-library/closure/goog/testing/fs/file.js +51 -0
- data/closure-library/closure/goog/testing/fs/fileentry_test.html +54 -0
- data/closure-library/closure/goog/testing/fs/filesystem.js +64 -0
- data/closure-library/closure/goog/testing/fs/filewriter.js +314 -0
- data/closure-library/closure/goog/testing/fs/filewriter_test.html +248 -0
- data/closure-library/closure/goog/testing/fs/fs.js +146 -0
- data/closure-library/closure/goog/testing/fs/fs_test.html +54 -0
- data/closure-library/closure/goog/testing/fs/integration_test.html +219 -0
- data/closure-library/closure/goog/testing/functionmock.js +157 -0
- data/closure-library/closure/goog/testing/functionmock_test.html +357 -0
- data/closure-library/closure/goog/testing/graphics.js +64 -0
- data/closure-library/closure/goog/testing/jsunit.js +144 -0
- data/closure-library/closure/goog/testing/loosemock.js +240 -0
- data/closure-library/closure/goog/testing/loosemock_test.html +343 -0
- data/closure-library/closure/goog/testing/messaging/mockmessagechannel.js +77 -0
- data/closure-library/closure/goog/testing/messaging/mockmessageevent.js +100 -0
- data/closure-library/closure/goog/testing/mock.js +556 -0
- data/closure-library/closure/goog/testing/mock_test.html +208 -0
- data/closure-library/closure/goog/testing/mockclassfactory.js +580 -0
- data/closure-library/closure/goog/testing/mockclassfactory_test.html +241 -0
- data/closure-library/closure/goog/testing/mockclock.js +395 -0
- data/closure-library/closure/goog/testing/mockclock_test.html +413 -0
- data/closure-library/closure/goog/testing/mockcontrol.js +210 -0
- data/closure-library/closure/goog/testing/mockcontrol_test.html +127 -0
- data/closure-library/closure/goog/testing/mockinterface.js +45 -0
- data/closure-library/closure/goog/testing/mockmatchers.js +395 -0
- data/closure-library/closure/goog/testing/mockmatchers_test.html +388 -0
- data/closure-library/closure/goog/testing/mockrandom.js +128 -0
- data/closure-library/closure/goog/testing/mockrandom_test.html +56 -0
- data/closure-library/closure/goog/testing/mockrange.js +65 -0
- data/closure-library/closure/goog/testing/mockrange_test.html +41 -0
- data/closure-library/closure/goog/testing/mockuseragent.js +143 -0
- data/closure-library/closure/goog/testing/mockuseragent_test.html +59 -0
- data/closure-library/closure/goog/testing/multitestrunner.js +1442 -0
- data/closure-library/closure/goog/testing/net/xhrio.js +595 -0
- data/closure-library/closure/goog/testing/net/xhrio_test.html +321 -0
- data/closure-library/closure/goog/testing/objectpropertystring.js +67 -0
- data/closure-library/closure/goog/testing/performancetable.css +46 -0
- data/closure-library/closure/goog/testing/performancetable.js +162 -0
- data/closure-library/closure/goog/testing/performancetimer.js +166 -0
- data/closure-library/closure/goog/testing/performancetimer_test.html +107 -0
- data/closure-library/closure/goog/testing/propertyreplacer.js +243 -0
- data/closure-library/closure/goog/testing/propertyreplacer_test.html +368 -0
- data/closure-library/closure/goog/testing/pseudorandom.js +162 -0
- data/closure-library/closure/goog/testing/pseudorandom_test.html +98 -0
- data/closure-library/closure/goog/testing/recordfunction.js +194 -0
- data/closure-library/closure/goog/testing/recordfunction_test.html +147 -0
- data/closure-library/closure/goog/testing/singleton.js +82 -0
- data/closure-library/closure/goog/testing/singleton_test.html +39 -0
- data/closure-library/closure/goog/testing/stacktrace.js +470 -0
- data/closure-library/closure/goog/testing/stacktrace_test.html +229 -0
- data/closure-library/closure/goog/testing/strictmock.js +124 -0
- data/closure-library/closure/goog/testing/strictmock_test.html +368 -0
- data/closure-library/closure/goog/testing/style/layoutasserts.js +368 -0
- data/closure-library/closure/goog/testing/style/layoutasserts_test.html +269 -0
- data/closure-library/closure/goog/testing/testcase.js +1053 -0
- data/closure-library/closure/goog/testing/testqueue.js +66 -0
- data/closure-library/closure/goog/testing/testrunner.js +391 -0
- data/closure-library/closure/goog/testing/ui/rendererasserts.js +50 -0
- data/closure-library/closure/goog/testing/ui/rendererasserts_test.html +51 -0
- data/closure-library/closure/goog/testing/ui/rendererharness.js +175 -0
- data/closure-library/closure/goog/testing/ui/style.js +137 -0
- data/closure-library/closure/goog/testing/ui/style_reference.html +27 -0
- data/closure-library/closure/goog/testing/ui/style_test.html +130 -0
- data/closure-library/closure/goog/timer/timer.js +285 -0
- data/closure-library/closure/goog/timer/timer_test.html +118 -0
- data/closure-library/closure/goog/tweak/entries.js +990 -0
- data/closure-library/closure/goog/tweak/entries_test.html +94 -0
- data/closure-library/closure/goog/tweak/registry.js +310 -0
- data/closure-library/closure/goog/tweak/registry_test.html +144 -0
- data/closure-library/closure/goog/tweak/testhelpers.js +111 -0
- data/closure-library/closure/goog/tweak/tweak.js +318 -0
- data/closure-library/closure/goog/tweak/tweakui.js +817 -0
- data/closure-library/closure/goog/tweak/tweakui_test.html +280 -0
- data/closure-library/closure/goog/ui/abstractspellchecker.js +1069 -0
- data/closure-library/closure/goog/ui/activitymonitor.js +286 -0
- data/closure-library/closure/goog/ui/activitymonitor_test.html +44 -0
- data/closure-library/closure/goog/ui/advancedtooltip.js +369 -0
- data/closure-library/closure/goog/ui/advancedtooltip_test.html +274 -0
- data/closure-library/closure/goog/ui/animatedzippy.js +190 -0
- data/closure-library/closure/goog/ui/attachablemenu.js +464 -0
- data/closure-library/closure/goog/ui/autocomplete/arraymatcher.js +156 -0
- data/closure-library/closure/goog/ui/autocomplete/arraymatcher_test.html +130 -0
- data/closure-library/closure/goog/ui/autocomplete/autocomplete.js +627 -0
- data/closure-library/closure/goog/ui/autocomplete/autocomplete_test.html +537 -0
- data/closure-library/closure/goog/ui/autocomplete/basic.js +53 -0
- data/closure-library/closure/goog/ui/autocomplete/basic_test.html +204 -0
- data/closure-library/closure/goog/ui/autocomplete/inputhandler.js +1209 -0
- data/closure-library/closure/goog/ui/autocomplete/inputhandler_test.html +555 -0
- data/closure-library/closure/goog/ui/autocomplete/remote.js +117 -0
- data/closure-library/closure/goog/ui/autocomplete/remotearraymatcher.js +273 -0
- data/closure-library/closure/goog/ui/autocomplete/remotearraymatcher_test.html +73 -0
- data/closure-library/closure/goog/ui/autocomplete/renderer.js +852 -0
- data/closure-library/closure/goog/ui/autocomplete/renderer_test.html +386 -0
- data/closure-library/closure/goog/ui/autocomplete/richinputhandler.js +59 -0
- data/closure-library/closure/goog/ui/autocomplete/richremote.js +108 -0
- data/closure-library/closure/goog/ui/autocomplete/richremotearraymatcher.js +126 -0
- data/closure-library/closure/goog/ui/basicmenu.js +930 -0
- data/closure-library/closure/goog/ui/bidiinput.js +164 -0
- data/closure-library/closure/goog/ui/bubble.js +475 -0
- data/closure-library/closure/goog/ui/button.js +208 -0
- data/closure-library/closure/goog/ui/button_test.html +257 -0
- data/closure-library/closure/goog/ui/buttonrenderer.js +205 -0
- data/closure-library/closure/goog/ui/buttonrenderer_test.html +190 -0
- data/closure-library/closure/goog/ui/buttonside.js +40 -0
- data/closure-library/closure/goog/ui/cccbutton.js +281 -0
- data/closure-library/closure/goog/ui/charcounter.js +200 -0
- data/closure-library/closure/goog/ui/charpicker.js +807 -0
- data/closure-library/closure/goog/ui/checkbox.js +303 -0
- data/closure-library/closure/goog/ui/checkbox_test.html +224 -0
- data/closure-library/closure/goog/ui/checkboxmenuitem.js +53 -0
- data/closure-library/closure/goog/ui/colorbutton.js +58 -0
- data/closure-library/closure/goog/ui/colorbutton_test.html +70 -0
- data/closure-library/closure/goog/ui/colorbuttonrenderer.js +72 -0
- data/closure-library/closure/goog/ui/colormenubutton.js +213 -0
- data/closure-library/closure/goog/ui/colormenubuttonrenderer.js +144 -0
- data/closure-library/closure/goog/ui/colormenubuttonrenderer_test.html +88 -0
- data/closure-library/closure/goog/ui/colorpalette.js +162 -0
- data/closure-library/closure/goog/ui/colorpalette_test.html +169 -0
- data/closure-library/closure/goog/ui/colorpicker.js +344 -0
- data/closure-library/closure/goog/ui/colorsplitbehavior.js +61 -0
- data/closure-library/closure/goog/ui/combobox.js +894 -0
- data/closure-library/closure/goog/ui/combobox_test.html +208 -0
- data/closure-library/closure/goog/ui/component.js +1187 -0
- data/closure-library/closure/goog/ui/component_test.html +723 -0
- data/closure-library/closure/goog/ui/container.js +1296 -0
- data/closure-library/closure/goog/ui/container_test.html +450 -0
- data/closure-library/closure/goog/ui/containerrenderer.js +370 -0
- data/closure-library/closure/goog/ui/containerrenderer_test.html +227 -0
- data/closure-library/closure/goog/ui/containerscroller.js +221 -0
- data/closure-library/closure/goog/ui/containerscroller_test.html +213 -0
- data/closure-library/closure/goog/ui/control.js +1348 -0
- data/closure-library/closure/goog/ui/control_test.html +2128 -0
- data/closure-library/closure/goog/ui/controlcontent.js +28 -0
- data/closure-library/closure/goog/ui/controlrenderer.js +808 -0
- data/closure-library/closure/goog/ui/controlrenderer_test.html +840 -0
- data/closure-library/closure/goog/ui/cookieeditor.js +182 -0
- data/closure-library/closure/goog/ui/cookieeditor_test.html +102 -0
- data/closure-library/closure/goog/ui/css3buttonrenderer.js +147 -0
- data/closure-library/closure/goog/ui/css3menubuttonrenderer.js +144 -0
- data/closure-library/closure/goog/ui/cssnames.js +28 -0
- data/closure-library/closure/goog/ui/custombutton.js +58 -0
- data/closure-library/closure/goog/ui/custombuttonrenderer.js +254 -0
- data/closure-library/closure/goog/ui/customcolorpalette.js +137 -0
- data/closure-library/closure/goog/ui/customcolorpalette_test.html +60 -0
- data/closure-library/closure/goog/ui/datepicker.js +1339 -0
- data/closure-library/closure/goog/ui/datepicker_test.html +190 -0
- data/closure-library/closure/goog/ui/decorate.js +37 -0
- data/closure-library/closure/goog/ui/decorate_test.html +113 -0
- data/closure-library/closure/goog/ui/deprecatedbutton.js +381 -0
- data/closure-library/closure/goog/ui/dialog.js +1776 -0
- data/closure-library/closure/goog/ui/dialog_test.html +493 -0
- data/closure-library/closure/goog/ui/dimensionpicker.js +289 -0
- data/closure-library/closure/goog/ui/dimensionpicker_test.html +128 -0
- data/closure-library/closure/goog/ui/dimensionpickerrenderer.js +387 -0
- data/closure-library/closure/goog/ui/dragdropdetector.js +642 -0
- data/closure-library/closure/goog/ui/drilldownrow.js +494 -0
- data/closure-library/closure/goog/ui/editor/abstractdialog.js +443 -0
- data/closure-library/closure/goog/ui/editor/abstractdialog_test.html +467 -0
- data/closure-library/closure/goog/ui/editor/bubble.js +520 -0
- data/closure-library/closure/goog/ui/editor/bubble_test.html +264 -0
- data/closure-library/closure/goog/ui/editor/defaulttoolbar.js +1062 -0
- data/closure-library/closure/goog/ui/editor/linkdialog.js +833 -0
- data/closure-library/closure/goog/ui/editor/linkdialog_test.html +449 -0
- data/closure-library/closure/goog/ui/editor/messages.js +115 -0
- data/closure-library/closure/goog/ui/editor/tabpane.js +183 -0
- data/closure-library/closure/goog/ui/editor/toolbarcontroller.js +293 -0
- data/closure-library/closure/goog/ui/editor/toolbarfactory.js +437 -0
- data/closure-library/closure/goog/ui/editor/toolbarfactory_test.html +73 -0
- data/closure-library/closure/goog/ui/emoji/emoji.js +72 -0
- data/closure-library/closure/goog/ui/emoji/emojipalette.js +298 -0
- data/closure-library/closure/goog/ui/emoji/emojipaletterenderer.js +206 -0
- data/closure-library/closure/goog/ui/emoji/emojipicker.js +797 -0
- data/closure-library/closure/goog/ui/emoji/emojipicker_test.html +840 -0
- data/closure-library/closure/goog/ui/emoji/fast_nonprogressive_emojipicker_test.html +256 -0
- data/closure-library/closure/goog/ui/emoji/fast_progressive_emojipicker_test.html +256 -0
- data/closure-library/closure/goog/ui/emoji/popupemojipicker.js +410 -0
- data/closure-library/closure/goog/ui/emoji/popupemojipicker_test.html +80 -0
- data/closure-library/closure/goog/ui/emoji/progressiveemojipaletterenderer.js +97 -0
- data/closure-library/closure/goog/ui/emoji/spriteinfo.js +212 -0
- data/closure-library/closure/goog/ui/emoji/spriteinfo_test.html +51 -0
- data/closure-library/closure/goog/ui/filteredmenu.js +562 -0
- data/closure-library/closure/goog/ui/filteredmenu_test.html +299 -0
- data/closure-library/closure/goog/ui/filterobservingmenuitem.js +97 -0
- data/closure-library/closure/goog/ui/filterobservingmenuitemrenderer.js +60 -0
- data/closure-library/closure/goog/ui/flatbuttonrenderer.js +138 -0
- data/closure-library/closure/goog/ui/flatmenubuttonrenderer.js +199 -0
- data/closure-library/closure/goog/ui/formpost.js +109 -0
- data/closure-library/closure/goog/ui/formpost_test.html +109 -0
- data/closure-library/closure/goog/ui/gauge.js +999 -0
- data/closure-library/closure/goog/ui/gaugetheme.js +169 -0
- data/closure-library/closure/goog/ui/hovercard.js +447 -0
- data/closure-library/closure/goog/ui/hovercard_test.html +343 -0
- data/closure-library/closure/goog/ui/hsvapalette.js +311 -0
- data/closure-library/closure/goog/ui/hsvapalette_test.html +152 -0
- data/closure-library/closure/goog/ui/hsvpalette.js +470 -0
- data/closure-library/closure/goog/ui/hsvpalette_test.html +202 -0
- data/closure-library/closure/goog/ui/idgenerator.js +57 -0
- data/closure-library/closure/goog/ui/idletimer.js +299 -0
- data/closure-library/closure/goog/ui/idletimer_test.html +100 -0
- data/closure-library/closure/goog/ui/iframemask.js +256 -0
- data/closure-library/closure/goog/ui/iframemask_test.html +230 -0
- data/closure-library/closure/goog/ui/imagelessbuttonrenderer.js +204 -0
- data/closure-library/closure/goog/ui/imagelessmenubuttonrenderer.js +202 -0
- data/closure-library/closure/goog/ui/imagelessroundedcorner.js +971 -0
- data/closure-library/closure/goog/ui/inputdatepicker.js +306 -0
- data/closure-library/closure/goog/ui/inputdatepicker_test.html +109 -0
- data/closure-library/closure/goog/ui/itemevent.js +50 -0
- data/closure-library/closure/goog/ui/keyboardshortcuthandler.js +981 -0
- data/closure-library/closure/goog/ui/keyboardshortcuthandler_test.html +671 -0
- data/closure-library/closure/goog/ui/labelinput.js +439 -0
- data/closure-library/closure/goog/ui/linkbuttonrenderer.js +67 -0
- data/closure-library/closure/goog/ui/media/flashobject.js +629 -0
- data/closure-library/closure/goog/ui/media/flashobject_test.html +236 -0
- data/closure-library/closure/goog/ui/media/flickr.js +309 -0
- data/closure-library/closure/goog/ui/media/flickr_test.html +90 -0
- data/closure-library/closure/goog/ui/media/media.js +284 -0
- data/closure-library/closure/goog/ui/media/media_test.html +161 -0
- data/closure-library/closure/goog/ui/media/mediamodel.js +840 -0
- data/closure-library/closure/goog/ui/media/mp3.js +225 -0
- data/closure-library/closure/goog/ui/media/mp3_test.html +78 -0
- data/closure-library/closure/goog/ui/media/photo.js +139 -0
- data/closure-library/closure/goog/ui/media/photo_test.html +62 -0
- data/closure-library/closure/goog/ui/media/picasa.js +317 -0
- data/closure-library/closure/goog/ui/media/picasa_test.html +131 -0
- data/closure-library/closure/goog/ui/media/vimeo.js +264 -0
- data/closure-library/closure/goog/ui/media/vimeo_test.html +79 -0
- data/closure-library/closure/goog/ui/media/youtube.js +328 -0
- data/closure-library/closure/goog/ui/media/youtube_test.html +185 -0
- data/closure-library/closure/goog/ui/menu.js +435 -0
- data/closure-library/closure/goog/ui/menu_test.html +129 -0
- data/closure-library/closure/goog/ui/menubase.js +191 -0
- data/closure-library/closure/goog/ui/menubutton.js +809 -0
- data/closure-library/closure/goog/ui/menubutton_test.html +440 -0
- data/closure-library/closure/goog/ui/menubutton_test_frame.html +41 -0
- data/closure-library/closure/goog/ui/menubuttonrenderer.js +226 -0
- data/closure-library/closure/goog/ui/menubuttonrenderer_test.html +161 -0
- data/closure-library/closure/goog/ui/menuheader.js +62 -0
- data/closure-library/closure/goog/ui/menuheaderrenderer.js +55 -0
- data/closure-library/closure/goog/ui/menuitem.js +154 -0
- data/closure-library/closure/goog/ui/menuitem_test.html +506 -0
- data/closure-library/closure/goog/ui/menuitemrenderer.js +353 -0
- data/closure-library/closure/goog/ui/menuitemrenderer_test.html +190 -0
- data/closure-library/closure/goog/ui/menurenderer.js +118 -0
- data/closure-library/closure/goog/ui/menuseparator.js +51 -0
- data/closure-library/closure/goog/ui/menuseparatorrenderer.js +102 -0
- data/closure-library/closure/goog/ui/mockactivitymonitor.js +54 -0
- data/closure-library/closure/goog/ui/nativebuttonrenderer.js +205 -0
- data/closure-library/closure/goog/ui/nativebuttonrenderer_test.html +213 -0
- data/closure-library/closure/goog/ui/offlineinstalldialog.js +1086 -0
- data/closure-library/closure/goog/ui/offlinestatuscard.js +580 -0
- data/closure-library/closure/goog/ui/offlinestatuscomponent.js +545 -0
- data/closure-library/closure/goog/ui/option.js +67 -0
- data/closure-library/closure/goog/ui/palette.js +528 -0
- data/closure-library/closure/goog/ui/paletterenderer.js +318 -0
- data/closure-library/closure/goog/ui/plaintextspellchecker.js +668 -0
- data/closure-library/closure/goog/ui/plaintextspellchecker_test.html +240 -0
- data/closure-library/closure/goog/ui/popup.js +410 -0
- data/closure-library/closure/goog/ui/popup_test.html +137 -0
- data/closure-library/closure/goog/ui/popupbase.js +721 -0
- data/closure-library/closure/goog/ui/popupbase_test.html +186 -0
- data/closure-library/closure/goog/ui/popupcolorpicker.js +441 -0
- data/closure-library/closure/goog/ui/popupcolorpicker_test.html +71 -0
- data/closure-library/closure/goog/ui/popupdatepicker.js +273 -0
- data/closure-library/closure/goog/ui/popupmenu.js +539 -0
- data/closure-library/closure/goog/ui/popupmenu_test.html +197 -0
- data/closure-library/closure/goog/ui/progressbar.js +390 -0
- data/closure-library/closure/goog/ui/prompt.js +307 -0
- data/closure-library/closure/goog/ui/prompt_test.html +65 -0
- data/closure-library/closure/goog/ui/rangemodel.js +301 -0
- data/closure-library/closure/goog/ui/rangemodel_test.html +270 -0
- data/closure-library/closure/goog/ui/ratings.js +441 -0
- data/closure-library/closure/goog/ui/registry.js +166 -0
- data/closure-library/closure/goog/ui/registry_test.html +236 -0
- data/closure-library/closure/goog/ui/richtextspellchecker.js +600 -0
- data/closure-library/closure/goog/ui/richtextspellchecker_test.html +224 -0
- data/closure-library/closure/goog/ui/roundedcorners.js +694 -0
- data/closure-library/closure/goog/ui/roundedpanel.js +609 -0
- data/closure-library/closure/goog/ui/roundedpanel_test.html +57 -0
- data/closure-library/closure/goog/ui/roundedtabrenderer.js +196 -0
- data/closure-library/closure/goog/ui/scrollfloater.js +394 -0
- data/closure-library/closure/goog/ui/scrollfloater_test.html +46 -0
- data/closure-library/closure/goog/ui/select.js +397 -0
- data/closure-library/closure/goog/ui/select_test.html +152 -0
- data/closure-library/closure/goog/ui/selectionmenubutton.js +277 -0
- data/closure-library/closure/goog/ui/selectionmenubutton_test.html +237 -0
- data/closure-library/closure/goog/ui/selectionmodel.js +291 -0
- data/closure-library/closure/goog/ui/separator.js +74 -0
- data/closure-library/closure/goog/ui/serverchart.js +1791 -0
- data/closure-library/closure/goog/ui/serverchart_test.html +598 -0
- data/closure-library/closure/goog/ui/slider.js +125 -0
- data/closure-library/closure/goog/ui/sliderbase.js +1087 -0
- data/closure-library/closure/goog/ui/sliderbase_test.html +198 -0
- data/closure-library/closure/goog/ui/splitbehavior.js +348 -0
- data/closure-library/closure/goog/ui/splitbehavior_test.html +161 -0
- data/closure-library/closure/goog/ui/splitpane.js +844 -0
- data/closure-library/closure/goog/ui/splitpane_test.html +143 -0
- data/closure-library/closure/goog/ui/style/app/buttonrenderer.js +204 -0
- data/closure-library/closure/goog/ui/style/app/buttonrenderer_test.html +155 -0
- data/closure-library/closure/goog/ui/style/app/menubuttonrenderer.js +227 -0
- data/closure-library/closure/goog/ui/style/app/menubuttonrenderer_test.html +167 -0
- data/closure-library/closure/goog/ui/style/app/primaryactionbuttonrenderer.js +88 -0
- data/closure-library/closure/goog/ui/style/app/primaryactionbuttonrenderer_test.html +76 -0
- data/closure-library/closure/goog/ui/submenu.js +660 -0
- data/closure-library/closure/goog/ui/submenu_test.html +446 -0
- data/closure-library/closure/goog/ui/submenurenderer.js +188 -0
- data/closure-library/closure/goog/ui/tab.js +102 -0
- data/closure-library/closure/goog/ui/tab_test.html +61 -0
- data/closure-library/closure/goog/ui/tabbar.js +393 -0
- data/closure-library/closure/goog/ui/tabbar_test.html +611 -0
- data/closure-library/closure/goog/ui/tabbarrenderer.js +173 -0
- data/closure-library/closure/goog/ui/tabbarrenderer_test.html +137 -0
- data/closure-library/closure/goog/ui/tablesorter.js +304 -0
- data/closure-library/closure/goog/ui/tablesorter_test.html +127 -0
- data/closure-library/closure/goog/ui/tabpane.js +674 -0
- data/closure-library/closure/goog/ui/tabpane_test.html +107 -0
- data/closure-library/closure/goog/ui/tabrenderer.js +152 -0
- data/closure-library/closure/goog/ui/tabrenderer_test.html +132 -0
- data/closure-library/closure/goog/ui/textarea.js +573 -0
- data/closure-library/closure/goog/ui/textarea_test.html +305 -0
- data/closure-library/closure/goog/ui/textarearenderer.js +167 -0
- data/closure-library/closure/goog/ui/togglebutton.js +58 -0
- data/closure-library/closure/goog/ui/toolbar.js +45 -0
- data/closure-library/closure/goog/ui/toolbarbutton.js +54 -0
- data/closure-library/closure/goog/ui/toolbarbuttonrenderer.js +55 -0
- data/closure-library/closure/goog/ui/toolbarcolormenubutton.js +57 -0
- data/closure-library/closure/goog/ui/toolbarcolormenubuttonrenderer.js +95 -0
- data/closure-library/closure/goog/ui/toolbarcolormenubuttonrenderer_test.html +66 -0
- data/closure-library/closure/goog/ui/toolbarmenubutton.js +56 -0
- data/closure-library/closure/goog/ui/toolbarmenubuttonrenderer.js +55 -0
- data/closure-library/closure/goog/ui/toolbarrenderer.js +95 -0
- data/closure-library/closure/goog/ui/toolbarselect.js +55 -0
- data/closure-library/closure/goog/ui/toolbarseparator.js +51 -0
- data/closure-library/closure/goog/ui/toolbarseparatorrenderer.js +87 -0
- data/closure-library/closure/goog/ui/toolbartogglebutton.js +53 -0
- data/closure-library/closure/goog/ui/tooltip.js +975 -0
- data/closure-library/closure/goog/ui/tooltip_test.html +351 -0
- data/closure-library/closure/goog/ui/tree/basenode.js +1457 -0
- data/closure-library/closure/goog/ui/tree/basenode_test.html +218 -0
- data/closure-library/closure/goog/ui/tree/treecontrol.js +656 -0
- data/closure-library/closure/goog/ui/tree/treecontrol_test.html +113 -0
- data/closure-library/closure/goog/ui/tree/treenode.js +102 -0
- data/closure-library/closure/goog/ui/tree/typeahead.js +332 -0
- data/closure-library/closure/goog/ui/tree/typeahead_test.html +133 -0
- data/closure-library/closure/goog/ui/tristatemenuitem.js +185 -0
- data/closure-library/closure/goog/ui/tristatemenuitemrenderer.js +86 -0
- data/closure-library/closure/goog/ui/twothumbslider.js +134 -0
- data/closure-library/closure/goog/ui/zippy.js +277 -0
- data/closure-library/closure/goog/ui/zippy_test.html +223 -0
- data/closure-library/closure/goog/uri/uri.js +1595 -0
- data/closure-library/closure/goog/uri/uri_test.html +837 -0
- data/closure-library/closure/goog/uri/utils.js +972 -0
- data/closure-library/closure/goog/uri/utils_test.html +521 -0
- data/closure-library/closure/goog/useragent/adobereader.js +90 -0
- data/closure-library/closure/goog/useragent/adobereader_test.html +34 -0
- data/closure-library/closure/goog/useragent/flash.js +113 -0
- data/closure-library/closure/goog/useragent/flash_test.html +34 -0
- data/closure-library/closure/goog/useragent/iphoto.js +86 -0
- data/closure-library/closure/goog/useragent/jscript.js +94 -0
- data/closure-library/closure/goog/useragent/jscript_test.html +65 -0
- data/closure-library/closure/goog/useragent/picasa.js +111 -0
- data/closure-library/closure/goog/useragent/platform.js +70 -0
- data/closure-library/closure/goog/useragent/platform_test.html +108 -0
- data/closure-library/closure/goog/useragent/product.js +253 -0
- data/closure-library/closure/goog/useragent/product_isversion.js +99 -0
- data/closure-library/closure/goog/useragent/product_test.html +322 -0
- data/closure-library/closure/goog/useragent/useragent.js +464 -0
- data/closure-library/closure/goog/useragent/useragent_test.html +290 -0
- data/closure-library/closure/goog/window/window.js +206 -0
- data/closure-library/closure/goog/window/window_test.html +185 -0
- data/closure-library/third_party/closure/goog/base.js +2 -0
- data/closure-library/third_party/closure/goog/caja/string/html/htmlparser.js +611 -0
- data/closure-library/third_party/closure/goog/caja/string/html/htmlsanitizer.js +605 -0
- data/closure-library/third_party/closure/goog/deps.js +26 -0
- data/closure-library/third_party/closure/goog/dojo/dom/query.js +1532 -0
- data/closure-library/third_party/closure/goog/dojo/dom/query_test.html +63 -0
- data/closure-library/third_party/closure/goog/dojo/dom/query_test.js +160 -0
- data/closure-library/third_party/closure/goog/jpeg_encoder/jpeg_encoder_basic.js +751 -0
- data/closure-library/third_party/closure/goog/loremipsum/text/loremipsum.js +712 -0
- data/closure-library/third_party/closure/goog/loremipsum/text/loremipsum_test.html +61 -0
- data/closure-library/third_party/closure/goog/mochikit/async/deferred.js +530 -0
- data/closure-library/third_party/closure/goog/mochikit/async/deferred_test.html +627 -0
- data/closure-library/third_party/closure/goog/mochikit/async/deferredlist.js +199 -0
- data/closure-library/third_party/closure/goog/mochikit/async/deferredlist_test.html +426 -0
- data/closure-library/third_party/closure/goog/osapi/osapi.js +91 -0
- data/closure-library/third_party/closure/goog/silverlight/AppManifest.xml +6 -0
- data/closure-library/third_party/closure/goog/silverlight/AssemblyInfo.cs +35 -0
- data/closure-library/third_party/closure/goog/silverlight/ClipboardButton.xaml +9 -0
- data/closure-library/third_party/closure/goog/silverlight/ClipboardButton.xaml.cs +74 -0
- data/closure-library/third_party/closure/goog/silverlight/ClipboardButtonApp.xaml +8 -0
- data/closure-library/third_party/closure/goog/silverlight/ClipboardButtonApp.xaml.cs +75 -0
- data/closure-library/third_party/closure/goog/silverlight/ClosureClipboardButton.csproj +108 -0
- data/closure-library/third_party/closure/goog/silverlight/ClosureClipboardButton.csproj.user +29 -0
- data/closure-library/third_party/closure/goog/silverlight/clipboardbutton.js +279 -0
- data/closure-library/third_party/closure/goog/silverlight/silverlight.js +758 -0
- data/closure-library/third_party/closure/goog/silverlight/supporteduseragent.js +138 -0
- data/closure-library/third_party/closure/goog/silverlight/xap_files +0 -0
- data/closure-templates/COPYING +202 -0
- data/closure-templates/README +47 -0
- data/closure-templates/SoyToJsSrcCompiler.jar +0 -0
- data/closure-templates/soyutils.js +880 -0
- data/closure-templates/soyutils_usegoog.js +308 -0
- data/closure.gemspec +20 -0
- data/config.ru +40 -0
- data/java_src/ClosureScript.java +89 -0
- data/java_src/make.rb +19 -0
- data/lib/closure/beanshell.rb +80 -0
- data/lib/closure/compiler.rb +184 -0
- data/lib/closure/file_response.rb +90 -0
- data/lib/closure/goog.rb +143 -0
- data/lib/closure/middleware.rb +43 -0
- data/lib/closure/sass.rb +56 -0
- data/lib/closure/script.rb +139 -0
- data/lib/closure/server.rb +83 -0
- data/lib/closure/sources.rb +310 -0
- data/lib/closure/templates.rb +156 -0
- data/lib/closure/version.rb +20 -0
- data/lib/closure.jar +0 -0
- data/lib/closure.rb +134 -0
- data/scripts/demos/compile.js.erb +8 -0
- data/scripts/demos/compile.out +1 -0
- data/scripts/demos/compiler.haml +17 -0
- data/scripts/demos/compiler.js +12 -0
- data/scripts/demos/deps.js.erb +1 -0
- data/scripts/demos/externs.haml +16 -0
- data/scripts/demos/externs.js.erb +8 -0
- data/scripts/demos/externs.out +1 -0
- data/scripts/demos/externs_jquery.externs +849 -0
- data/scripts/demos/externs_jquery.js +167 -0
- data/scripts/demos/externs_jquerytest.js +11 -0
- data/scripts/demos/helloworld.haml +15 -0
- data/scripts/demos/helloworld.js +58 -0
- data/scripts/demos/helloworld.soy +45 -0
- data/scripts/demos/index.haml +21 -0
- data/scripts/demos/rails_ujs.haml +24 -0
- data/scripts/examples/rails/ujs.js +136 -0
- data/scripts/favicon.ico +0 -0
- data/scripts/fixtures/_partial.haml +2 -0
- data/scripts/fixtures/erb.html.erb +8 -0
- data/scripts/fixtures/haml.haml +6 -0
- data/scripts/fixtures/html.html +9 -0
- data/scripts/fixtures/route_js.js.erb +1 -0
- data/scripts/index.haml +14 -0
- data/test/beanshell_test.rb +22 -0
- data/test/server_test.rb +67 -0
- data/test/sources_test.rb +41 -0
- data/test/test_helper.rb +12 -0
- metadata +1577 -0
@@ -0,0 +1,2128 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<!--
|
4
|
+
Copyright 2008 The Closure Library Authors. All Rights Reserved.
|
5
|
+
|
6
|
+
Use of this source code is governed by the Apache License, Version 2.0.
|
7
|
+
See the COPYING file for details.
|
8
|
+
-->
|
9
|
+
<!--
|
10
|
+
-->
|
11
|
+
<head>
|
12
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
13
|
+
<title>Closure Unit Tests - goog.ui.Control</title>
|
14
|
+
<script src="../base.js"></script>
|
15
|
+
<script>
|
16
|
+
goog.require('goog.dom');
|
17
|
+
goog.require('goog.dom.classes');
|
18
|
+
goog.require('goog.events');
|
19
|
+
goog.require('goog.events.KeyCodes');
|
20
|
+
goog.require('goog.events.BrowserEvent.MouseButton');
|
21
|
+
goog.require('goog.object');
|
22
|
+
goog.require('goog.style');
|
23
|
+
goog.require('goog.testing.ExpectedFailures');
|
24
|
+
goog.require('goog.testing.events');
|
25
|
+
goog.require('goog.testing.jsunit');
|
26
|
+
goog.require('goog.ui.Component.EventType');
|
27
|
+
goog.require('goog.ui.Component.State');
|
28
|
+
goog.require('goog.ui.Control');
|
29
|
+
goog.require('goog.ui.ControlRenderer');
|
30
|
+
goog.require('goog.ui.registry');
|
31
|
+
goog.require('goog.userAgent');
|
32
|
+
</script>
|
33
|
+
</head>
|
34
|
+
<body>
|
35
|
+
<div id="sandbox"></div>
|
36
|
+
<script>
|
37
|
+
|
38
|
+
// Disabled due to problems on farm.
|
39
|
+
var testFocus = false;
|
40
|
+
|
41
|
+
var control;
|
42
|
+
|
43
|
+
var ALL_EVENTS = goog.object.getValues(goog.ui.Component.EventType);
|
44
|
+
var events = {};
|
45
|
+
var expectedFailures = new goog.testing.ExpectedFailures();
|
46
|
+
var sandbox = document.getElementById('sandbox');
|
47
|
+
|
48
|
+
/**
|
49
|
+
* A dummy renderer, for testing purposes.
|
50
|
+
* @constructor
|
51
|
+
* @extends {goog.ui.ControlRenderer}
|
52
|
+
*/
|
53
|
+
function TestRenderer() {
|
54
|
+
goog.ui.ControlRenderer.call(this);
|
55
|
+
}
|
56
|
+
goog.inherits(TestRenderer, goog.ui.ControlRenderer);
|
57
|
+
|
58
|
+
/**
|
59
|
+
* Initializes the testcase prior to execution.
|
60
|
+
*/
|
61
|
+
function setUp() {
|
62
|
+
control = new goog.ui.Control('Hello');
|
63
|
+
control.setDispatchTransitionEvents(goog.ui.Component.State.ALL, true);
|
64
|
+
goog.events.listen(control, ALL_EVENTS, countEvent);
|
65
|
+
}
|
66
|
+
|
67
|
+
/**
|
68
|
+
* Cleans up after executing the testcase.
|
69
|
+
*/
|
70
|
+
function tearDown() {
|
71
|
+
control.dispose();
|
72
|
+
expectedFailures.handleTearDown();
|
73
|
+
goog.dom.removeChildren(sandbox);
|
74
|
+
goog.events.removeAll();
|
75
|
+
resetEventCount();
|
76
|
+
}
|
77
|
+
|
78
|
+
/**
|
79
|
+
* Resets the global counter for events dispatched by test objects.
|
80
|
+
*/
|
81
|
+
function resetEventCount() {
|
82
|
+
goog.object.clear(events);
|
83
|
+
}
|
84
|
+
|
85
|
+
/**
|
86
|
+
* Increments the global counter for events of this type.
|
87
|
+
* @param {goog.events.Event} e Event to count.
|
88
|
+
*/
|
89
|
+
function countEvent(e) {
|
90
|
+
var type = e.type;
|
91
|
+
var target = e.target;
|
92
|
+
|
93
|
+
if (!events[target]) {
|
94
|
+
events[target] = {};
|
95
|
+
}
|
96
|
+
|
97
|
+
if (events[target][type]) {
|
98
|
+
events[target][type]++;
|
99
|
+
} else {
|
100
|
+
events[target][type] = 1;
|
101
|
+
}
|
102
|
+
}
|
103
|
+
|
104
|
+
/**
|
105
|
+
* Returns the number of times test objects dispatched events of the given
|
106
|
+
* type since the global counter was last reset.
|
107
|
+
* @param {goog.ui.Control} target Event target.
|
108
|
+
* @param {string} type Event type.
|
109
|
+
* @return {number} Number of events of this type.
|
110
|
+
*/
|
111
|
+
function getEventCount(target, type) {
|
112
|
+
return events[target] && events[target][type] || 0;
|
113
|
+
}
|
114
|
+
|
115
|
+
/**
|
116
|
+
* Returns true if no events were dispatched since the last reset.
|
117
|
+
* @return {boolean} Whether no events have been dispatched since the last
|
118
|
+
* reset.
|
119
|
+
*/
|
120
|
+
function noEventsDispatched() {
|
121
|
+
return !events || goog.object.isEmpty(events);
|
122
|
+
}
|
123
|
+
|
124
|
+
/**
|
125
|
+
* Returns the number of event listeners created by the control.
|
126
|
+
* @param {goog.ui.Control} control Control whose event listers are to be
|
127
|
+
* counted.
|
128
|
+
* @return {number} Number of event listeners.
|
129
|
+
*/
|
130
|
+
function getListenerCount(control) {
|
131
|
+
return control.googUiComponentHandler_ ?
|
132
|
+
goog.object.getCount(control.getHandler().keys_) : 0;
|
133
|
+
}
|
134
|
+
|
135
|
+
/**
|
136
|
+
* Simulates a mousedown event on the given element, including focusing it.
|
137
|
+
* @param {Element} element Element on which to simulate mousedown.
|
138
|
+
* @param {goog.events.BrowserEvent.MouseButton=} opt_button Mouse button;
|
139
|
+
* defaults to {@code goog.events.BrowserEvent.MouseButton.LEFT}.
|
140
|
+
* @return {boolean} Whether the event was allowed to proceed.
|
141
|
+
*/
|
142
|
+
function fireMouseDownAndFocus(element, opt_button) {
|
143
|
+
var result = goog.testing.events.fireMouseDownEvent(element, opt_button);
|
144
|
+
if (result) {
|
145
|
+
// Browsers move focus for all buttons, not just the left button.
|
146
|
+
element.focus();
|
147
|
+
}
|
148
|
+
return result;
|
149
|
+
}
|
150
|
+
|
151
|
+
|
152
|
+
/**
|
153
|
+
* @return {boolean} Whether we're on Mac Safari 3.x.
|
154
|
+
*/
|
155
|
+
function isMacSafari3() {
|
156
|
+
return goog.userAgent.WEBKIT && goog.userAgent.MAC &&
|
157
|
+
!goog.userAgent.isVersion('527');
|
158
|
+
}
|
159
|
+
|
160
|
+
/**
|
161
|
+
* Tests the {@link goog.ui.Control} constructor.
|
162
|
+
*/
|
163
|
+
function testConstructor() {
|
164
|
+
assertNotNull('Constructed control must not be null', control);
|
165
|
+
assertEquals('Content must have expected value', 'Hello',
|
166
|
+
control.getContent());
|
167
|
+
assertEquals('Renderer must default to the registered renderer',
|
168
|
+
goog.ui.registry.getDefaultRenderer(goog.ui.Control),
|
169
|
+
control.getRenderer());
|
170
|
+
|
171
|
+
var content = goog.dom.createDom('div', null, 'Hello',
|
172
|
+
goog.dom.createDom('b', null, 'World'));
|
173
|
+
var testRenderer = new TestRenderer();
|
174
|
+
var fakeDomHelper = {};
|
175
|
+
var foo = new goog.ui.Control(content, testRenderer, fakeDomHelper);
|
176
|
+
assertNotNull('Constructed object must not be null', foo);
|
177
|
+
assertEquals('Content must have expected value', content,
|
178
|
+
foo.getContent());
|
179
|
+
assertEquals('Renderer must have expected value', testRenderer,
|
180
|
+
foo.getRenderer());
|
181
|
+
assertEquals('DOM helper must have expected value', fakeDomHelper,
|
182
|
+
foo.getDomHelper());
|
183
|
+
foo.dispose();
|
184
|
+
}
|
185
|
+
|
186
|
+
/**
|
187
|
+
* Tests {@link goog.ui.Control#getHandler}.
|
188
|
+
*/
|
189
|
+
function testGetHandler() {
|
190
|
+
assertUndefined('Event handler must be undefined before getHandler() ' +
|
191
|
+
'is called', control.googUiComponentHandler_);
|
192
|
+
var handler = control.getHandler();
|
193
|
+
assertNotNull('Event handler must not be null', handler);
|
194
|
+
assertEquals('getHandler() must return the same instance if called again',
|
195
|
+
handler, control.getHandler());
|
196
|
+
}
|
197
|
+
|
198
|
+
/**
|
199
|
+
* Tests {@link goog.ui.Control#isHandleMouseEvents}.
|
200
|
+
*/
|
201
|
+
function testIsHandleMouseEvents() {
|
202
|
+
assertTrue('Controls must handle their own mouse events by default',
|
203
|
+
control.isHandleMouseEvents());
|
204
|
+
}
|
205
|
+
|
206
|
+
/**
|
207
|
+
* Tests {@link goog.ui.Control#setHandleMouseEvents}.
|
208
|
+
*/
|
209
|
+
function testSetHandleMouseEvents() {
|
210
|
+
assertTrue('Control must handle its own mouse events by default',
|
211
|
+
control.isHandleMouseEvents());
|
212
|
+
control.setHandleMouseEvents(false);
|
213
|
+
assertFalse('Control must no longer handle its own mouse events',
|
214
|
+
control.isHandleMouseEvents());
|
215
|
+
control.setHandleMouseEvents(true);
|
216
|
+
assertTrue('Control must once again handle its own mouse events',
|
217
|
+
control.isHandleMouseEvents());
|
218
|
+
control.render(sandbox);
|
219
|
+
assertTrue('Rendered control must handle its own mouse events',
|
220
|
+
control.isHandleMouseEvents());
|
221
|
+
control.setHandleMouseEvents(false);
|
222
|
+
assertFalse('Rendered control must no longer handle its own mouse events',
|
223
|
+
control.isHandleMouseEvents());
|
224
|
+
control.setHandleMouseEvents(true);
|
225
|
+
assertTrue('Rendered control must once again handle its own mouse events',
|
226
|
+
control.isHandleMouseEvents());
|
227
|
+
}
|
228
|
+
|
229
|
+
/**
|
230
|
+
* Tests {@link goog.ui.Control#getKeyEventTarget}.
|
231
|
+
*/
|
232
|
+
function testGetKeyEventTarget() {
|
233
|
+
assertNull('Key event target of control without DOM must be null',
|
234
|
+
control.getKeyEventTarget());
|
235
|
+
control.createDom();
|
236
|
+
assertEquals('Key event target of control with DOM must be its element',
|
237
|
+
control.getElement(), control.getKeyEventTarget());
|
238
|
+
}
|
239
|
+
|
240
|
+
/**
|
241
|
+
* Tests {@link goog.ui.Control#getKeyHandler}.
|
242
|
+
*/
|
243
|
+
function testGetKeyHandler() {
|
244
|
+
assertUndefined('Key handler must be undefined before getKeyHandler() ' +
|
245
|
+
'is called', control.keyHandler_);
|
246
|
+
var keyHandler = control.getKeyHandler();
|
247
|
+
assertNotNull('Key handler must not be null', keyHandler);
|
248
|
+
assertEquals('getKeyHandler() must return the same instance if called ' +
|
249
|
+
'again', keyHandler, control.getKeyHandler());
|
250
|
+
}
|
251
|
+
|
252
|
+
/**
|
253
|
+
* Tests {@link goog.ui.Control#getRenderer}.
|
254
|
+
*/
|
255
|
+
function testGetRenderer() {
|
256
|
+
assertEquals('Renderer must be the default registered renderer',
|
257
|
+
goog.ui.registry.getDefaultRenderer(goog.ui.Control),
|
258
|
+
control.getRenderer());
|
259
|
+
}
|
260
|
+
|
261
|
+
/**
|
262
|
+
* Tests {@link goog.ui.Control#setRenderer}.
|
263
|
+
*/
|
264
|
+
function testSetRenderer() {
|
265
|
+
control.createDom();
|
266
|
+
assertNotNull('Control must have a DOM', control.getElement());
|
267
|
+
assertFalse('Control must not be in the document',
|
268
|
+
control.isInDocument());
|
269
|
+
assertEquals('Renderer must be the default registered renderer',
|
270
|
+
goog.ui.registry.getDefaultRenderer(goog.ui.Control),
|
271
|
+
control.getRenderer());
|
272
|
+
|
273
|
+
var testRenderer = new TestRenderer();
|
274
|
+
control.setRenderer(testRenderer);
|
275
|
+
assertNull('Control must not have a DOM after its renderer is reset',
|
276
|
+
control.getElement());
|
277
|
+
assertFalse('Control still must not be in the document',
|
278
|
+
control.isInDocument());
|
279
|
+
assertEquals('Renderer must have expected value', testRenderer,
|
280
|
+
control.getRenderer());
|
281
|
+
|
282
|
+
control.render(sandbox);
|
283
|
+
assertTrue('Control must be in the document', control.isInDocument());
|
284
|
+
|
285
|
+
assertThrows('Resetting the renderer after the control has entered ' +
|
286
|
+
'the document must throw error',
|
287
|
+
function() {
|
288
|
+
control.setRenderer({});
|
289
|
+
});
|
290
|
+
}
|
291
|
+
|
292
|
+
/**
|
293
|
+
* Tests {@link goog.ui.Control#getExtraClassNames}.
|
294
|
+
*/
|
295
|
+
function testGetExtraClassNames() {
|
296
|
+
assertNull('Control must not have any extra class names by default',
|
297
|
+
control.getExtraClassNames());
|
298
|
+
}
|
299
|
+
|
300
|
+
/**
|
301
|
+
* Tests {@link goog.ui.Control#addExtraClassName} and
|
302
|
+
* {@link goog.ui.Control#removeExtraClassName}.
|
303
|
+
*/
|
304
|
+
function testAddRemoveClassName() {
|
305
|
+
assertNull('Control must not have any extra class names by default',
|
306
|
+
control.getExtraClassNames());
|
307
|
+
control.addClassName('foo');
|
308
|
+
assertArrayEquals('Control must have expected extra class names',
|
309
|
+
['foo'], control.getExtraClassNames());
|
310
|
+
assertNull('Control must not have a DOM', control.getElement());
|
311
|
+
|
312
|
+
control.createDom();
|
313
|
+
assertSameElements('Control\'s element must have expected class names',
|
314
|
+
['goog-control', 'foo'],
|
315
|
+
goog.dom.classes.get(control.getElement()));
|
316
|
+
|
317
|
+
control.addClassName('bar');
|
318
|
+
assertArrayEquals('Control must have expected extra class names',
|
319
|
+
['foo', 'bar'], control.getExtraClassNames());
|
320
|
+
assertSameElements('Control\'s element must have expected class names',
|
321
|
+
['goog-control', 'foo', 'bar'],
|
322
|
+
goog.dom.classes.get(control.getElement()));
|
323
|
+
|
324
|
+
control.addClassName('bar');
|
325
|
+
assertArrayEquals('Adding the same class name again must be a no-op',
|
326
|
+
['foo', 'bar'], control.getExtraClassNames());
|
327
|
+
assertSameElements('Adding the same class name again must be a no-op',
|
328
|
+
['goog-control', 'foo', 'bar'],
|
329
|
+
goog.dom.classes.get(control.getElement()));
|
330
|
+
|
331
|
+
control.addClassName(null);
|
332
|
+
assertArrayEquals('Adding null class name must be a no-op',
|
333
|
+
['foo', 'bar'], control.getExtraClassNames());
|
334
|
+
assertSameElements('Adding null class name must be a no-op',
|
335
|
+
['goog-control', 'foo', 'bar'],
|
336
|
+
goog.dom.classes.get(control.getElement()));
|
337
|
+
|
338
|
+
control.removeClassName(null);
|
339
|
+
assertArrayEquals('Removing null class name must be a no-op',
|
340
|
+
['foo', 'bar'], control.getExtraClassNames());
|
341
|
+
assertSameElements('Removing null class name must be a no-op',
|
342
|
+
['goog-control', 'foo', 'bar'],
|
343
|
+
goog.dom.classes.get(control.getElement()));
|
344
|
+
|
345
|
+
control.removeClassName('foo');
|
346
|
+
assertArrayEquals('Control must have expected extra class names',
|
347
|
+
['bar'], control.getExtraClassNames());
|
348
|
+
assertSameElements('Control\'s element must have expected class names',
|
349
|
+
['goog-control', 'bar'],
|
350
|
+
goog.dom.classes.get(control.getElement()));
|
351
|
+
|
352
|
+
control.removeClassName('bar');
|
353
|
+
assertNull('Control must not have any extra class names',
|
354
|
+
control.getExtraClassNames());
|
355
|
+
assertSameElements('Control\'s element must have expected class names',
|
356
|
+
['goog-control'],
|
357
|
+
goog.dom.classes.get(control.getElement()));
|
358
|
+
}
|
359
|
+
|
360
|
+
/**
|
361
|
+
* Tests {@link goog.ui.Control#enableClassName}.
|
362
|
+
*/
|
363
|
+
function testEnableClassName() {
|
364
|
+
assertNull('Control must not have any extra class names by default',
|
365
|
+
control.getExtraClassNames());
|
366
|
+
|
367
|
+
control.enableClassName('foo', true);
|
368
|
+
assertArrayEquals('Control must have expected extra class names',
|
369
|
+
['foo'], control.getExtraClassNames());
|
370
|
+
|
371
|
+
control.enableClassName('bar', true);
|
372
|
+
assertArrayEquals('Control must have expected extra class names',
|
373
|
+
['foo', 'bar'], control.getExtraClassNames());
|
374
|
+
|
375
|
+
control.enableClassName('bar', true);
|
376
|
+
assertArrayEquals('Enabling the same class name again must be a no-op',
|
377
|
+
['foo', 'bar'], control.getExtraClassNames());
|
378
|
+
|
379
|
+
control.enableClassName(null);
|
380
|
+
assertArrayEquals('Enabling null class name must be a no-op',
|
381
|
+
['foo', 'bar'], control.getExtraClassNames());
|
382
|
+
|
383
|
+
control.enableClassName('foo', false);
|
384
|
+
assertArrayEquals('Control must have expected extra class names',
|
385
|
+
['bar'], control.getExtraClassNames());
|
386
|
+
|
387
|
+
control.enableClassName('bar', false);
|
388
|
+
assertNull('Control must not have any extra class names',
|
389
|
+
control.getExtraClassNames());
|
390
|
+
}
|
391
|
+
|
392
|
+
/**
|
393
|
+
* Tests {@link goog.ui.Control#createDom}.
|
394
|
+
*/
|
395
|
+
function testCreateDom() {
|
396
|
+
assertNull('Control must not have a DOM by default',
|
397
|
+
control.getElement());
|
398
|
+
assertFalse('Control must not allow text selection by default',
|
399
|
+
control.isAllowTextSelection());
|
400
|
+
assertTrue('Control must be visible by default', control.isVisible());
|
401
|
+
|
402
|
+
control.createDom();
|
403
|
+
assertNotNull('Control must have a DOM', control.getElement());
|
404
|
+
assertTrue('Control\'s element must be unselectable',
|
405
|
+
goog.style.isUnselectable(control.getElement()));
|
406
|
+
assertTrue('Control\'s element must be visible',
|
407
|
+
control.getElement().style.display != 'none');
|
408
|
+
|
409
|
+
control.setAllowTextSelection(true);
|
410
|
+
control.createDom();
|
411
|
+
assertFalse('Control\'s element must be selectable',
|
412
|
+
goog.style.isUnselectable(control.getElement()));
|
413
|
+
|
414
|
+
control.setVisible(false);
|
415
|
+
control.createDom();
|
416
|
+
assertTrue('Control\'s element must be hidden',
|
417
|
+
control.getElement().style.display == 'none');
|
418
|
+
}
|
419
|
+
|
420
|
+
/**
|
421
|
+
* Tests {@link goog.ui.Control#getContentElement}.
|
422
|
+
*/
|
423
|
+
function testGetContentElement() {
|
424
|
+
assertNull('Unrendered control must not have a content element',
|
425
|
+
control.getContentElement());
|
426
|
+
control.createDom();
|
427
|
+
assertEquals('Control\'s content element must equal its root element',
|
428
|
+
control.getElement(), control.getContentElement());
|
429
|
+
}
|
430
|
+
|
431
|
+
/**
|
432
|
+
* Tests {@link goog.ui.Control#canDecorate}.
|
433
|
+
*/
|
434
|
+
function testCanDecorate() {
|
435
|
+
assertTrue(control.canDecorate(goog.dom.createElement('div')));
|
436
|
+
}
|
437
|
+
|
438
|
+
/**
|
439
|
+
* Tests {@link goog.ui.Control#decorateInternal}.
|
440
|
+
*/
|
441
|
+
function testDecorateInternal() {
|
442
|
+
sandbox.innerHTML = '<div id="foo">Hello, <b>World</b>!</div>';
|
443
|
+
var foo = goog.dom.getElement('foo');
|
444
|
+
control.decorate(foo);
|
445
|
+
assertEquals('Decorated control\'s element must have expected value',
|
446
|
+
foo, control.getElement());
|
447
|
+
assertTrue('Element must be unselectable',
|
448
|
+
goog.style.isUnselectable(control.getElement()));
|
449
|
+
assertTrue('Element must be visible',
|
450
|
+
control.getElement().style.display != 'none');
|
451
|
+
}
|
452
|
+
|
453
|
+
/**
|
454
|
+
* Tests {@link goog.ui.Control#decorateInternal} with a control that
|
455
|
+
* allows text selection.
|
456
|
+
*/
|
457
|
+
function testDecorateInternalForSelectableControl() {
|
458
|
+
sandbox.innerHTML = '<div id="foo">Hello, <b>World</b>!</div>';
|
459
|
+
var foo = goog.dom.getElement('foo');
|
460
|
+
control.setAllowTextSelection(true);
|
461
|
+
control.decorate(foo);
|
462
|
+
assertEquals('Decorated control\'s element must have expected value',
|
463
|
+
foo, control.getElement());
|
464
|
+
assertFalse('Element must be selectable',
|
465
|
+
goog.style.isUnselectable(control.getElement()));
|
466
|
+
assertTrue('Control must be visible', control.isVisible());
|
467
|
+
}
|
468
|
+
|
469
|
+
/**
|
470
|
+
* Tests {@link goog.ui.Control#decorateInternal} with a hidden element.
|
471
|
+
*/
|
472
|
+
function testDecorateInternalForHiddenElement() {
|
473
|
+
sandbox.innerHTML = '<div id="foo" style="display:none">Hello!</div>';
|
474
|
+
var foo = goog.dom.getElement('foo');
|
475
|
+
control.decorate(foo);
|
476
|
+
assertEquals('Decorated control\'s element must have expected value',
|
477
|
+
foo, control.getElement());
|
478
|
+
assertTrue('Element must be unselectable',
|
479
|
+
goog.style.isUnselectable(control.getElement()));
|
480
|
+
assertFalse('Control must be hidden', control.isVisible());
|
481
|
+
}
|
482
|
+
|
483
|
+
/**
|
484
|
+
* Tests {@link goog.ui.Control#enterDocument}.
|
485
|
+
*/
|
486
|
+
function testEnterDocument() {
|
487
|
+
control.render(sandbox);
|
488
|
+
assertTrue('Control must be in the document', control.isInDocument());
|
489
|
+
if (goog.userAgent.IE) {
|
490
|
+
assertEquals('Control must have 5 mouse & 3 key event listeners on IE',
|
491
|
+
8, getListenerCount(control));
|
492
|
+
} else {
|
493
|
+
assertEquals('Control must have 4 mouse and 3 key event listeners', 7,
|
494
|
+
getListenerCount(control));
|
495
|
+
}
|
496
|
+
assertEquals('Control\'s key event handler must be attached to its ' +
|
497
|
+
'key event target', control.getKeyEventTarget(),
|
498
|
+
control.getKeyHandler().element_);
|
499
|
+
}
|
500
|
+
|
501
|
+
/**
|
502
|
+
* Tests {@link goog.ui.Control#enterDocument} for a control that doesn't
|
503
|
+
* handle mouse events.
|
504
|
+
*/
|
505
|
+
function testEnterDocumentForControlWithoutMouseHandling() {
|
506
|
+
control.setHandleMouseEvents(false);
|
507
|
+
control.render(sandbox);
|
508
|
+
assertTrue('Control must be in the document', control.isInDocument());
|
509
|
+
assertEquals('Control must have 3 key event listeners', 3,
|
510
|
+
getListenerCount(control));
|
511
|
+
assertEquals('Control\'s key event handler must be attached to its ' +
|
512
|
+
'key event target', control.getKeyEventTarget(),
|
513
|
+
control.getKeyHandler().element_);
|
514
|
+
}
|
515
|
+
|
516
|
+
/**
|
517
|
+
* Tests {@link goog.ui.Control#enterDocument} for a control that isn't
|
518
|
+
* focusable.
|
519
|
+
*/
|
520
|
+
function testEnterDocumentForNonFocusableControl() {
|
521
|
+
control.setSupportedState(goog.ui.Component.State.FOCUSED, false);
|
522
|
+
control.render(sandbox);
|
523
|
+
assertTrue('Control must be in the document', control.isInDocument());
|
524
|
+
if (goog.userAgent.IE) {
|
525
|
+
assertEquals('Control must have 5 mouse event listeners on IE', 5,
|
526
|
+
getListenerCount(control));
|
527
|
+
} else {
|
528
|
+
assertEquals('Control must have 4 mouse event listeners', 4,
|
529
|
+
getListenerCount(control));
|
530
|
+
}
|
531
|
+
assertUndefined('Control must not have a key event handler',
|
532
|
+
control.keyHandler_);
|
533
|
+
}
|
534
|
+
|
535
|
+
/**
|
536
|
+
* Tests {@link goog.ui.Control#enterDocument} for a control that doesn't
|
537
|
+
* need to do any event handling.
|
538
|
+
*/
|
539
|
+
function testEnterDocumentForControlWithoutEventHandlers() {
|
540
|
+
control.setHandleMouseEvents(false);
|
541
|
+
control.setSupportedState(goog.ui.Component.State.FOCUSED, false);
|
542
|
+
control.render(sandbox);
|
543
|
+
assertTrue('Control must be in the document', control.isInDocument());
|
544
|
+
assertEquals('Control must have 0 event listeners', 0,
|
545
|
+
getListenerCount(control));
|
546
|
+
assertUndefined('Control must not have an event handler',
|
547
|
+
control.googUiComponentHandler_);
|
548
|
+
assertUndefined('Control must not have a key event handler',
|
549
|
+
control.keyHandler_);
|
550
|
+
}
|
551
|
+
|
552
|
+
/**
|
553
|
+
* Tests {@link goog.ui.Control#exitDocument}.
|
554
|
+
*/
|
555
|
+
function testExitDocument() {
|
556
|
+
control.render(sandbox);
|
557
|
+
assertTrue('Control must be in the document', control.isInDocument());
|
558
|
+
if (goog.userAgent.IE) {
|
559
|
+
assertEquals('Control must have 5 mouse & 3 key event listeners on IE',
|
560
|
+
8, getListenerCount(control));
|
561
|
+
} else {
|
562
|
+
assertEquals('Control must have 4 mouse and 3 key event listeners', 7,
|
563
|
+
getListenerCount(control));
|
564
|
+
}
|
565
|
+
assertEquals('Control\'s key event handler must be attached to its ' +
|
566
|
+
'key event target', control.getKeyEventTarget(),
|
567
|
+
control.getKeyHandler().element_);
|
568
|
+
// Expected to fail on Mac Safari prior to version 527.
|
569
|
+
expectedFailures.expectFailureFor(isMacSafari3());
|
570
|
+
try {
|
571
|
+
assertTrue('Control\'s element must support keyboard focus',
|
572
|
+
goog.dom.isFocusableTabIndex(control.getKeyEventTarget()));
|
573
|
+
} catch (e) {
|
574
|
+
expectedFailures.handleException(e);
|
575
|
+
}
|
576
|
+
|
577
|
+
control.exitDocument();
|
578
|
+
assertFalse('Control must no longer be in the document',
|
579
|
+
control.isInDocument());
|
580
|
+
assertEquals('Control must have no event listeners', 0,
|
581
|
+
getListenerCount(control));
|
582
|
+
assertNull('Control\'s key event handler must be unattached',
|
583
|
+
control.getKeyHandler().element_);
|
584
|
+
assertFalse('Control\'s element must no longer support keyboard focus',
|
585
|
+
goog.dom.isFocusableTabIndex(control.getKeyEventTarget()));
|
586
|
+
}
|
587
|
+
|
588
|
+
/**
|
589
|
+
* Tests {@link goog.ui.Control#dispose}.
|
590
|
+
*/
|
591
|
+
function testDispose() {
|
592
|
+
control.render(sandbox);
|
593
|
+
var handler = control.getHandler();
|
594
|
+
var keyHandler = control.getKeyHandler();
|
595
|
+
control.dispose();
|
596
|
+
assertFalse('Control must no longer be in the document',
|
597
|
+
control.isInDocument());
|
598
|
+
assertTrue('Control must have been disposed of', control.isDisposed());
|
599
|
+
assertUndefined('Renderer must have been deleted', control.getRenderer());
|
600
|
+
assertNull('Content must be nulled out', control.getContent());
|
601
|
+
assertTrue('Event handler must have been disposed of',
|
602
|
+
handler.isDisposed());
|
603
|
+
assertUndefined('Event handler must have been deleted',
|
604
|
+
control.googUiComponentHandler_);
|
605
|
+
assertTrue('Key handler must have been disposed of',
|
606
|
+
keyHandler.isDisposed());
|
607
|
+
assertUndefined('Key handler must have been deleted', control.keyHandler_);
|
608
|
+
assertNull('Extra class names must have been nulled out',
|
609
|
+
control.getExtraClassNames());
|
610
|
+
}
|
611
|
+
|
612
|
+
/**
|
613
|
+
* Tests {@link goog.ui.Control#getContent}.
|
614
|
+
*/
|
615
|
+
function testGetContent() {
|
616
|
+
assertNull('Empty control must have null content',
|
617
|
+
(new goog.ui.Control(null)).getContent());
|
618
|
+
assertEquals('Control must have expected content', 'Hello',
|
619
|
+
control.getContent());
|
620
|
+
control.render(sandbox);
|
621
|
+
assertEquals('Control must have expected content after rendering',
|
622
|
+
'Hello', control.getContent());
|
623
|
+
}
|
624
|
+
|
625
|
+
|
626
|
+
/**
|
627
|
+
* Tests {@link goog.ui.Control#getContent}.
|
628
|
+
*/
|
629
|
+
function testGetContentForDecoratedControl() {
|
630
|
+
sandbox.innerHTML =
|
631
|
+
'<div id="empty"></div>\n' +
|
632
|
+
'<div id="text">Hello, world!</div>\n' +
|
633
|
+
'<div id="element"><span>Foo</span></div>\n' +
|
634
|
+
'<div id="nodelist">Hello, <b>world</b>!</div>\n';
|
635
|
+
|
636
|
+
var empty = new goog.ui.Control(null);
|
637
|
+
empty.decorate(goog.dom.getElement('empty'));
|
638
|
+
assertNull('Content of control decorating empty DIV must be null',
|
639
|
+
empty.getContent());
|
640
|
+
empty.dispose();
|
641
|
+
|
642
|
+
var text = new goog.ui.Control(null);
|
643
|
+
text.decorate(goog.dom.getElement('text'));
|
644
|
+
assertEquals('Content of control decorating DIV with text contents ' +
|
645
|
+
'must be as expected', 'Hello, world!', text.getContent().nodeValue);
|
646
|
+
text.dispose();
|
647
|
+
|
648
|
+
var element = new goog.ui.Control(null);
|
649
|
+
element.decorate(goog.dom.getElement('element'));
|
650
|
+
assertEquals('Content of control decorating DIV with element child ' +
|
651
|
+
'must be as expected', goog.dom.getElement('element').firstChild,
|
652
|
+
element.getContent());
|
653
|
+
element.dispose();
|
654
|
+
|
655
|
+
var nodelist = new goog.ui.Control(null);
|
656
|
+
nodelist.decorate(goog.dom.getElement('nodelist'));
|
657
|
+
assertSameElements('Content of control decorating DIV with mixed ' +
|
658
|
+
'contents must be as expected',
|
659
|
+
goog.dom.getElement('nodelist').childNodes, nodelist.getContent());
|
660
|
+
nodelist.dispose();
|
661
|
+
}
|
662
|
+
|
663
|
+
/**
|
664
|
+
* Tests {@link goog.ui.Control#setContent}.
|
665
|
+
*/
|
666
|
+
function testSetContent() {
|
667
|
+
control.setContent('Bye');
|
668
|
+
assertEquals('Unrendered control control must have expected contents',
|
669
|
+
'Bye', control.getContent());
|
670
|
+
assertNull('No DOM must be created by setContent', control.getElement());
|
671
|
+
|
672
|
+
control.createDom();
|
673
|
+
assertEquals('Rendered control\'s DOM must have expected contents',
|
674
|
+
'Bye', control.getElement().innerHTML);
|
675
|
+
|
676
|
+
control.setContent(null);
|
677
|
+
assertNull('Rendered control must have expected contents',
|
678
|
+
control.getContent());
|
679
|
+
assertEquals('Rendered control\'s DOM must have expected contents',
|
680
|
+
'', control.getElement().innerHTML);
|
681
|
+
|
682
|
+
control.setContent([goog.dom.createDom('div', null,
|
683
|
+
goog.dom.createDom('span', null, 'Hello')), 'World']);
|
684
|
+
assertHTMLEquals('Control\'s DOM must be updated',
|
685
|
+
'<div><span>Hello</span></div>World', control.getElement().innerHTML);
|
686
|
+
}
|
687
|
+
|
688
|
+
/**
|
689
|
+
* Tests {@link goog.ui.Control#setContentInternal}.
|
690
|
+
*/
|
691
|
+
function testSetContentInternal() {
|
692
|
+
control.render(sandbox);
|
693
|
+
assertEquals('Control must have expected content after rendering',
|
694
|
+
'Hello', control.getContent());
|
695
|
+
control.setContentInternal('Bye');
|
696
|
+
assertEquals('Control must have expected contents',
|
697
|
+
'Bye', control.getContent());
|
698
|
+
assertEquals('Control\'s DOM must be unchanged', 'Hello',
|
699
|
+
control.getElement().innerHTML);
|
700
|
+
}
|
701
|
+
|
702
|
+
/**
|
703
|
+
* Tests {@link goog.ui.Control#getCaption}.
|
704
|
+
*/
|
705
|
+
function testGetCaption() {
|
706
|
+
assertNull('Empty control\'s caption must be null',
|
707
|
+
(new goog.ui.Control(null)).getCaption());
|
708
|
+
|
709
|
+
assertEquals('Caption must have expected value', 'Hello',
|
710
|
+
control.getCaption());
|
711
|
+
|
712
|
+
sandbox.innerHTML = '<div id="nodelist">Hello, <b>world</b>!</div>';
|
713
|
+
control.decorate(goog.dom.getElement('nodelist'));
|
714
|
+
assertEquals('Caption must have expected value', 'Hello, world!',
|
715
|
+
control.getCaption());
|
716
|
+
}
|
717
|
+
|
718
|
+
/**
|
719
|
+
* Tests {@link goog.ui.Control#setCaption}.
|
720
|
+
*/
|
721
|
+
function testSetCaption() {
|
722
|
+
control.setCaption('Hello, world!');
|
723
|
+
assertEquals('Control must have a string caption "Hello, world!"',
|
724
|
+
'Hello, world!', control.getCaption());
|
725
|
+
}
|
726
|
+
|
727
|
+
/**
|
728
|
+
* Tests {@link goog.ui.Control#setRightToLeft}.
|
729
|
+
*/
|
730
|
+
function testSetRightToLeft() {
|
731
|
+
control.createDom();
|
732
|
+
assertFalse('Control\'s element must not have right-to-left class',
|
733
|
+
goog.dom.classes.has(control.getElement(), 'goog-control-rtl'));
|
734
|
+
control.setRightToLeft(true);
|
735
|
+
assertTrue('Control\'s element must have right-to-left class',
|
736
|
+
goog.dom.classes.has(control.getElement(), 'goog-control-rtl'));
|
737
|
+
control.render(sandbox);
|
738
|
+
assertThrows('Changing the render direction of a control already in ' +
|
739
|
+
'the document is an error',
|
740
|
+
function() {
|
741
|
+
control.setRightToLeft(false);
|
742
|
+
});
|
743
|
+
}
|
744
|
+
|
745
|
+
/**
|
746
|
+
* Tests {@link goog.ui.Control#isAllowTextSelection}.
|
747
|
+
*/
|
748
|
+
function testIsAllowTextSelection() {
|
749
|
+
assertFalse('Controls must not allow text selection by default',
|
750
|
+
control.isAllowTextSelection());
|
751
|
+
}
|
752
|
+
|
753
|
+
/**
|
754
|
+
* Tests {@link goog.ui.Control#setAllowTextSelection}.
|
755
|
+
*/
|
756
|
+
function testSetAllowTextSelection() {
|
757
|
+
assertFalse('Controls must not allow text selection by default',
|
758
|
+
control.isAllowTextSelection());
|
759
|
+
|
760
|
+
control.setAllowTextSelection(true);
|
761
|
+
assertTrue('Control must allow text selection',
|
762
|
+
control.isAllowTextSelection());
|
763
|
+
|
764
|
+
control.setAllowTextSelection(false);
|
765
|
+
assertFalse('Control must no longer allow text selection',
|
766
|
+
control.isAllowTextSelection());
|
767
|
+
|
768
|
+
control.render(sandbox);
|
769
|
+
|
770
|
+
assertFalse('Control must not allow text selection even after rendered',
|
771
|
+
control.isAllowTextSelection());
|
772
|
+
|
773
|
+
control.setAllowTextSelection(true);
|
774
|
+
assertTrue('Control must once again allow text selection',
|
775
|
+
control.isAllowTextSelection());
|
776
|
+
}
|
777
|
+
|
778
|
+
/**
|
779
|
+
* Tests {@link goog.ui.Control#isVisible}.
|
780
|
+
*/
|
781
|
+
function testIsVisible() {
|
782
|
+
assertTrue('Controls must be visible by default', control.isVisible());
|
783
|
+
}
|
784
|
+
|
785
|
+
/**
|
786
|
+
* Tests {@link goog.ui.Control#setVisible} before it is rendered.
|
787
|
+
*/
|
788
|
+
function testSetVisible() {
|
789
|
+
assertFalse('setVisible(true) must return false if already visible',
|
790
|
+
control.setVisible(true));
|
791
|
+
assertTrue('No events must have been dispatched', noEventsDispatched());
|
792
|
+
|
793
|
+
assertTrue('setVisible(false) must return true if previously visible',
|
794
|
+
control.setVisible(false));
|
795
|
+
assertEquals('One HIDE event must have been dispatched',
|
796
|
+
1, getEventCount(control, goog.ui.Component.EventType.HIDE));
|
797
|
+
assertFalse('Control must no longer be visible', control.isVisible());
|
798
|
+
|
799
|
+
assertTrue('setVisible(true) must return true if previously hidden',
|
800
|
+
control.setVisible(true));
|
801
|
+
assertEquals('One SHOW event must have been dispatched',
|
802
|
+
1, getEventCount(control, goog.ui.Component.EventType.SHOW));
|
803
|
+
assertTrue('Control must be visible', control.isVisible());
|
804
|
+
}
|
805
|
+
|
806
|
+
/**
|
807
|
+
* Tests {@link goog.ui.Control#setVisible} after it is rendered.
|
808
|
+
*/
|
809
|
+
function testSetVisibleForRenderedControl() {
|
810
|
+
control.render(sandbox);
|
811
|
+
assertTrue('No events must have been dispatched during rendering',
|
812
|
+
noEventsDispatched());
|
813
|
+
|
814
|
+
assertFalse('setVisible(true) must return false if already visible',
|
815
|
+
control.setVisible(true));
|
816
|
+
assertTrue('No events must have been dispatched', noEventsDispatched());
|
817
|
+
assertTrue('Control\'s element must be visible',
|
818
|
+
control.getElement().style.display != 'none');
|
819
|
+
|
820
|
+
assertTrue('setVisible(false) must return true if previously visible',
|
821
|
+
control.setVisible(false));
|
822
|
+
assertEquals('One HIDE event must have been dispatched',
|
823
|
+
1, getEventCount(control, goog.ui.Component.EventType.HIDE));
|
824
|
+
assertFalse('Control must no longer be visible', control.isVisible());
|
825
|
+
assertTrue('Control\'s element must be hidden',
|
826
|
+
control.getElement().style.display == 'none');
|
827
|
+
|
828
|
+
assertTrue('setVisible(true) must return true if previously hidden',
|
829
|
+
control.setVisible(true));
|
830
|
+
assertEquals('One SHOW event must have been dispatched',
|
831
|
+
1, getEventCount(control, goog.ui.Component.EventType.SHOW));
|
832
|
+
assertTrue('Control must be visible', control.isVisible());
|
833
|
+
assertTrue('Control\'s element must be visible',
|
834
|
+
control.getElement().style.display != 'none');
|
835
|
+
}
|
836
|
+
|
837
|
+
/**
|
838
|
+
* Tests {@link goog.ui.Control#setVisible} for disabled non-focusable
|
839
|
+
* controls.
|
840
|
+
*/
|
841
|
+
function testSetVisibleForDisabledNonFocusableControl() {
|
842
|
+
// Hidden, disabled, non-focusable control becoming visible.
|
843
|
+
control.setEnabled(false);
|
844
|
+
control.setSupportedState(goog.ui.Component.State.FOCUSED, false);
|
845
|
+
control.render(sandbox);
|
846
|
+
assertTrue('Control must be visible', control.isVisible());
|
847
|
+
assertFalse('Control must not have a tab index',
|
848
|
+
goog.dom.isFocusableTabIndex(control.getKeyEventTarget()));
|
849
|
+
|
850
|
+
// Visible, disabled, non-focusable control becoming hidden.
|
851
|
+
control.getKeyEventTarget().focus();
|
852
|
+
assertEquals('Control must not have dispatched FOCUS', 0,
|
853
|
+
getEventCount(control, goog.ui.Component.EventType.FOCUS));
|
854
|
+
assertFalse('Control must not have keyboard focus', control.isFocused());
|
855
|
+
control.setVisible(false);
|
856
|
+
assertFalse('Control must be hidden', control.isVisible());
|
857
|
+
assertFalse('Control must not have a tab index',
|
858
|
+
goog.dom.isFocusableTabIndex(control.getKeyEventTarget()));
|
859
|
+
assertEquals('Control must have dispatched HIDE', 1,
|
860
|
+
getEventCount(control, goog.ui.Component.EventType.HIDE));
|
861
|
+
assertEquals('Control must not have dispatched BLUR', 0,
|
862
|
+
getEventCount(control, goog.ui.Component.EventType.BLUR));
|
863
|
+
}
|
864
|
+
|
865
|
+
/**
|
866
|
+
* Tests {@link goog.ui.Control#setVisible} for disabled focusable controls.
|
867
|
+
*/
|
868
|
+
function testSetVisibleForDisabledFocusableControl() {
|
869
|
+
// Hidden, disabled, focusable control becoming visible.
|
870
|
+
control.setEnabled(false);
|
871
|
+
control.setSupportedState(goog.ui.Component.State.FOCUSED, true);
|
872
|
+
control.render(sandbox);
|
873
|
+
assertTrue('Control must be visible', control.isVisible());
|
874
|
+
assertFalse('Control must not have a tab index',
|
875
|
+
goog.dom.isFocusableTabIndex(control.getKeyEventTarget()));
|
876
|
+
|
877
|
+
// Visible, disabled, focusable control becoming hidden.
|
878
|
+
control.getKeyEventTarget().focus();
|
879
|
+
assertEquals('Control must not have dispatched FOCUS', 0,
|
880
|
+
getEventCount(control, goog.ui.Component.EventType.FOCUS));
|
881
|
+
assertFalse('Control must not have keyboard focus', control.isFocused());
|
882
|
+
control.setVisible(false);
|
883
|
+
assertFalse('Control must be hidden', control.isVisible());
|
884
|
+
assertFalse('Control must not have a tab index',
|
885
|
+
goog.dom.isFocusableTabIndex(control.getKeyEventTarget()));
|
886
|
+
assertEquals('Control must have dispatched HIDE', 1,
|
887
|
+
getEventCount(control, goog.ui.Component.EventType.HIDE));
|
888
|
+
assertEquals('Control must not have dispatched BLUR', 0,
|
889
|
+
getEventCount(control, goog.ui.Component.EventType.BLUR));
|
890
|
+
}
|
891
|
+
|
892
|
+
/**
|
893
|
+
* Tests {@link goog.ui.Control#setVisible} for enabled non-focusable
|
894
|
+
* controls.
|
895
|
+
*/
|
896
|
+
function testSetVisibleForEnabledNonFocusableControl() {
|
897
|
+
// Hidden, enabled, non-focusable control becoming visible.
|
898
|
+
control.setEnabled(true);
|
899
|
+
control.setSupportedState(goog.ui.Component.State.FOCUSED, false);
|
900
|
+
control.render(sandbox);
|
901
|
+
assertTrue('Control must be visible', control.isVisible());
|
902
|
+
assertFalse('Control must not have a tab index',
|
903
|
+
goog.dom.isFocusableTabIndex(control.getKeyEventTarget()));
|
904
|
+
|
905
|
+
if (testFocus) {
|
906
|
+
// Visible, enabled, non-focusable control becoming hidden.
|
907
|
+
control.getKeyEventTarget().focus();
|
908
|
+
assertEquals('Control must not have dispatched FOCUS', 0,
|
909
|
+
getEventCount(control, goog.ui.Component.EventType.FOCUS));
|
910
|
+
assertFalse('Control must not have keyboard focus', control.isFocused());
|
911
|
+
control.setVisible(false);
|
912
|
+
assertFalse('Control must be hidden', control.isVisible());
|
913
|
+
assertFalse('Control must not have a tab index',
|
914
|
+
goog.dom.isFocusableTabIndex(control.getKeyEventTarget()));
|
915
|
+
assertEquals('Control must have dispatched HIDE', 1,
|
916
|
+
getEventCount(control, goog.ui.Component.EventType.HIDE));
|
917
|
+
assertEquals('Control must not have dispatched BLUR', 0,
|
918
|
+
getEventCount(control, goog.ui.Component.EventType.BLUR));
|
919
|
+
}
|
920
|
+
}
|
921
|
+
|
922
|
+
/**
|
923
|
+
* Tests {@link goog.ui.Control#setVisible} for enabled focusable controls.
|
924
|
+
*/
|
925
|
+
function testSetVisibleForEnabledFocusableControl() {
|
926
|
+
// Hidden, enabled, focusable control becoming visible.
|
927
|
+
control.setEnabled(true);
|
928
|
+
control.setSupportedState(goog.ui.Component.State.FOCUSED, true);
|
929
|
+
control.render(sandbox);
|
930
|
+
assertTrue('Control must be visible', control.isVisible());
|
931
|
+
|
932
|
+
if (testFocus) {
|
933
|
+
// Expected to fail on Mac Safari prior to version 527.
|
934
|
+
expectedFailures.expectFailureFor(isMacSafari3());
|
935
|
+
try {
|
936
|
+
// Mac Safari currently doesn't support tabIndex on arbitrary elements.
|
937
|
+
assertTrue('Control must have a tab index',
|
938
|
+
goog.dom.isFocusableTabIndex(control.getKeyEventTarget()));
|
939
|
+
} catch (e) {
|
940
|
+
expectedFailures.handleException(e);
|
941
|
+
}
|
942
|
+
|
943
|
+
// Visible, enabled, focusable control becoming hidden.
|
944
|
+
control.getKeyEventTarget().focus();
|
945
|
+
|
946
|
+
// Expected to fail on IE.
|
947
|
+
expectedFailures.expectFailureFor(goog.userAgent.IE);
|
948
|
+
try {
|
949
|
+
// IE dispatches focus and blur events asynchronously!
|
950
|
+
assertEquals('Control must have dispatched FOCUS', 1,
|
951
|
+
getEventCount(control, goog.ui.Component.EventType.FOCUS));
|
952
|
+
assertTrue('Control must have keyboard focus', control.isFocused());
|
953
|
+
} catch (e) {
|
954
|
+
expectedFailures.handleException(e);
|
955
|
+
}
|
956
|
+
|
957
|
+
control.setVisible(false);
|
958
|
+
assertFalse('Control must be hidden', control.isVisible());
|
959
|
+
assertFalse('Control must not have a tab index',
|
960
|
+
goog.dom.isFocusableTabIndex(control.getKeyEventTarget()));
|
961
|
+
assertEquals('Control must have dispatched HIDE', 1,
|
962
|
+
getEventCount(control, goog.ui.Component.EventType.HIDE));
|
963
|
+
|
964
|
+
// Expected to fail on IE.
|
965
|
+
expectedFailures.expectFailureFor(goog.userAgent.IE);
|
966
|
+
try {
|
967
|
+
// IE dispatches focus and blur events asynchronously!
|
968
|
+
assertEquals('Control must have dispatched BLUR', 1,
|
969
|
+
getEventCount(control, goog.ui.Component.EventType.BLUR));
|
970
|
+
assertFalse('Control must no longer have keyboard focus',
|
971
|
+
control.isFocused());
|
972
|
+
} catch (e) {
|
973
|
+
expectedFailures.handleException(e);
|
974
|
+
}
|
975
|
+
}
|
976
|
+
}
|
977
|
+
|
978
|
+
/**
|
979
|
+
* Tests {@link goog.ui.Control#isEnabled}.
|
980
|
+
*/
|
981
|
+
function testIsEnabled() {
|
982
|
+
assertTrue('Controls must be enabled by default', control.isEnabled());
|
983
|
+
}
|
984
|
+
|
985
|
+
/**
|
986
|
+
* Tests {@link goog.ui.Control#setEnabled}.
|
987
|
+
*/
|
988
|
+
function testSetEnabled() {
|
989
|
+
control.render(sandbox);
|
990
|
+
control.setHighlighted(true);
|
991
|
+
control.setActive(true);
|
992
|
+
control.getKeyEventTarget().focus();
|
993
|
+
|
994
|
+
resetEventCount();
|
995
|
+
|
996
|
+
control.setEnabled(true);
|
997
|
+
assertTrue('No events must have been dispatched', noEventsDispatched());
|
998
|
+
assertTrue('Control must be enabled', control.isEnabled());
|
999
|
+
assertTrue('Control must be highlighted', control.isHighlighted());
|
1000
|
+
assertTrue('Control must be active', control.isActive());
|
1001
|
+
|
1002
|
+
if (testFocus) {
|
1003
|
+
// Expected to fail on IE and Mac Safari 3. IE calls focus handlers
|
1004
|
+
// asynchronously, and Mac Safari 3 doesn't support keyboard focus.
|
1005
|
+
expectedFailures.expectFailureFor(goog.userAgent.IE);
|
1006
|
+
expectedFailures.expectFailureFor(isMacSafari3());
|
1007
|
+
try {
|
1008
|
+
assertTrue('Control must be focused', control.isFocused());
|
1009
|
+
} catch (e) {
|
1010
|
+
expectedFailures.handleException(e);
|
1011
|
+
}
|
1012
|
+
}
|
1013
|
+
|
1014
|
+
resetEventCount();
|
1015
|
+
|
1016
|
+
control.setEnabled(false);
|
1017
|
+
assertEquals('One DISABLE event must have been dispatched', 1,
|
1018
|
+
getEventCount(control, goog.ui.Component.EventType.DISABLE));
|
1019
|
+
assertFalse('Control must be disabled', control.isEnabled());
|
1020
|
+
assertFalse('Control must not be highlighed', control.isHighlighted());
|
1021
|
+
assertFalse('Control must not be active', control.isActive());
|
1022
|
+
assertFalse('Control must not be focused', control.isFocused());
|
1023
|
+
}
|
1024
|
+
|
1025
|
+
/**
|
1026
|
+
* Tests {@link goog.ui.Control#setEnabled} when the control has a parent.
|
1027
|
+
*/
|
1028
|
+
function testSetEnabledWithParent() {
|
1029
|
+
var child = new goog.ui.Control(null);
|
1030
|
+
child.setDispatchTransitionEvents(goog.ui.Component.State.ALL, true);
|
1031
|
+
control.addChild(child, true /* opt_render */);
|
1032
|
+
control.setEnabled(false);
|
1033
|
+
|
1034
|
+
resetEventCount();
|
1035
|
+
|
1036
|
+
assertFalse('Parent must be disabled', control.isEnabled());
|
1037
|
+
assertTrue('Child must be enabled', child.isEnabled());
|
1038
|
+
|
1039
|
+
child.setEnabled(false);
|
1040
|
+
assertTrue('No events must have been dispatched when child is disabled',
|
1041
|
+
noEventsDispatched());
|
1042
|
+
assertTrue('Child must still be enabled', child.isEnabled());
|
1043
|
+
|
1044
|
+
resetEventCount();
|
1045
|
+
|
1046
|
+
control.setEnabled(true);
|
1047
|
+
assertEquals('One ENABLE event must have been dispatched by the parent',
|
1048
|
+
1, getEventCount(control, goog.ui.Component.EventType.ENABLE));
|
1049
|
+
assertTrue('Parent must be enabled', control.isEnabled());
|
1050
|
+
assertTrue('Child must still be enabled', child.isEnabled());
|
1051
|
+
|
1052
|
+
resetEventCount();
|
1053
|
+
|
1054
|
+
child.setEnabled(false);
|
1055
|
+
assertEquals('One DISABLE event must have been dispatched by the child',
|
1056
|
+
1, getEventCount(child, goog.ui.Component.EventType.DISABLE));
|
1057
|
+
assertTrue('Parent must still be enabled', control.isEnabled());
|
1058
|
+
assertFalse('Child must now be disabled', child.isEnabled());
|
1059
|
+
|
1060
|
+
resetEventCount();
|
1061
|
+
|
1062
|
+
control.setEnabled(false);
|
1063
|
+
assertEquals('One DISABLE event must have been dispatched by the parent',
|
1064
|
+
1, getEventCount(control, goog.ui.Component.EventType.DISABLE));
|
1065
|
+
assertFalse('Parent must now be disabled', control.isEnabled());
|
1066
|
+
assertFalse('Child must still be disabled', child.isEnabled());
|
1067
|
+
|
1068
|
+
child.dispose();
|
1069
|
+
}
|
1070
|
+
|
1071
|
+
/**
|
1072
|
+
* Tests {@link goog.ui.Control#isHighlighted}.
|
1073
|
+
*/
|
1074
|
+
function testIsHighlighted() {
|
1075
|
+
assertFalse('Controls must not be highlighted by default',
|
1076
|
+
control.isHighlighted());
|
1077
|
+
}
|
1078
|
+
|
1079
|
+
/**
|
1080
|
+
* Tests {@link goog.ui.Control#setHighlighted}.
|
1081
|
+
*/
|
1082
|
+
function testSetHighlighted() {
|
1083
|
+
control.setSupportedState(goog.ui.Component.State.HOVER, false);
|
1084
|
+
|
1085
|
+
control.setHighlighted(true);
|
1086
|
+
assertFalse('Control must not be highlighted, because it isn\'t ' +
|
1087
|
+
'highlightable', control.isHighlighted());
|
1088
|
+
assertTrue('Control must not have dispatched any events',
|
1089
|
+
noEventsDispatched());
|
1090
|
+
|
1091
|
+
control.setSupportedState(goog.ui.Component.State.HOVER, true);
|
1092
|
+
|
1093
|
+
control.setHighlighted(true);
|
1094
|
+
assertTrue('Control must be highlighted', control.isHighlighted());
|
1095
|
+
assertEquals('Control must have dispatched a HIGHLIGHT event', 1,
|
1096
|
+
getEventCount(control, goog.ui.Component.EventType.HIGHLIGHT));
|
1097
|
+
|
1098
|
+
control.setHighlighted(true);
|
1099
|
+
assertTrue('Control must still be highlighted', control.isHighlighted());
|
1100
|
+
assertEquals('Control must not dispatch more HIGHLIGHT events', 1,
|
1101
|
+
getEventCount(control, goog.ui.Component.EventType.HIGHLIGHT));
|
1102
|
+
|
1103
|
+
control.setHighlighted(false);
|
1104
|
+
assertFalse('Control must not be highlighted', control.isHighlighted());
|
1105
|
+
assertEquals('Control must have dispatched an UNHIGHLIGHT event', 1,
|
1106
|
+
getEventCount(control, goog.ui.Component.EventType.UNHIGHLIGHT));
|
1107
|
+
control.setEnabled(false);
|
1108
|
+
assertFalse('Control must be disabled', control.isEnabled());
|
1109
|
+
|
1110
|
+
control.setHighlighted(true);
|
1111
|
+
assertTrue('Control must be highlighted, even when disabled',
|
1112
|
+
control.isHighlighted());
|
1113
|
+
assertEquals('Control must have dispatched another HIGHLIGHT event', 2,
|
1114
|
+
getEventCount(control, goog.ui.Component.EventType.HIGHLIGHT));
|
1115
|
+
}
|
1116
|
+
|
1117
|
+
/**
|
1118
|
+
* Tests {@link goog.ui.Control#isActive}.
|
1119
|
+
*/
|
1120
|
+
function testIsActive() {
|
1121
|
+
assertFalse('Controls must not be active by default', control.isActive());
|
1122
|
+
}
|
1123
|
+
|
1124
|
+
/**
|
1125
|
+
* Tests {@link goog.ui.Control#setActive}.
|
1126
|
+
*/
|
1127
|
+
function testSetActive() {
|
1128
|
+
control.setSupportedState(goog.ui.Component.State.ACTIVE, false);
|
1129
|
+
|
1130
|
+
control.setActive(true);
|
1131
|
+
assertFalse('Control must not be active, because it isn\'t activateable',
|
1132
|
+
control.isActive());
|
1133
|
+
assertTrue('Control must not have dispatched any events',
|
1134
|
+
noEventsDispatched());
|
1135
|
+
|
1136
|
+
control.setSupportedState(goog.ui.Component.State.ACTIVE, true);
|
1137
|
+
|
1138
|
+
control.setActive(true);
|
1139
|
+
assertTrue('Control must be active', control.isActive());
|
1140
|
+
assertEquals('Control must have dispatched an ACTIVATE event', 1,
|
1141
|
+
getEventCount(control, goog.ui.Component.EventType.ACTIVATE));
|
1142
|
+
|
1143
|
+
control.setActive(true);
|
1144
|
+
assertTrue('Control must still be active', control.isActive());
|
1145
|
+
assertEquals('Control must not dispatch more ACTIVATE events', 1,
|
1146
|
+
getEventCount(control, goog.ui.Component.EventType.ACTIVATE));
|
1147
|
+
|
1148
|
+
control.setEnabled(false);
|
1149
|
+
assertFalse('Control must be disabled', control.isEnabled());
|
1150
|
+
assertFalse('Control must not be active', control.isActive());
|
1151
|
+
assertEquals('Control must have dispatched a DEACTIVATE event', 1,
|
1152
|
+
getEventCount(control, goog.ui.Component.EventType.DEACTIVATE));
|
1153
|
+
}
|
1154
|
+
|
1155
|
+
/**
|
1156
|
+
* Tests disposing the control from an action event handler.
|
1157
|
+
*/
|
1158
|
+
function testDisposeOnAction() {
|
1159
|
+
goog.events.listen(control, goog.ui.Component.EventType.ACTION,
|
1160
|
+
function(e) {
|
1161
|
+
control.dispose();
|
1162
|
+
});
|
1163
|
+
|
1164
|
+
// Control must not throw an exception if disposed of in an ACTION event
|
1165
|
+
// handler.
|
1166
|
+
control.performActionInternal();
|
1167
|
+
control.setActive(true);
|
1168
|
+
assertTrue('Control should have been disposed of', control.isDisposed());
|
1169
|
+
}
|
1170
|
+
|
1171
|
+
/**
|
1172
|
+
* Tests {@link goog.ui.Control#isSelected}.
|
1173
|
+
*/
|
1174
|
+
function testIsSelected() {
|
1175
|
+
assertFalse('Controls must not be selected by default',
|
1176
|
+
control.isSelected());
|
1177
|
+
}
|
1178
|
+
|
1179
|
+
/**
|
1180
|
+
* Tests {@link goog.ui.Control#setSelected}.
|
1181
|
+
*/
|
1182
|
+
function testSetSelected() {
|
1183
|
+
control.setSupportedState(goog.ui.Component.State.SELECTED, false);
|
1184
|
+
|
1185
|
+
control.setSelected(true);
|
1186
|
+
assertFalse('Control must not be selected, because it isn\'t selectable',
|
1187
|
+
control.isSelected());
|
1188
|
+
assertTrue('Control must not have dispatched any events',
|
1189
|
+
noEventsDispatched());
|
1190
|
+
|
1191
|
+
control.setSupportedState(goog.ui.Component.State.SELECTED, true);
|
1192
|
+
|
1193
|
+
control.setSelected(true);
|
1194
|
+
assertTrue('Control must be selected', control.isSelected());
|
1195
|
+
assertEquals('Control must have dispatched a SELECT event', 1,
|
1196
|
+
getEventCount(control, goog.ui.Component.EventType.SELECT));
|
1197
|
+
|
1198
|
+
control.setSelected(true);
|
1199
|
+
assertTrue('Control must still be selected', control.isSelected());
|
1200
|
+
assertEquals('Control must not dispatch more SELECT events', 1,
|
1201
|
+
getEventCount(control, goog.ui.Component.EventType.SELECT));
|
1202
|
+
|
1203
|
+
control.setSelected(false);
|
1204
|
+
assertFalse('Control must not be selected', control.isSelected());
|
1205
|
+
assertEquals('Control must have dispatched an UNSELECT event', 1,
|
1206
|
+
getEventCount(control, goog.ui.Component.EventType.UNSELECT));
|
1207
|
+
control.setEnabled(false);
|
1208
|
+
assertFalse('Control must be disabled', control.isEnabled());
|
1209
|
+
|
1210
|
+
control.setSelected(true);
|
1211
|
+
assertTrue('Control must be selected, even when disabled',
|
1212
|
+
control.isSelected());
|
1213
|
+
assertEquals('Control must have dispatched another SELECT event', 2,
|
1214
|
+
getEventCount(control, goog.ui.Component.EventType.SELECT));
|
1215
|
+
}
|
1216
|
+
|
1217
|
+
/**
|
1218
|
+
* Tests {@link goog.ui.Control#isChecked}.
|
1219
|
+
*/
|
1220
|
+
function testIsChecked() {
|
1221
|
+
assertFalse('Controls must not be checked by default',
|
1222
|
+
control.isChecked());
|
1223
|
+
}
|
1224
|
+
|
1225
|
+
/**
|
1226
|
+
* Tests {@link goog.ui.Control#setChecked}.
|
1227
|
+
*/
|
1228
|
+
function testSetChecked() {
|
1229
|
+
control.setSupportedState(goog.ui.Component.State.CHECKED, false);
|
1230
|
+
|
1231
|
+
control.setChecked(true);
|
1232
|
+
assertFalse('Control must not be checked, because it isn\'t checkable',
|
1233
|
+
control.isChecked());
|
1234
|
+
assertTrue('Control must not have dispatched any events',
|
1235
|
+
noEventsDispatched());
|
1236
|
+
|
1237
|
+
control.setSupportedState(goog.ui.Component.State.CHECKED, true);
|
1238
|
+
|
1239
|
+
control.setChecked(true);
|
1240
|
+
assertTrue('Control must be checked', control.isChecked());
|
1241
|
+
assertEquals('Control must have dispatched a CHECK event', 1,
|
1242
|
+
getEventCount(control, goog.ui.Component.EventType.CHECK));
|
1243
|
+
|
1244
|
+
control.setChecked(true);
|
1245
|
+
assertTrue('Control must still be checked', control.isChecked());
|
1246
|
+
assertEquals('Control must not dispatch more CHECK events', 1,
|
1247
|
+
getEventCount(control, goog.ui.Component.EventType.CHECK));
|
1248
|
+
|
1249
|
+
control.setChecked(false);
|
1250
|
+
assertFalse('Control must not be checked', control.isChecked());
|
1251
|
+
assertEquals('Control must have dispatched an UNCHECK event', 1,
|
1252
|
+
getEventCount(control, goog.ui.Component.EventType.UNCHECK));
|
1253
|
+
control.setEnabled(false);
|
1254
|
+
assertFalse('Control must be disabled', control.isEnabled());
|
1255
|
+
|
1256
|
+
control.setChecked(true);
|
1257
|
+
assertTrue('Control must be checked, even when disabled',
|
1258
|
+
control.isChecked());
|
1259
|
+
assertEquals('Control must have dispatched another CHECK event', 2,
|
1260
|
+
getEventCount(control, goog.ui.Component.EventType.CHECK));
|
1261
|
+
}
|
1262
|
+
|
1263
|
+
/**
|
1264
|
+
* Tests {@link goog.ui.Control#isFocused}.
|
1265
|
+
*/
|
1266
|
+
function testIsFocused() {
|
1267
|
+
assertFalse('Controls must not be focused by default',
|
1268
|
+
control.isFocused());
|
1269
|
+
}
|
1270
|
+
|
1271
|
+
/**
|
1272
|
+
* Tests {@link goog.ui.Control#setFocused}.
|
1273
|
+
*/
|
1274
|
+
function testSetFocused() {
|
1275
|
+
control.setSupportedState(goog.ui.Component.State.FOCUSED, false);
|
1276
|
+
|
1277
|
+
control.setFocused(true);
|
1278
|
+
assertFalse('Control must not be focused, because it isn\'t focusable',
|
1279
|
+
control.isFocused());
|
1280
|
+
assertTrue('Control must not have dispatched any events',
|
1281
|
+
noEventsDispatched());
|
1282
|
+
|
1283
|
+
control.setSupportedState(goog.ui.Component.State.FOCUSED, true);
|
1284
|
+
|
1285
|
+
control.setFocused(true);
|
1286
|
+
assertTrue('Control must be focused', control.isFocused());
|
1287
|
+
assertEquals('Control must have dispatched a FOCUS event', 1,
|
1288
|
+
getEventCount(control, goog.ui.Component.EventType.FOCUS));
|
1289
|
+
|
1290
|
+
control.setFocused(true);
|
1291
|
+
assertTrue('Control must still be focused', control.isFocused());
|
1292
|
+
assertEquals('Control must not dispatch more FOCUS events', 1,
|
1293
|
+
getEventCount(control, goog.ui.Component.EventType.FOCUS));
|
1294
|
+
|
1295
|
+
control.setFocused(false);
|
1296
|
+
assertFalse('Control must not be focused', control.isFocused());
|
1297
|
+
assertEquals('Control must have dispatched an BLUR event', 1,
|
1298
|
+
getEventCount(control, goog.ui.Component.EventType.BLUR));
|
1299
|
+
control.setEnabled(false);
|
1300
|
+
assertFalse('Control must be disabled', control.isEnabled());
|
1301
|
+
|
1302
|
+
control.setFocused(true);
|
1303
|
+
assertTrue('Control must be focused, even when disabled',
|
1304
|
+
control.isFocused());
|
1305
|
+
assertEquals('Control must have dispatched another FOCUS event', 2,
|
1306
|
+
getEventCount(control, goog.ui.Component.EventType.FOCUS));
|
1307
|
+
}
|
1308
|
+
|
1309
|
+
/**
|
1310
|
+
* Tests {@link goog.ui.Control#isOpen}.
|
1311
|
+
*/
|
1312
|
+
function testIsOpen() {
|
1313
|
+
assertFalse('Controls must not be open by default', control.isOpen());
|
1314
|
+
}
|
1315
|
+
|
1316
|
+
/**
|
1317
|
+
* Tests {@link goog.ui.Control#setOpen}.
|
1318
|
+
*/
|
1319
|
+
function testSetOpen() {
|
1320
|
+
control.setSupportedState(goog.ui.Component.State.OPENED, false);
|
1321
|
+
|
1322
|
+
control.setOpen(true);
|
1323
|
+
assertFalse('Control must not be opened, because it isn\'t openable',
|
1324
|
+
control.isOpen());
|
1325
|
+
assertTrue('Control must not have dispatched any events',
|
1326
|
+
noEventsDispatched());
|
1327
|
+
|
1328
|
+
control.setSupportedState(goog.ui.Component.State.OPENED, true);
|
1329
|
+
|
1330
|
+
control.setOpen(true);
|
1331
|
+
assertTrue('Control must be opened', control.isOpen());
|
1332
|
+
assertEquals('Control must have dispatched a OPEN event', 1,
|
1333
|
+
getEventCount(control, goog.ui.Component.EventType.OPEN));
|
1334
|
+
|
1335
|
+
control.setOpen(true);
|
1336
|
+
assertTrue('Control must still be opened', control.isOpen());
|
1337
|
+
assertEquals('Control must not dispatch more OPEN events', 1,
|
1338
|
+
getEventCount(control, goog.ui.Component.EventType.OPEN));
|
1339
|
+
|
1340
|
+
control.setOpen(false);
|
1341
|
+
assertFalse('Control must not be opened', control.isOpen());
|
1342
|
+
assertEquals('Control must have dispatched an CLOSE event', 1,
|
1343
|
+
getEventCount(control, goog.ui.Component.EventType.CLOSE));
|
1344
|
+
control.setEnabled(false);
|
1345
|
+
assertFalse('Control must be disabled', control.isEnabled());
|
1346
|
+
|
1347
|
+
control.setOpen(true);
|
1348
|
+
assertTrue('Control must be opened, even when disabled',
|
1349
|
+
control.isOpen());
|
1350
|
+
assertEquals('Control must have dispatched another OPEN event', 2,
|
1351
|
+
getEventCount(control, goog.ui.Component.EventType.OPEN));
|
1352
|
+
}
|
1353
|
+
|
1354
|
+
/**
|
1355
|
+
* Tests {@link goog.ui.Control#getState}.
|
1356
|
+
*/
|
1357
|
+
function testGetState() {
|
1358
|
+
assertEquals('Controls must be in the default state', 0x00,
|
1359
|
+
control.getState());
|
1360
|
+
}
|
1361
|
+
|
1362
|
+
/**
|
1363
|
+
* Tests {@link goog.ui.Control#hasState}.
|
1364
|
+
*/
|
1365
|
+
function testHasState() {
|
1366
|
+
assertFalse('Control must not be disabled',
|
1367
|
+
control.hasState(goog.ui.Component.State.DISABLED));
|
1368
|
+
assertFalse('Control must not be in the HOVER state',
|
1369
|
+
control.hasState(goog.ui.Component.State.HOVER));
|
1370
|
+
assertFalse('Control must not be active',
|
1371
|
+
control.hasState(goog.ui.Component.State.ACTIVE));
|
1372
|
+
assertFalse('Control must not be selected',
|
1373
|
+
control.hasState(goog.ui.Component.State.SELECTED));
|
1374
|
+
assertFalse('Control must not be checked',
|
1375
|
+
control.hasState(goog.ui.Component.State.CHECKED));
|
1376
|
+
assertFalse('Control must not be focused',
|
1377
|
+
control.hasState(goog.ui.Component.State.FOCUSED));
|
1378
|
+
assertFalse('Control must not be open',
|
1379
|
+
control.hasState(goog.ui.Component.State.OPEN));
|
1380
|
+
}
|
1381
|
+
|
1382
|
+
/**
|
1383
|
+
* Tests {@link goog.ui.Control#setState}.
|
1384
|
+
*/
|
1385
|
+
function testSetState() {
|
1386
|
+
control.createDom();
|
1387
|
+
control.setSupportedState(goog.ui.Component.State.ACTIVE, false);
|
1388
|
+
|
1389
|
+
assertFalse('Control must not be active',
|
1390
|
+
control.hasState(goog.ui.Component.State.ACTIVE));
|
1391
|
+
control.setState(goog.ui.Component.State.ACTIVE, true);
|
1392
|
+
assertFalse('Control must still be inactive (because it doesn\'t ' +
|
1393
|
+
'support the ACTIVE state)',
|
1394
|
+
control.hasState(goog.ui.Component.State.ACTIVE));
|
1395
|
+
|
1396
|
+
control.setSupportedState(goog.ui.Component.State.ACTIVE, true);
|
1397
|
+
|
1398
|
+
control.setState(goog.ui.Component.State.ACTIVE, true);
|
1399
|
+
assertTrue('Control must be active',
|
1400
|
+
control.hasState(goog.ui.Component.State.ACTIVE));
|
1401
|
+
assertTrue('Control must have the active CSS style',
|
1402
|
+
goog.dom.classes.has(control.getElement(), 'goog-control-active'));
|
1403
|
+
|
1404
|
+
control.setState(goog.ui.Component.State.ACTIVE, true);
|
1405
|
+
assertTrue('Control must still be active',
|
1406
|
+
control.hasState(goog.ui.Component.State.ACTIVE));
|
1407
|
+
assertTrue('Control must still have the active CSS style',
|
1408
|
+
goog.dom.classes.has(control.getElement(), 'goog-control-active'));
|
1409
|
+
|
1410
|
+
assertTrue('No events must have been dispatched', noEventsDispatched());
|
1411
|
+
}
|
1412
|
+
|
1413
|
+
/**
|
1414
|
+
* Tests {@link goog.ui.Control#setStateInternal}.
|
1415
|
+
*/
|
1416
|
+
function testSetStateInternal() {
|
1417
|
+
control.setStateInternal(0x00);
|
1418
|
+
assertEquals('State should be 0x00', 0x00, control.getState());
|
1419
|
+
control.setStateInternal(0x17);
|
1420
|
+
assertEquals('State should be 0x17', 0x17, control.getState());
|
1421
|
+
}
|
1422
|
+
|
1423
|
+
/**
|
1424
|
+
* Tests {@link goog.ui.Control#isSupportedState}.
|
1425
|
+
*/
|
1426
|
+
function testIsSupportedState() {
|
1427
|
+
assertTrue('Control must support DISABLED',
|
1428
|
+
control.isSupportedState(goog.ui.Component.State.DISABLED));
|
1429
|
+
assertTrue('Control must support HOVER',
|
1430
|
+
control.isSupportedState(goog.ui.Component.State.HOVER));
|
1431
|
+
assertTrue('Control must support ACTIVE',
|
1432
|
+
control.isSupportedState(goog.ui.Component.State.ACTIVE));
|
1433
|
+
assertTrue('Control must support FOCUSED',
|
1434
|
+
control.isSupportedState(goog.ui.Component.State.FOCUSED));
|
1435
|
+
assertFalse('Control must no support SELECTED',
|
1436
|
+
control.isSupportedState(goog.ui.Component.State.SELECTED));
|
1437
|
+
assertFalse('Control must no support CHECKED',
|
1438
|
+
control.isSupportedState(goog.ui.Component.State.CHECKED));
|
1439
|
+
assertFalse('Control must no support OPENED',
|
1440
|
+
control.isSupportedState(goog.ui.Component.State.OPENED));
|
1441
|
+
}
|
1442
|
+
|
1443
|
+
/**
|
1444
|
+
* Tests {@link goog.ui.Control#setSupportedState}.
|
1445
|
+
*/
|
1446
|
+
function testSetSupportedState() {
|
1447
|
+
control.setSupportedState(goog.ui.Component.State.HOVER, true);
|
1448
|
+
assertTrue('Control must still support HOVER',
|
1449
|
+
control.isSupportedState(goog.ui.Component.State.HOVER));
|
1450
|
+
|
1451
|
+
control.setSupportedState(goog.ui.Component.State.HOVER, false);
|
1452
|
+
assertFalse('Control must no longer support HOVER',
|
1453
|
+
control.isSupportedState(goog.ui.Component.State.HOVER));
|
1454
|
+
|
1455
|
+
control.setState(goog.ui.Component.State.ACTIVE, true);
|
1456
|
+
control.setSupportedState(goog.ui.Component.State.ACTIVE, false);
|
1457
|
+
assertFalse('Control must no longer support ACTIVE',
|
1458
|
+
control.isSupportedState(goog.ui.Component.State.ACTIVE));
|
1459
|
+
assertFalse('Control must no longer be in the ACTIVE state',
|
1460
|
+
control.hasState(goog.ui.Component.State.ACTIVE));
|
1461
|
+
|
1462
|
+
control.render(sandbox);
|
1463
|
+
|
1464
|
+
control.setSupportedState(goog.ui.Component.State.FOCUSED, true);
|
1465
|
+
control.setState(goog.ui.Component.State.FOCUSED, true);
|
1466
|
+
|
1467
|
+
assertThrows('Must not be able to disable support for the FOCUSED ' +
|
1468
|
+
"state for a control that's already in the document and focused",
|
1469
|
+
function() {
|
1470
|
+
control.setSupportedState(goog.ui.Component.State.FOCUSED, false);
|
1471
|
+
});
|
1472
|
+
|
1473
|
+
assertTrue('No events must have been dispatched', noEventsDispatched());
|
1474
|
+
}
|
1475
|
+
|
1476
|
+
|
1477
|
+
/**
|
1478
|
+
* Tests {@link goog.ui.Control#isAutoState}.
|
1479
|
+
*/
|
1480
|
+
function testIsAutoState() {
|
1481
|
+
assertTrue('Control must have DISABLED as an auto-state',
|
1482
|
+
control.isAutoState(goog.ui.Component.State.DISABLED));
|
1483
|
+
assertTrue('Control must have HOVER as an auto-state',
|
1484
|
+
control.isAutoState(goog.ui.Component.State.HOVER));
|
1485
|
+
assertTrue('Control must have ACTIVE as an auto-state',
|
1486
|
+
control.isAutoState(goog.ui.Component.State.ACTIVE));
|
1487
|
+
assertTrue('Control must have FOCUSED as an auto-state',
|
1488
|
+
control.isAutoState(goog.ui.Component.State.FOCUSED));
|
1489
|
+
|
1490
|
+
assertFalse('Control must not have SELECTED as an auto-state',
|
1491
|
+
control.isAutoState(goog.ui.Component.State.SELECTED));
|
1492
|
+
assertFalse('Control must not have CHECKED as an auto-state',
|
1493
|
+
control.isAutoState(goog.ui.Component.State.CHECKED));
|
1494
|
+
assertFalse('Control must not have OPENED as an auto-state',
|
1495
|
+
control.isAutoState(goog.ui.Component.State.OPENED));
|
1496
|
+
|
1497
|
+
assertTrue('No events must have been dispatched', noEventsDispatched());
|
1498
|
+
}
|
1499
|
+
|
1500
|
+
/**
|
1501
|
+
* Tests {@link goog.ui.Control#setAutoStates}.
|
1502
|
+
*/
|
1503
|
+
function testSetAutoStates() {
|
1504
|
+
control.setAutoStates(goog.ui.Component.State.HOVER, false);
|
1505
|
+
assertFalse('Control must not have HOVER as an auto-state',
|
1506
|
+
control.isAutoState(goog.ui.Component.State.HOVER));
|
1507
|
+
|
1508
|
+
control.setAutoStates(goog.ui.Component.State.ACTIVE |
|
1509
|
+
goog.ui.Component.State.FOCUSED, false);
|
1510
|
+
assertFalse('Control must not have ACTIVE as an auto-state',
|
1511
|
+
control.isAutoState(goog.ui.Component.State.ACTIVE));
|
1512
|
+
assertFalse('Control must not have FOCUSED as an auto-state',
|
1513
|
+
control.isAutoState(goog.ui.Component.State.FOCUSED));
|
1514
|
+
|
1515
|
+
control.setSupportedState(goog.ui.Component.State.FOCUSED, false);
|
1516
|
+
control.setAutoStates(goog.ui.Component.State.FOCUSED, true);
|
1517
|
+
assertFalse('Control must not have FOCUSED as an auto-state if it no ' +
|
1518
|
+
'longer supports FOCUSED',
|
1519
|
+
control.isAutoState(goog.ui.Component.State.FOCUSED));
|
1520
|
+
|
1521
|
+
assertTrue('No events must have been dispatched', noEventsDispatched());
|
1522
|
+
}
|
1523
|
+
|
1524
|
+
/**
|
1525
|
+
* Tests {@link goog.ui.Control#isDispatchTransitionEvents}.
|
1526
|
+
*/
|
1527
|
+
function testIsDispatchTransitionEvents() {
|
1528
|
+
assertTrue('Control must dispatch DISABLED transition events',
|
1529
|
+
control.isDispatchTransitionEvents(goog.ui.Component.State.DISABLED));
|
1530
|
+
assertTrue('Control must dispatch HOVER transition events',
|
1531
|
+
control.isDispatchTransitionEvents(goog.ui.Component.State.HOVER));
|
1532
|
+
assertTrue('Control must dispatch ACTIVE transition events',
|
1533
|
+
control.isDispatchTransitionEvents(goog.ui.Component.State.ACTIVE));
|
1534
|
+
assertTrue('Control must dispatch FOCUSED transition events',
|
1535
|
+
control.isDispatchTransitionEvents(goog.ui.Component.State.FOCUSED));
|
1536
|
+
|
1537
|
+
assertFalse('Control must not dispatch SELECTED transition events',
|
1538
|
+
control.isDispatchTransitionEvents(goog.ui.Component.State.SELECTED));
|
1539
|
+
assertFalse('Control must not dispatch CHECKED transition events',
|
1540
|
+
control.isDispatchTransitionEvents(goog.ui.Component.State.CHECKED));
|
1541
|
+
assertFalse('Control must not dispatch OPENED transition events',
|
1542
|
+
control.isDispatchTransitionEvents(goog.ui.Component.State.OPENED));
|
1543
|
+
|
1544
|
+
assertTrue('No events must have been dispatched', noEventsDispatched());
|
1545
|
+
}
|
1546
|
+
|
1547
|
+
/**
|
1548
|
+
* Tests {@link goog.ui.Control#setDispatchTransitionEvents}.
|
1549
|
+
*/
|
1550
|
+
function testSetDispatchTransitionEvents() {
|
1551
|
+
control.setDispatchTransitionEvents(goog.ui.Component.State.HOVER, false);
|
1552
|
+
assertFalse('Control must not dispatch HOVER transition events',
|
1553
|
+
control.isDispatchTransitionEvents(goog.ui.Component.State.HOVER));
|
1554
|
+
|
1555
|
+
control.setSupportedState(goog.ui.Component.State.SELECTED, true);
|
1556
|
+
control.setDispatchTransitionEvents(goog.ui.Component.State.SELECTED,
|
1557
|
+
true);
|
1558
|
+
assertTrue('Control must dispatch SELECTED transition events',
|
1559
|
+
control.isDispatchTransitionEvents(goog.ui.Component.State.SELECTED));
|
1560
|
+
|
1561
|
+
assertTrue('No events must have been dispatched', noEventsDispatched());
|
1562
|
+
}
|
1563
|
+
|
1564
|
+
/**
|
1565
|
+
* Tests {@link goog.ui.Control#isTransitionAllowed}.
|
1566
|
+
*/
|
1567
|
+
function testIsTransitionAllowed() {
|
1568
|
+
assertTrue('Control must support the HOVER state',
|
1569
|
+
control.isSupportedState(goog.ui.Component.State.HOVER));
|
1570
|
+
assertFalse('Control must not be in the HOVER state',
|
1571
|
+
control.hasState(goog.ui.Component.State.HOVER));
|
1572
|
+
assertTrue('Control must dispatch HOVER transition events',
|
1573
|
+
control.isDispatchTransitionEvents(goog.ui.Component.State.HOVER));
|
1574
|
+
|
1575
|
+
assertTrue('Control must be allowed to transition to the HOVER state',
|
1576
|
+
control.isTransitionAllowed(goog.ui.Component.State.HOVER, true));
|
1577
|
+
assertEquals('Control must have dispatched one HIGHLIGHT event', 1,
|
1578
|
+
getEventCount(control, goog.ui.Component.EventType.HIGHLIGHT));
|
1579
|
+
assertFalse('Control must not be highlighted',
|
1580
|
+
control.hasState(goog.ui.Component.State.HOVER));
|
1581
|
+
|
1582
|
+
control.setState(goog.ui.Component.State.HOVER, true);
|
1583
|
+
control.setDispatchTransitionEvents(goog.ui.Component.State.HOVER, false);
|
1584
|
+
|
1585
|
+
assertTrue('Control must be allowed to transition from the HOVER state',
|
1586
|
+
control.isTransitionAllowed(goog.ui.Component.State.HOVER, false));
|
1587
|
+
assertEquals('Control must not have dispatched any UNHIGHLIGHT events', 0,
|
1588
|
+
getEventCount(control, goog.ui.Component.EventType.UNHIGHLIGHT));
|
1589
|
+
assertTrue('Control must still be highlighted',
|
1590
|
+
control.hasState(goog.ui.Component.State.HOVER));
|
1591
|
+
|
1592
|
+
control.setSupportedState(goog.ui.Component.State.FOCUSED, false);
|
1593
|
+
resetEventCount();
|
1594
|
+
|
1595
|
+
assertFalse('Control doesn\'t support the FOCUSED state',
|
1596
|
+
control.isSupportedState(goog.ui.Component.State.FOCUSED));
|
1597
|
+
assertFalse('Control must not be FOCUSED',
|
1598
|
+
control.hasState(goog.ui.Component.State.FOCUSED));
|
1599
|
+
assertFalse('Control must not be allowed to transition to the FOCUSED ' +
|
1600
|
+
'state',
|
1601
|
+
control.isTransitionAllowed(goog.ui.Component.State.FOCUSED, true));
|
1602
|
+
assertEquals('Control must not have dispatched any FOCUS events', 0,
|
1603
|
+
getEventCount(control, goog.ui.Component.EventType.FOCUS));
|
1604
|
+
|
1605
|
+
control.setEnabled(false);
|
1606
|
+
resetEventCount();
|
1607
|
+
|
1608
|
+
assertTrue('Control must support the DISABLED state',
|
1609
|
+
control.isSupportedState(goog.ui.Component.State.DISABLED));
|
1610
|
+
assertTrue('Control must be DISABLED',
|
1611
|
+
control.hasState(goog.ui.Component.State.DISABLED));
|
1612
|
+
assertFalse('Control must not be allowed to transition to the DISABLED ' +
|
1613
|
+
'state, because it is already there',
|
1614
|
+
control.isTransitionAllowed(goog.ui.Component.State.DISABLED, true));
|
1615
|
+
assertEquals('Control must not have dispatched any ENABLE events', 0,
|
1616
|
+
getEventCount(control, goog.ui.Component.EventType.ENABLE));
|
1617
|
+
}
|
1618
|
+
|
1619
|
+
/**
|
1620
|
+
* Tests {@link goog.ui.Control#handleKeyEvent}.
|
1621
|
+
*/
|
1622
|
+
function testHandleKeyEvent() {
|
1623
|
+
control.render()
|
1624
|
+
control.isVisible = control.isEnabled = function() {
|
1625
|
+
return true;
|
1626
|
+
};
|
1627
|
+
|
1628
|
+
|
1629
|
+
goog.testing.events.fireKeySequence(
|
1630
|
+
control.getKeyEventTarget(), goog.events.KeyCodes.A);
|
1631
|
+
|
1632
|
+
assertEquals('Control must not have dispatched an ACTION event', 0,
|
1633
|
+
getEventCount(control, goog.ui.Component.EventType.ACTION));
|
1634
|
+
|
1635
|
+
goog.testing.events.fireKeySequence(
|
1636
|
+
control.getKeyEventTarget(), goog.events.KeyCodes.ENTER);
|
1637
|
+
assertEquals('Control must have dispatched an ACTION event', 1,
|
1638
|
+
getEventCount(control, goog.ui.Component.EventType.ACTION));
|
1639
|
+
}
|
1640
|
+
|
1641
|
+
|
1642
|
+
/**
|
1643
|
+
* Tests {@link goog.ui.Control#performActionInternal}.
|
1644
|
+
*/
|
1645
|
+
function testPerformActionInternal() {
|
1646
|
+
assertFalse('Control must not be checked', control.isChecked());
|
1647
|
+
assertFalse('Control must not be selected', control.isSelected());
|
1648
|
+
assertFalse('Control must not be open', control.isOpen());
|
1649
|
+
|
1650
|
+
control.performActionInternal();
|
1651
|
+
|
1652
|
+
assertFalse('Control must not be checked', control.isChecked());
|
1653
|
+
assertFalse('Control must not be selected', control.isSelected());
|
1654
|
+
assertFalse('Control must not be open', control.isOpen());
|
1655
|
+
assertEquals('Control must have dispatched an ACTION event', 1,
|
1656
|
+
getEventCount(control, goog.ui.Component.EventType.ACTION));
|
1657
|
+
|
1658
|
+
control.setSupportedState(goog.ui.Component.State.CHECKED, true);
|
1659
|
+
control.setSupportedState(goog.ui.Component.State.SELECTED, true);
|
1660
|
+
control.setSupportedState(goog.ui.Component.State.OPENED, true);
|
1661
|
+
|
1662
|
+
control.performActionInternal();
|
1663
|
+
|
1664
|
+
assertTrue('Control must be checked', control.isChecked());
|
1665
|
+
assertTrue('Control must be selected', control.isSelected());
|
1666
|
+
assertTrue('Control must be open', control.isOpen());
|
1667
|
+
assertEquals('Control must have dispatched a CHECK event', 1,
|
1668
|
+
getEventCount(control, goog.ui.Component.EventType.CHECK));
|
1669
|
+
assertEquals('Control must have dispatched a SELECT event', 1,
|
1670
|
+
getEventCount(control, goog.ui.Component.EventType.SELECT));
|
1671
|
+
assertEquals('Control must have dispatched a OPEN event', 1,
|
1672
|
+
getEventCount(control, goog.ui.Component.EventType.OPEN));
|
1673
|
+
assertEquals('Control must have dispatched another ACTION event', 2,
|
1674
|
+
getEventCount(control, goog.ui.Component.EventType.ACTION));
|
1675
|
+
|
1676
|
+
control.performActionInternal();
|
1677
|
+
|
1678
|
+
assertFalse('Control must not be checked', control.isChecked());
|
1679
|
+
assertTrue('Control must be selected', control.isSelected());
|
1680
|
+
assertFalse('Control must not be open', control.isOpen());
|
1681
|
+
assertEquals('Control must have dispatched an UNCHECK event', 1,
|
1682
|
+
getEventCount(control, goog.ui.Component.EventType.UNCHECK));
|
1683
|
+
assertEquals('Control must not have dispatched an UNSELECT event', 0,
|
1684
|
+
getEventCount(control, goog.ui.Component.EventType.UNSELECT));
|
1685
|
+
assertEquals('Control must have dispatched a CLOSE event', 1,
|
1686
|
+
getEventCount(control, goog.ui.Component.EventType.CLOSE));
|
1687
|
+
assertEquals('Control must have dispatched another ACTION event', 3,
|
1688
|
+
getEventCount(control, goog.ui.Component.EventType.ACTION));
|
1689
|
+
}
|
1690
|
+
|
1691
|
+
/**
|
1692
|
+
* Tests {@link goog.ui.Control#handleMouseOver}.
|
1693
|
+
*/
|
1694
|
+
function testHandleMouseOver() {
|
1695
|
+
control.setContent(goog.dom.createDom('span', {id: 'caption'}, 'Hello'));
|
1696
|
+
control.render(sandbox);
|
1697
|
+
|
1698
|
+
var element = control.getElement();
|
1699
|
+
var caption = goog.dom.getElement('caption');
|
1700
|
+
|
1701
|
+
// Verify baseline assumptions.
|
1702
|
+
assertTrue('Caption must be contained within the control',
|
1703
|
+
goog.dom.contains(element, caption));
|
1704
|
+
assertTrue('Control must be enabled', control.isEnabled());
|
1705
|
+
assertTrue('HOVER must be an auto-state',
|
1706
|
+
control.isAutoState(goog.ui.Component.State.HOVER));
|
1707
|
+
assertFalse('Control must not start out highlighted',
|
1708
|
+
control.isHighlighted());
|
1709
|
+
|
1710
|
+
// Scenario 1: relatedTarget is contained within the control's DOM.
|
1711
|
+
goog.testing.events.fireMouseOverEvent(element, caption);
|
1712
|
+
assertTrue('No events must have been dispatched for internal mouse move',
|
1713
|
+
noEventsDispatched());
|
1714
|
+
assertFalse('Control must not be highlighted for internal mouse move',
|
1715
|
+
control.isHighlighted());
|
1716
|
+
resetEventCount();
|
1717
|
+
|
1718
|
+
// Scenario 2: preventDefault() is called on the ENTER event.
|
1719
|
+
var key = goog.events.listen(control, goog.ui.Component.EventType.ENTER,
|
1720
|
+
function(e) {
|
1721
|
+
e.preventDefault();
|
1722
|
+
});
|
1723
|
+
goog.testing.events.fireMouseOverEvent(element, sandbox);
|
1724
|
+
assertEquals('Control must have dispatched 1 ENTER event', 1,
|
1725
|
+
getEventCount(control, goog.ui.Component.EventType.ENTER));
|
1726
|
+
assertFalse('Control must not be highlighted if ENTER is canceled',
|
1727
|
+
control.isHighlighted());
|
1728
|
+
goog.events.unlistenByKey(key);
|
1729
|
+
resetEventCount();
|
1730
|
+
|
1731
|
+
// Scenario 3: Control is disabled.
|
1732
|
+
control.setEnabled(false);
|
1733
|
+
goog.testing.events.fireMouseOverEvent(element, sandbox);
|
1734
|
+
assertEquals('Control must dispatch ENTER event on mouseover even if ' +
|
1735
|
+
'disabled', 1,
|
1736
|
+
getEventCount(control, goog.ui.Component.EventType.ENTER));
|
1737
|
+
assertFalse('Control must not be highlighted if it is disabled',
|
1738
|
+
control.isHighlighted());
|
1739
|
+
control.setEnabled(true);
|
1740
|
+
resetEventCount();
|
1741
|
+
|
1742
|
+
// Scenario 4: HOVER is not an auto-state.
|
1743
|
+
control.setAutoStates(goog.ui.Component.State.HOVER, false);
|
1744
|
+
goog.testing.events.fireMouseOverEvent(element, sandbox);
|
1745
|
+
assertEquals('Control must dispatch ENTER event on mouseover even if ' +
|
1746
|
+
'HOVER is not an auto-state', 1,
|
1747
|
+
getEventCount(control, goog.ui.Component.EventType.ENTER));
|
1748
|
+
assertFalse('Control must not be highlighted if HOVER isn\'t an auto-' +
|
1749
|
+
'state', control.isHighlighted());
|
1750
|
+
control.setAutoStates(goog.ui.Component.State.HOVER, true);
|
1751
|
+
resetEventCount();
|
1752
|
+
|
1753
|
+
// Scenario 5: All is well.
|
1754
|
+
goog.testing.events.fireMouseOverEvent(element, sandbox);
|
1755
|
+
assertEquals('Control must dispatch ENTER event on mouseover', 1,
|
1756
|
+
getEventCount(control, goog.ui.Component.EventType.ENTER));
|
1757
|
+
assertEquals('Control must dispatch HIGHLIGHT event on mouseover', 1,
|
1758
|
+
getEventCount(control, goog.ui.Component.EventType.HIGHLIGHT));
|
1759
|
+
assertTrue('Control must be highlighted', control.isHighlighted());
|
1760
|
+
resetEventCount();
|
1761
|
+
|
1762
|
+
// Scenario 6: relatedTarget is null
|
1763
|
+
control.setHighlighted(false);
|
1764
|
+
goog.testing.events.fireMouseOverEvent(element, null);
|
1765
|
+
assertEquals('Control must dispatch ENTER event on mouseover', 1,
|
1766
|
+
getEventCount(control, goog.ui.Component.EventType.ENTER));
|
1767
|
+
assertEquals('Control must dispatch HIGHLIGHT event on mouseover', 1,
|
1768
|
+
getEventCount(control, goog.ui.Component.EventType.HIGHLIGHT));
|
1769
|
+
assertTrue('Control must be highlighted', control.isHighlighted());
|
1770
|
+
resetEventCount();
|
1771
|
+
}
|
1772
|
+
|
1773
|
+
/**
|
1774
|
+
* Tests {@link goog.ui.Control#handleMouseOut}.
|
1775
|
+
*/
|
1776
|
+
function testHandleMouseOut() {
|
1777
|
+
control.setContent(goog.dom.createDom('span', {id: 'caption'}, 'Hello'));
|
1778
|
+
control.setHighlighted(true);
|
1779
|
+
control.setActive(true);
|
1780
|
+
|
1781
|
+
resetEventCount();
|
1782
|
+
|
1783
|
+
control.render(sandbox);
|
1784
|
+
|
1785
|
+
var element = control.getElement();
|
1786
|
+
var caption = goog.dom.getElement('caption');
|
1787
|
+
|
1788
|
+
// Verify baseline assumptions.
|
1789
|
+
assertTrue('Caption must be contained within the control',
|
1790
|
+
goog.dom.contains(element, caption));
|
1791
|
+
assertTrue('Control must be enabled', control.isEnabled());
|
1792
|
+
assertTrue('HOVER must be an auto-state',
|
1793
|
+
control.isAutoState(goog.ui.Component.State.HOVER));
|
1794
|
+
assertTrue('ACTIVE must be an auto-state',
|
1795
|
+
control.isAutoState(goog.ui.Component.State.ACTIVE));
|
1796
|
+
assertTrue('Control must start out highlighted', control.isHighlighted());
|
1797
|
+
assertTrue('Control must start out active', control.isActive());
|
1798
|
+
|
1799
|
+
// Scenario 1: relatedTarget is contained within the control's DOM.
|
1800
|
+
goog.testing.events.fireMouseOutEvent(element, caption);
|
1801
|
+
assertTrue('No events must have been dispatched for internal mouse move',
|
1802
|
+
noEventsDispatched());
|
1803
|
+
assertTrue('Control must not be un-highlighted for internal mouse move',
|
1804
|
+
control.isHighlighted());
|
1805
|
+
assertTrue('Control must not be deactivated for internal mouse move',
|
1806
|
+
control.isActive());
|
1807
|
+
resetEventCount();
|
1808
|
+
|
1809
|
+
// Scenario 2: preventDefault() is called on the LEAVE event.
|
1810
|
+
var key = goog.events.listen(control, goog.ui.Component.EventType.LEAVE,
|
1811
|
+
function(e) {
|
1812
|
+
e.preventDefault();
|
1813
|
+
});
|
1814
|
+
goog.testing.events.fireMouseOutEvent(element, sandbox);
|
1815
|
+
assertEquals('Control must have dispatched 1 LEAVE event', 1,
|
1816
|
+
getEventCount(control, goog.ui.Component.EventType.LEAVE));
|
1817
|
+
assertTrue('Control must not be un-highlighted if LEAVE is canceled',
|
1818
|
+
control.isHighlighted());
|
1819
|
+
assertTrue('Control must not be deactivated if LEAVE is canceled',
|
1820
|
+
control.isActive());
|
1821
|
+
goog.events.unlistenByKey(key);
|
1822
|
+
resetEventCount();
|
1823
|
+
|
1824
|
+
// Scenario 3: ACTIVE is not an auto-state.
|
1825
|
+
control.setAutoStates(goog.ui.Component.State.ACTIVE, false);
|
1826
|
+
goog.testing.events.fireMouseOutEvent(element, sandbox);
|
1827
|
+
assertEquals('Control must dispatch LEAVE event on mouseout even if ' +
|
1828
|
+
'ACTIVE is not an auto-state', 1,
|
1829
|
+
getEventCount(control, goog.ui.Component.EventType.LEAVE));
|
1830
|
+
assertTrue('Control must not be deactivated if ACTIVE isn\'t an auto-' +
|
1831
|
+
'state', control.isActive());
|
1832
|
+
assertFalse('Control must be un-highlighted even if ACTIVE isn\'t an ' +
|
1833
|
+
'auto-state', control.isHighlighted());
|
1834
|
+
control.setAutoStates(goog.ui.Component.State.ACTIVE, true);
|
1835
|
+
control.setHighlighted(true);
|
1836
|
+
resetEventCount();
|
1837
|
+
|
1838
|
+
// Scenario 4: HOVER is not an auto-state.
|
1839
|
+
control.setAutoStates(goog.ui.Component.State.HOVER, false);
|
1840
|
+
goog.testing.events.fireMouseOutEvent(element, sandbox);
|
1841
|
+
assertEquals('Control must dispatch LEAVE event on mouseout even if ' +
|
1842
|
+
'HOVER is not an auto-state', 1,
|
1843
|
+
getEventCount(control, goog.ui.Component.EventType.LEAVE));
|
1844
|
+
assertFalse('Control must be deactivated even if HOVER isn\'t an auto-' +
|
1845
|
+
'state', control.isActive());
|
1846
|
+
assertTrue('Control must not be un-highlighted if HOVER isn\'t an auto-' +
|
1847
|
+
'state', control.isHighlighted());
|
1848
|
+
control.setAutoStates(goog.ui.Component.State.HOVER, true);
|
1849
|
+
control.setActive(true);
|
1850
|
+
resetEventCount();
|
1851
|
+
|
1852
|
+
// Scenario 5: All is well.
|
1853
|
+
goog.testing.events.fireMouseOutEvent(element, sandbox);
|
1854
|
+
assertEquals('Control must dispatch LEAVE event on mouseout', 1,
|
1855
|
+
getEventCount(control, goog.ui.Component.EventType.LEAVE));
|
1856
|
+
assertEquals('Control must dispatch DEACTIVATE event on mouseout', 1,
|
1857
|
+
getEventCount(control, goog.ui.Component.EventType.DEACTIVATE));
|
1858
|
+
assertEquals('Control must dispatch UNHIGHLIGHT event on mouseout', 1,
|
1859
|
+
getEventCount(control, goog.ui.Component.EventType.UNHIGHLIGHT));
|
1860
|
+
assertFalse('Control must be deactivated', control.isActive());
|
1861
|
+
assertFalse('Control must be unhighlighted', control.isHighlighted());
|
1862
|
+
resetEventCount();
|
1863
|
+
|
1864
|
+
// Scenario 6: relatedTarget is null
|
1865
|
+
control.setActive(true);
|
1866
|
+
control.setHighlighted(true);
|
1867
|
+
goog.testing.events.fireMouseOutEvent(element, null);
|
1868
|
+
assertEquals('Control must dispatch LEAVE event on mouseout', 1,
|
1869
|
+
getEventCount(control, goog.ui.Component.EventType.LEAVE));
|
1870
|
+
assertEquals('Control must dispatch DEACTIVATE event on mouseout', 1,
|
1871
|
+
getEventCount(control, goog.ui.Component.EventType.DEACTIVATE));
|
1872
|
+
assertEquals('Control must dispatch UNHIGHLIGHT event on mouseout', 1,
|
1873
|
+
getEventCount(control, goog.ui.Component.EventType.UNHIGHLIGHT));
|
1874
|
+
assertFalse('Control must be deactivated', control.isActive());
|
1875
|
+
assertFalse('Control must be unhighlighted', control.isHighlighted());
|
1876
|
+
resetEventCount();
|
1877
|
+
}
|
1878
|
+
|
1879
|
+
function testIsMouseEventWithinElement() {
|
1880
|
+
var child = goog.dom.createElement('div');
|
1881
|
+
var parent = goog.dom.createDom('div', null, child);
|
1882
|
+
var notChild = goog.dom.createElement('div');
|
1883
|
+
|
1884
|
+
var event = new goog.testing.events.Event('mouseout');
|
1885
|
+
event.relatedTarget = child;
|
1886
|
+
assertTrue('Event is within element',
|
1887
|
+
goog.ui.Control.isMouseEventWithinElement_(event, parent));
|
1888
|
+
|
1889
|
+
var event = new goog.testing.events.Event('mouseout');
|
1890
|
+
event.relatedTarget = notChild;
|
1891
|
+
assertFalse('Event is not within element',
|
1892
|
+
goog.ui.Control.isMouseEventWithinElement_(event, parent));
|
1893
|
+
}
|
1894
|
+
|
1895
|
+
function testHandleMouseDown() {
|
1896
|
+
control.render(sandbox);
|
1897
|
+
assertFalse('preventDefault() must have been called for control that ' +
|
1898
|
+
'doesn\'t support text selection',
|
1899
|
+
fireMouseDownAndFocus(control.getElement()));
|
1900
|
+
assertTrue('Control must be highlighted', control.isHighlighted());
|
1901
|
+
assertTrue('Control must be active', control.isActive());
|
1902
|
+
|
1903
|
+
if (testFocus) {
|
1904
|
+
// Expected to fail on IE and Mac Safari 3. IE calls focus handlers
|
1905
|
+
// asynchronously, and Mac Safari 3 doesn't support keyboard focus.
|
1906
|
+
expectedFailures.expectFailureFor(goog.userAgent.IE);
|
1907
|
+
expectedFailures.expectFailureFor(isMacSafari3());
|
1908
|
+
try {
|
1909
|
+
assertTrue('Control must be focused', control.isFocused());
|
1910
|
+
} catch (e) {
|
1911
|
+
expectedFailures.handleException(e);
|
1912
|
+
}
|
1913
|
+
}
|
1914
|
+
}
|
1915
|
+
|
1916
|
+
function testHandleMouseDownForDisabledControl() {
|
1917
|
+
control.setEnabled(false);
|
1918
|
+
control.render(sandbox);
|
1919
|
+
assertFalse('preventDefault() must have been called for control that ' +
|
1920
|
+
'doesn\'t support text selection',
|
1921
|
+
fireMouseDownAndFocus(control.getElement()));
|
1922
|
+
assertFalse('Control must not be highlighted', control.isHighlighted());
|
1923
|
+
assertFalse('Control must not be active', control.isActive());
|
1924
|
+
if (testFocus) {
|
1925
|
+
assertFalse('Control must not be focused', control.isFocused());
|
1926
|
+
}
|
1927
|
+
}
|
1928
|
+
|
1929
|
+
function testHandleMouseDownForNoHoverAutoState() {
|
1930
|
+
control.setAutoStates(goog.ui.Component.State.HOVER, false);
|
1931
|
+
control.render(sandbox);
|
1932
|
+
assertFalse('preventDefault() must have been called for control that ' +
|
1933
|
+
'doesn\'t support text selection',
|
1934
|
+
fireMouseDownAndFocus(control.getElement()));
|
1935
|
+
assertFalse('Control must not be highlighted', control.isHighlighted());
|
1936
|
+
assertTrue('Control must be active', control.isActive());
|
1937
|
+
|
1938
|
+
if (testFocus) {
|
1939
|
+
// Expected to fail on IE and Mac Safari 3. IE calls focus handlers
|
1940
|
+
// asynchronously, and Mac Safari 3 doesn't support keyboard focus.
|
1941
|
+
expectedFailures.expectFailureFor(goog.userAgent.IE);
|
1942
|
+
expectedFailures.expectFailureFor(isMacSafari3());
|
1943
|
+
try {
|
1944
|
+
assertTrue('Control must be focused', control.isFocused());
|
1945
|
+
} catch (e) {
|
1946
|
+
expectedFailures.handleException(e);
|
1947
|
+
}
|
1948
|
+
}
|
1949
|
+
}
|
1950
|
+
|
1951
|
+
function testHandleMouseDownForRightMouseButton() {
|
1952
|
+
control.render(sandbox);
|
1953
|
+
assertTrue('preventDefault() must not have been called for right ' +
|
1954
|
+
'mouse button', fireMouseDownAndFocus(control.getElement(),
|
1955
|
+
goog.events.BrowserEvent.MouseButton.RIGHT));
|
1956
|
+
assertTrue('Control must be highlighted', control.isHighlighted());
|
1957
|
+
assertFalse('Control must not be active', control.isActive());
|
1958
|
+
|
1959
|
+
if (testFocus) {
|
1960
|
+
// Expected to fail on IE and Mac Safari 3. IE calls focus handlers
|
1961
|
+
// asynchronously, and Mac Safari 3 doesn't support keyboard focus.
|
1962
|
+
expectedFailures.expectFailureFor(goog.userAgent.IE);
|
1963
|
+
expectedFailures.expectFailureFor(isMacSafari3());
|
1964
|
+
try {
|
1965
|
+
assertTrue('Control must be focused', control.isFocused());
|
1966
|
+
} catch (e) {
|
1967
|
+
expectedFailures.handleException(e);
|
1968
|
+
}
|
1969
|
+
}
|
1970
|
+
}
|
1971
|
+
|
1972
|
+
function testHandleMouseDownForNoActiveAutoState() {
|
1973
|
+
control.setAutoStates(goog.ui.Component.State.ACTIVE, false);
|
1974
|
+
control.render(sandbox);
|
1975
|
+
assertFalse('preventDefault() must have been called for control that ' +
|
1976
|
+
'doesn\'t support text selection',
|
1977
|
+
fireMouseDownAndFocus(control.getElement()));
|
1978
|
+
assertTrue('Control must be highlighted', control.isHighlighted());
|
1979
|
+
assertFalse('Control must not be active', control.isActive());
|
1980
|
+
|
1981
|
+
if (testFocus) {
|
1982
|
+
// Expected to fail on IE and Mac Safari 3. IE calls focus handlers
|
1983
|
+
// asynchronously, and Mac Safari 3 doesn't support keyboard focus.
|
1984
|
+
expectedFailures.expectFailureFor(goog.userAgent.IE);
|
1985
|
+
expectedFailures.expectFailureFor(isMacSafari3());
|
1986
|
+
try {
|
1987
|
+
assertTrue('Control must be focused', control.isFocused());
|
1988
|
+
} catch (e) {
|
1989
|
+
expectedFailures.handleException(e);
|
1990
|
+
}
|
1991
|
+
}
|
1992
|
+
}
|
1993
|
+
|
1994
|
+
function testHandleMouseDownForNonFocusableControl() {
|
1995
|
+
control.setSupportedState(goog.ui.Component.State.FOCUSED, false);
|
1996
|
+
control.render(sandbox);
|
1997
|
+
assertFalse('preventDefault() must have been called for control that ' +
|
1998
|
+
'doesn\'t support text selection',
|
1999
|
+
fireMouseDownAndFocus(control.getElement()));
|
2000
|
+
assertTrue('Control must be highlighted', control.isHighlighted());
|
2001
|
+
assertTrue('Control must be active', control.isActive());
|
2002
|
+
assertFalse('Control must not be focused', control.isFocused());
|
2003
|
+
}
|
2004
|
+
|
2005
|
+
// TODO(user): Find out why this is flaky on FF2/Linux and FF1.5/Win.
|
2006
|
+
//function testHandleMouseDownForSelectableControl() {
|
2007
|
+
// control.setAllowTextSelection(true);
|
2008
|
+
// control.render(sandbox);
|
2009
|
+
// assertTrue('preventDefault() must not have been called for control ' +
|
2010
|
+
// 'that supports text selection',
|
2011
|
+
// fireMouseDownAndFocus(control.getElement()));
|
2012
|
+
// assertTrue('Control must be highlighted', control.isHighlighted());
|
2013
|
+
// assertTrue('Control must be active', control.isActive());
|
2014
|
+
// // Expected to fail on IE and Mac Safari 3. IE calls focus handlers
|
2015
|
+
// // asynchronously, and Mac Safari 3 doesn't support keyboard focus.
|
2016
|
+
// expectedFailures.expectFailureFor(goog.userAgent.IE);
|
2017
|
+
// expectedFailures.expectFailureFor(isMacSafari3());
|
2018
|
+
// try {
|
2019
|
+
// assertTrue('Control must be focused', control.isFocused());
|
2020
|
+
// } catch (e) {
|
2021
|
+
// expectedFailures.handleException(e);
|
2022
|
+
// }
|
2023
|
+
//}
|
2024
|
+
|
2025
|
+
|
2026
|
+
/**
|
2027
|
+
* Tests {@link goog.ui.Control#handleMouseUp}.
|
2028
|
+
*/
|
2029
|
+
function testHandleMouseUp() {
|
2030
|
+
control.setActive(true);
|
2031
|
+
|
2032
|
+
// Override performActionInternal() for testing purposes.
|
2033
|
+
var actionPerformed = false;
|
2034
|
+
control.performActionInternal = function() {
|
2035
|
+
actionPerformed = true;
|
2036
|
+
return true;
|
2037
|
+
};
|
2038
|
+
|
2039
|
+
resetEventCount();
|
2040
|
+
|
2041
|
+
control.render(sandbox);
|
2042
|
+
var element = control.getElement();
|
2043
|
+
|
2044
|
+
// Verify baseline assumptions.
|
2045
|
+
assertTrue('Control must be enabled', control.isEnabled());
|
2046
|
+
assertTrue('HOVER must be an auto-state',
|
2047
|
+
control.isAutoState(goog.ui.Component.State.HOVER));
|
2048
|
+
assertTrue('ACTIVE must be an auto-state',
|
2049
|
+
control.isAutoState(goog.ui.Component.State.ACTIVE));
|
2050
|
+
assertFalse('Control must not start out highlighted',
|
2051
|
+
control.isHighlighted());
|
2052
|
+
assertTrue('Control must start out active', control.isActive());
|
2053
|
+
|
2054
|
+
// Scenario 1: Control is disabled.
|
2055
|
+
control.setEnabled(false);
|
2056
|
+
goog.testing.events.fireMouseUpEvent(element);
|
2057
|
+
assertFalse('Disabled control must not highlight on mouseup',
|
2058
|
+
control.isHighlighted());
|
2059
|
+
assertFalse('No action must have been performed', actionPerformed);
|
2060
|
+
control.setActive(true);
|
2061
|
+
control.setEnabled(true);
|
2062
|
+
|
2063
|
+
// Scenario 2: HOVER is not an auto-state.
|
2064
|
+
control.setAutoStates(goog.ui.Component.State.HOVER, false);
|
2065
|
+
goog.testing.events.fireMouseUpEvent(element);
|
2066
|
+
assertFalse('Control must not highlight on mouseup if HOVER isn\'t an ' +
|
2067
|
+
'auto-state', control.isHighlighted());
|
2068
|
+
assertTrue('Action must have been performed even if HOVER isn\'t an ' +
|
2069
|
+
'auto-state', actionPerformed);
|
2070
|
+
assertFalse('Control must have been deactivated on mouseup even if ' +
|
2071
|
+
'HOVER isn\'t an auto-state', control.isActive());
|
2072
|
+
actionPerformed = false;
|
2073
|
+
control.setActive(true);
|
2074
|
+
control.setAutoStates(goog.ui.Component.State.HOVER, true);
|
2075
|
+
|
2076
|
+
// Scenario 3: Control is not active.
|
2077
|
+
control.setActive(false);
|
2078
|
+
goog.testing.events.fireMouseUpEvent(element);
|
2079
|
+
assertTrue('Control must highlight on mouseup, even if inactive',
|
2080
|
+
control.isHighlighted());
|
2081
|
+
assertFalse('No action must have been performed if control is inactive',
|
2082
|
+
actionPerformed);
|
2083
|
+
assertFalse('Inactive control must remain inactive after mouseup',
|
2084
|
+
control.isActive());
|
2085
|
+
control.setHighlighted(false);
|
2086
|
+
control.setActive(true);
|
2087
|
+
|
2088
|
+
// Scenario 4: performActionInternal() returns false.
|
2089
|
+
control.performActionInternal = function() {
|
2090
|
+
actionPerformed = true;
|
2091
|
+
return false;
|
2092
|
+
};
|
2093
|
+
goog.testing.events.fireMouseUpEvent(element);
|
2094
|
+
assertTrue('Control must highlight on mouseup, even if no action is ' +
|
2095
|
+
'performed', control.isHighlighted());
|
2096
|
+
assertTrue('performActionInternal must have been called',
|
2097
|
+
actionPerformed);
|
2098
|
+
assertTrue('Control must not deactivate if performActionInternal ' +
|
2099
|
+
'returns false', control.isActive());
|
2100
|
+
control.setHighlighted(false);
|
2101
|
+
actionPerformed = false;
|
2102
|
+
control.performActionInternal = function() {
|
2103
|
+
actionPerformed = true;
|
2104
|
+
return true;
|
2105
|
+
};
|
2106
|
+
|
2107
|
+
// Scenario 5: ACTIVE is not an auto-state.
|
2108
|
+
control.setAutoStates(goog.ui.Component.State.ACTIVE, false);
|
2109
|
+
goog.testing.events.fireMouseUpEvent(element);
|
2110
|
+
assertTrue('Control must highlight on mouseup even if ACTIVE isn\'t an ' +
|
2111
|
+
'auto-state', control.isHighlighted());
|
2112
|
+
assertTrue('Action must have been performed even if ACTIVE isn\'t an ' +
|
2113
|
+
'auto-state', actionPerformed);
|
2114
|
+
assertTrue('Control must not have been deactivated on mouseup if ' +
|
2115
|
+
'ACTIVE isn\'t an auto-state', control.isActive());
|
2116
|
+
actionPerformed = false;
|
2117
|
+
control.setHighlighted(false);
|
2118
|
+
control.setAutoStates(goog.ui.Component.State.ACTIVE, true);
|
2119
|
+
|
2120
|
+
// Scenario 6: All is well.
|
2121
|
+
goog.testing.events.fireMouseUpEvent(element);
|
2122
|
+
assertTrue('Control must highlight on mouseup', control.isHighlighted());
|
2123
|
+
assertTrue('Action must have been performed', actionPerformed);
|
2124
|
+
assertFalse('Control must have been deactivated', control.isActive());
|
2125
|
+
}
|
2126
|
+
</script>
|
2127
|
+
</body>
|
2128
|
+
</html>
|