Fri, 16 Jan 2015 18:13:44 +0100
Integrate suggestion from review to improve consistency with existing code.
michael@0 | 1 | "use strict"; |
michael@0 | 2 | |
michael@0 | 3 | function run_test() { |
michael@0 | 4 | do_test_pending(); |
michael@0 | 5 | run_next_test(); |
michael@0 | 6 | } |
michael@0 | 7 | |
michael@0 | 8 | /** |
michael@0 | 9 | * Test to ensure that deprecation warning is issued on use |
michael@0 | 10 | * of creationDate. |
michael@0 | 11 | */ |
michael@0 | 12 | add_task(function test_deprecatedCreationDate () { |
michael@0 | 13 | let deferred = Promise.defer(); |
michael@0 | 14 | let consoleListener = { |
michael@0 | 15 | observe: function (aMessage) { |
michael@0 | 16 | if(aMessage.message.indexOf("Field 'creationDate' is deprecated.") > -1) { |
michael@0 | 17 | do_print("Deprecation message printed"); |
michael@0 | 18 | do_check_true(true); |
michael@0 | 19 | Services.console.unregisterListener(consoleListener); |
michael@0 | 20 | deferred.resolve(); |
michael@0 | 21 | } |
michael@0 | 22 | } |
michael@0 | 23 | }; |
michael@0 | 24 | let currentDir = yield OS.File.getCurrentDirectory(); |
michael@0 | 25 | let path = OS.Path.join(currentDir, "test_creationDate.js"); |
michael@0 | 26 | |
michael@0 | 27 | Services.console.registerListener(consoleListener); |
michael@0 | 28 | (yield OS.File.stat(path)).creationDate; |
michael@0 | 29 | }); |
michael@0 | 30 | |
michael@0 | 31 | add_task(do_test_finished); |