mobile/android/base/tests/roboextender/robocop_prompt_gridinput.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/mobile/android/base/tests/roboextender/robocop_prompt_gridinput.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,51 @@
     1.4 +<html>
     1.5 +  <head>
     1.6 +    <title>IconGrid test page</title>
     1.7 +    <meta name="viewport" content="initial-scale=1.0"/>
     1.8 +    <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
     1.9 +    <script type="application/javascript">
    1.10 +Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
    1.11 +Components.utils.import("resource://gre/modules/Services.jsm");
    1.12 +Components.utils.import("resource://gre/modules/Prompt.jsm");
    1.13 +
    1.14 +function start() {
    1.15 +  var test = location.hash.substring(1);
    1.16 +  window[test]();
    1.17 +}
    1.18 +
    1.19 +function test1() {
    1.20 +  var p = new Prompt({
    1.21 +    title: "Prompt 1",
    1.22 +    buttons: [
    1.23 +      "OK"
    1.24 +    ],
    1.25 +  }).addIconGrid({
    1.26 +    items: [
    1.27 +      { iconUri: "drawable://alert_app", name: "Icon 1", selected: true },
    1.28 +      { iconUri: "drawable://alert_download", name: "Icon 2" },
    1.29 +      { iconUri: "drawable://alert_addon", name: "Icon 3" },
    1.30 +      { iconUri: "drawable://alert_addon", name: "Icon 4" },
    1.31 +      { iconUri: "drawable://alert_addon", name: "Icon 5" },
    1.32 +      { iconUri: "drawable://alert_addon", name: "Icon 6" },
    1.33 +      { iconUri: "drawable://alert_addon", name: "Icon 7" },
    1.34 +      { iconUri: "drawable://alert_addon", name: "Icon 8" },
    1.35 +      { iconUri: "drawable://alert_addon", name: "Icon 9" },
    1.36 +      { iconUri: "drawable://alert_addon", name: "Icon 10" },
    1.37 +      { iconUri: "drawable://alert_addon", name: "Icon 11" },
    1.38 +    ]
    1.39 +  });
    1.40 +  p.show(function(data) {
    1.41 +    sendResult(data.icongrid0 == 10, "Got result " + data.icongrid0);
    1.42 +  });
    1.43 +}
    1.44 +
    1.45 +function sendResult(pass, message) {
    1.46 +  setTimeout(function() {
    1.47 +    alert((pass ? "PASS " : "FAIL ") + message);
    1.48 +  }, 1000);
    1.49 +}
    1.50 +    </script>
    1.51 +  </head>
    1.52 +  <body onload="start();">
    1.53 +  </body>
    1.54 +</html>

mercurial