def testProcess(self): """Tests the Process function on a Chrome autofill entries database.""" plugin = chrome_autofill.ChromeAutofillPlugin() storage_writer = self._ParseDatabaseFileWithPlugin( ['Web Data'], plugin) self.assertEqual(storage_writer.number_of_warnings, 0) self.assertEqual(storage_writer.number_of_events, 4) events = list(storage_writer.GetEvents()) event = events[2] self.CheckTimestamp(event.timestamp, '2018-08-17 19:35:51.000000') self.assertEqual( event.timestamp_desc, definitions.TIME_DESCRIPTION_CREATION) self.assertEqual(event.field_name, 'repo') self.assertEqual(event.value, 'log2timeline/plaso') self.assertEqual(event.usage_count, 1) expected_message = ( 'Form field name: repo ' 'Entered value: log2timeline/plaso ' 'Times used: 1') expected_short_message = ( 'repo: log2timeline/plaso (1)') self._TestGetMessageStrings(event, expected_message, expected_short_message)
def testProcess(self): """Tests the Process function on a Chrome autofill entries database.""" plugin = chrome_autofill.ChromeAutofillPlugin() storage_writer = self._ParseDatabaseFileWithPlugin(['Web Data'], plugin) number_of_events = storage_writer.GetNumberOfAttributeContainers('event') self.assertEqual(number_of_events, 4) number_of_warnings = storage_writer.GetNumberOfAttributeContainers( 'extraction_warning') self.assertEqual(number_of_warnings, 0) number_of_warnings = storage_writer.GetNumberOfAttributeContainers( 'recovery_warning') self.assertEqual(number_of_warnings, 0) events = list(storage_writer.GetEvents()) expected_event_values = { 'data_type': 'chrome:autofill:entry', 'date_time': '2018-08-17 19:35:51', 'field_name': 'repo', 'timestamp_desc': definitions.TIME_DESCRIPTION_CREATION, 'usage_count': 1, 'value': 'log2timeline/plaso'} self.CheckEventValues(storage_writer, events[2], expected_event_values)