Refactored testPanelEventOrder to be more readable.
authorAtul Varma <varmaa@gmail.com>
Tue, 30 Nov 2010 11:06:04 -0500
changeset 1145 efa7427d1e534283374b4bc4772ebac363471ca3
parent 1144 1900e011ac17b15ab3bc781e47d2c30ab197f814
child 1146 39c67ae4303d7aba3688731115b937ee6716be5b
push id471
push userbwarner@mozilla.com
push dateTue, 30 Nov 2010 22:30:12 +0000
Refactored testPanelEventOrder to be more readable.
packages/addon-kit/tests/test-panel.js
--- a/packages/addon-kit/tests/test-panel.js
+++ b/packages/addon-kit/tests/test-panel.js
@@ -141,20 +141,21 @@ tests.testPanelEventOrder = function(tes
 
   function when(event, cb) {
     panel.on(event, function() {
       test.assertEqual(event, expectedEvents.shift());
       require("timer").setTimeout(cb, 1);
     });
   }
 
-  when('hide', function() { test.done(); });
+  test.waitUntilDone();
+
+  when('inited', function() { panel.show(); });
   when('show', function() { panel.destroy(); });
-  when('inited', function() { panel.show(); });
-  test.waitUntilDone();
+  when('hide', function() { test.done(); });
 };
 
 tests.testContentURLOption = function(test) {
   const URL_STRING = "about:buildconfig";
   const HTML_CONTENT = "<html><title>Test</title><p>This is a test.</p></html>";
 
   let (panel = Panel({ contentURL: URL_STRING })) {
     test.pass("contentURL accepts a string URL.");