'Test we can parse a standard file.'

def testBasicParsingOldFormat(self):

    history_file = os.path.join(self.base_path, 'parser_test', 'History')
    history = chrome_history.ChromeParser(open(history_file, 'rb'))
    entries = [x for x in history.Parse()]
    try:
        dt1 = datetime.datetime(1970, 1, 1)
        dt1 += datetime.timedelta(microseconds=entries[0][0])
    except (TypeError, ValueError):
        dt1 = entries[0][0]
    try:
        dt2 = datetime.datetime(1970, 1, 1)
        dt2 += datetime.timedelta(microseconds=entries[(-1)][0])
    except (TypeError, ValueError):
        dt2 = entries[(-1)][0]
    time_results = [x[0] for x in entries]
    self.assertEqual(time_results, sorted(time_results))
    self.assertEqual(str(dt1), '2011-04-07    12:03:11')
    self.assertEqual(entries[0][2], 'http://start.ubuntu.com/10.04/Google/')
    self.assertEqual(str(dt2), '2011-05-23    08:37:27.061516')
    self.assertTrue(entries[(-1)][2].startswith('https://chrome.google.com/webstore/detail/mfjkgbjaikamkkojmakjclmkianficch'))
    self.assertEqual(len(entries), 71)
