| 1 | <!DOCTYPE html> |
| 2 | <html lang="en"> |
| 3 | <head> |
| 4 | <meta http-equiv="Content-type" content="text/html; charset=utf-8"> |
| 5 | <title>TooltipDialog non-robot Automated Test</title> |
| 6 | |
| 7 | <script src="boilerplate.js"></script> |
| 8 | |
| 9 | <script type="text/javascript"> |
| 10 | require([ |
| 11 | "doh/runner", "dojo/dom-class", "dojo/dom-geometry", "dojo/_base/window", |
| 12 | "dijit/popup", "dijit/form/DropDownButton", "dijit/TooltipDialog", |
| 13 | "dojo/domReady!" |
| 14 | ], function(doh, domClass, domGeometry, win, popup, DropDownButton, TooltipDialog){ |
| 15 | doh.register("TooltipDialog", [ |
| 16 | function create(){ |
| 17 | td = new TooltipDialog({ |
| 18 | id:"mytooltip", |
| 19 | content: "hello world" |
| 20 | }); |
| 21 | button = new DropDownButton({ |
| 22 | id: "tooltipDropDownButton", |
| 23 | label: "show tooltip", |
| 24 | dropDown: td |
| 25 | }); |
| 26 | button.placeAt(win.body()); |
| 27 | }, |
| 28 | function openAround(){ |
| 29 | button.openDropDown(); |
| 30 | doh.t(domClass.contains(td.domNode, "dijitTooltipBelow"), "dijitTooltipBelow"); |
| 31 | button.closeDropDown(); |
| 32 | }, |
| 33 | function openAt(){ |
| 34 | popup.open({ |
| 35 | popup: td, |
| 36 | x: 10, |
| 37 | y: 15 |
| 38 | }); |
| 39 | |
| 40 | var popupCoords = domGeometry.position(td.domNode); |
| 41 | doh.is(10, popupCoords.x, "popup x coord"); |
| 42 | doh.is(15, popupCoords.y, "popup y coord"); |
| 43 | doh.t(domClass.contains(td.domNode, "dijitTooltipBelow"), "dijitTooltipBelow"); |
| 44 | doh.t(domClass.contains(td.domNode, "dijitTooltipABLeft"), "dijitTooltipABLeft"); |
| 45 | |
| 46 | popup.close(td); |
| 47 | } |
| 48 | ]); |
| 49 | |
| 50 | doh.run(); |
| 51 | }); |
| 52 | </script> |
| 53 | </head> |
| 54 | <body class="claro" role="main"> |
| 55 | </body> |
| 56 | </html> |