Bug 971964 - Disable places low level tests in OSX 10.6. r=evold, a=test-only
authorJordan Santell <jsantell@mozilla.com>
Thu, 27 Mar 2014 17:51:51 -0400
changeset 192353 b8da42fcc3021b8f77b7ad2b72562b98acf5e318
parent 192352 63835526742f5c46e079fea87b11d33a42eada28
child 192354 80553357e2da86192ad9634812398d1d818c684c
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersevold, test-only
bugs971964
milestone30.0a2
Bug 971964 - Disable places low level tests in OSX 10.6. r=evold, a=test-only
addon-sdk/source/test/addons/places/main.js
addon-sdk/source/test/addons/places/tests/test-places-events.js
--- a/addon-sdk/source/test/addons/places/main.js
+++ b/addon-sdk/source/test/addons/places/main.js
@@ -6,18 +6,18 @@
 
 const { safeMerge: merge } = require('sdk/util/object');
 const app = require("sdk/system/xul-app");
 
 // Once Bug 903018 is resolved, just move the application testing to
 // module.metadata.engines
 if (app.is('Firefox')) {
   merge(module.exports,
+    require('./tests/test-places-events'),
     require('./tests/test-places-bookmarks'),
-    require('./tests/test-places-events'),
     require('./tests/test-places-favicon'),
     require('./tests/test-places-history'),
     require('./tests/test-places-host'),
     require('./tests/test-places-utils')
   );
 } else {
   exports['test unsupported'] = (assert) => {
     assert.pass('This application is unsupported.');
--- a/addon-sdk/source/test/addons/places/tests/test-places-events.js
+++ b/addon-sdk/source/test/addons/places/tests/test-places-events.js
@@ -13,16 +13,23 @@ const { Cc, Ci } = require('chrome');
 const { defer, all } = require('sdk/core/promise');
 const { filter } = require('sdk/event/utils');
 const { on, off } = require('sdk/event/core');
 const { events } = require('sdk/places/events');
 const { setTimeout } = require('sdk/timers');
 const { before, after } = require('sdk/test/utils');
 const bmsrv = Cc['@mozilla.org/browser/nav-bookmarks-service;1'].
                 getService(Ci.nsINavBookmarksService);
+const { release, platform } = require('node/os');
+
+const isOSX10_6 = (() => {
+  let vString = release();
+  return vString && /darwin/.test(platform()) && /10\.6/.test(vString);
+})();
+
 const {
   search
 } = require('sdk/places/history');
 const {
   invalidResolve, invalidReject, createTree, createBookmark,
   compareWithHost, addVisits, resetPlaces, createBookmarkItem,
   removeVisits
 } = require('../places-helper');
@@ -46,16 +53,24 @@ exports['test bookmark-item-added'] = fu
   }
   events.on('data', handler);
   createBookmark({ title: 'bookmark-added-title' });
 };
 
 exports['test bookmark-item-changed'] = function (assert, done) {
   let id;
   let complete = makeCompleted(done);
+
+  // Due to bug 969616 and bug 971964, disabling tests in 10.6 (happens only
+  // in debug builds) to prevent intermittent failures
+  if (isOSX10_6) {
+    assert.ok(true, 'skipping test in OSX 10.6'); 
+    return done();
+  }
+
   function handler ({type, data}) {
     if (type !== 'bookmark-item-changed') return;
     if (data.id !== id) return;
     // Abort if the 'bookmark-item-changed' event isn't for the `title` property,
     // as sometimes the event can be for the `url` property.
     // Intermittent failure, bug 969616
     if (data.property !== 'title') return;
 
@@ -82,16 +97,23 @@ exports['test bookmark-item-changed'] = 
   }).then(complete);
 };
 
 exports['test bookmark-item-moved'] = function (assert, done) {
   let id;
   let complete = makeCompleted(done);
   let previousIndex, previousParentId;
 
+  // Due to bug 969616 and bug 971964, disabling tests in 10.6 (happens only
+  // in debug builds) to prevent intermittent failures
+  if (isOSX10_6) {
+    assert.ok(true, 'skipping test in OSX 10.6'); 
+    return done();
+  }
+
   function handler ({type, data}) {
     if (type !== 'bookmark-item-moved') return;
     if (data.id !== id) return;
     assert.equal(type, 'bookmark-item-moved',
       'correct type in bookmark-item-moved event');
     assert.equal(data.type, 'bookmark',
       'correct data in bookmark-item-moved event');
     assert.ok(data.id === id, 'correct id in bookmark-item-moved event');
@@ -208,17 +230,17 @@ exports['test history-start-batch, histo
   }
   function clearHandler ({type, data}) {
     assert.pass('history-start-clear called');
     assert.equal(type, 'history-start-clear',
       'history-start-clear has correct type');
     off(clearEvent, 'data', clearHandler);
     complete();
   }
- 
+
   on(startEvent, 'data', startHandler);
   on(clearEvent, 'data', clearHandler);
 
   createBookmark().then(() => {
     resetPlaces(complete);
   })
 };