var main = require('main');
var tabs = require('sdk/tabs');

exports.testBug = function (test) {
test.waitUntilDone();

var tab = tabs.open('http://www.yahoo.com');
//var tab2 = tabs.open('about:home');
//tab.activate();
tabs.on('ready', function (tab) {
  if (tab.url == 'http://www.yahoo.com') {
    tab.url = 'http://messenger.yahoo.com/';
    
  } else {
    tabs.activeTab.attach({contentScript:
               "window.history.back();" 
                          });
    require("sdk/timers").setTimeout(function () { 
      test.assert(true);
      test.done();
      }, 2000);

    //tab.close();
  }

});

};