Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | <!-- |
michael@0 | 2 | Any copyright is dedicated to the Public Domain. |
michael@0 | 3 | http://creativecommons.org/publicdomain/zero/1.0/ |
michael@0 | 4 | --> |
michael@0 | 5 | <!DOCTYPE HTML> |
michael@0 | 6 | <html> |
michael@0 | 7 | <!-- |
michael@0 | 8 | https://bugzilla.mozilla.org/show_bug.cgi?id=717103 |
michael@0 | 9 | --> |
michael@0 | 10 | <head> |
michael@0 | 11 | <title>Test for basic sanity of the device storage API </title> |
michael@0 | 12 | <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 13 | <script type="text/javascript" src="devicestorage_common.js"></script> |
michael@0 | 14 | |
michael@0 | 15 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> |
michael@0 | 16 | </head> |
michael@0 | 17 | <body> |
michael@0 | 18 | <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=717103">Mozilla Bug 717103</a> |
michael@0 | 19 | <p id="display"></p> |
michael@0 | 20 | <div id="content" style="display: none"> |
michael@0 | 21 | |
michael@0 | 22 | </div> |
michael@0 | 23 | <pre id="test"> |
michael@0 | 24 | <script class="testbody" type="text/javascript"> |
michael@0 | 25 | |
michael@0 | 26 | devicestorage_setup() |
michael@0 | 27 | |
michael@0 | 28 | ok(navigator.getDeviceStorage, "Should have getDeviceStorage"); |
michael@0 | 29 | |
michael@0 | 30 | var storage; |
michael@0 | 31 | |
michael@0 | 32 | var throws = false; |
michael@0 | 33 | try { |
michael@0 | 34 | storage = navigator.getDeviceStorage(); |
michael@0 | 35 | } catch(e) {throws = true} |
michael@0 | 36 | ok(throws, "getDeviceStorage takes one arg"); |
michael@0 | 37 | |
michael@0 | 38 | storage = navigator.getDeviceStorage("kilimanjaro"); |
michael@0 | 39 | ok(!storage, "kilimanjaro - Should not have this type of storage"); |
michael@0 | 40 | |
michael@0 | 41 | storage = navigator.getDeviceStorage("pictures"); |
michael@0 | 42 | ok(storage, "pictures - Should have getDeviceStorage"); |
michael@0 | 43 | |
michael@0 | 44 | storage = navigator.getDeviceStorage("music"); |
michael@0 | 45 | ok(storage, "music - Should have getDeviceStorage"); |
michael@0 | 46 | |
michael@0 | 47 | storage = navigator.getDeviceStorage("videos"); |
michael@0 | 48 | ok(storage, "videos - Should have getDeviceStorage"); |
michael@0 | 49 | |
michael@0 | 50 | var cursor = storage.enumerate(); |
michael@0 | 51 | ok(cursor, "Should have a non-null cursor"); |
michael@0 | 52 | |
michael@0 | 53 | devicestorage_cleanup(); |
michael@0 | 54 | |
michael@0 | 55 | </script> |
michael@0 | 56 | </pre> |
michael@0 | 57 | </body> |
michael@0 | 58 | </html> |
michael@0 | 59 |