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 | /* Any copyright is dedicated to the Public Domain. |
michael@0 | 2 | http://creativecommons.org/publicdomain/zero/1.0/ */ |
michael@0 | 3 | |
michael@0 | 4 | /* |
michael@0 | 5 | * test_nodb: Start search engine |
michael@0 | 6 | * - without search-metadata.json |
michael@0 | 7 | * - without search.sqlite |
michael@0 | 8 | * |
michael@0 | 9 | * Ensure that : |
michael@0 | 10 | * - nothing explodes; |
michael@0 | 11 | * - no search-metadata.json is created. |
michael@0 | 12 | */ |
michael@0 | 13 | |
michael@0 | 14 | |
michael@0 | 15 | function run_test() |
michael@0 | 16 | { |
michael@0 | 17 | removeMetadata(); |
michael@0 | 18 | updateAppInfo(); |
michael@0 | 19 | |
michael@0 | 20 | let search = Services.search; |
michael@0 | 21 | |
michael@0 | 22 | do_test_pending(); |
michael@0 | 23 | search.init(function ss_initialized(rv) { |
michael@0 | 24 | do_check_true(Components.isSuccessCode(rv)); |
michael@0 | 25 | do_timeout(500, function() { |
michael@0 | 26 | // Check that search-metadata.json has not been |
michael@0 | 27 | // created. Note that we cannot do much better |
michael@0 | 28 | // than a timeout for checking a non-event. |
michael@0 | 29 | let metadata = gProfD.clone(); |
michael@0 | 30 | metadata.append("search-metadata.json"); |
michael@0 | 31 | do_check_true(!metadata.exists()); |
michael@0 | 32 | removeMetadata(); |
michael@0 | 33 | |
michael@0 | 34 | do_test_finished(); |
michael@0 | 35 | }); |
michael@0 | 36 | }); |
michael@0 | 37 | } |