def test_action_success(self): jd = copy.deepcopy(cannonical_json_dump) jd['crashing_thread']['frames'][1]['function'] = ( "F_1152915508___________________________________") jd['crashing_thread']['frames'][3]['function'] = ( "mozilla::plugins::PluginInstanceChild::UpdateWindowAttributes" "(bool)") jd['crashing_thread']['frames'][5]['function'] = ( "mozilla::ipc::RPCChannel::Call(IPC::Message*, IPC::Message*)") pc = DotDict() pc.process_type = 'plugin' pc.json_dump = jd fake_processor = create_basic_fake_processor() rc = DotDict() rd = {} rule = UpdateWindowAttributes() action_result = rule.action(rc, rd, pc, fake_processor) ok_(action_result) ok_('classifications' in pc) ok_('skunk_works' in pc['classifications'])
def test_action_wrong_order(self): jd = copy.deepcopy(cannonical_json_dump) jd['crashing_thread']['frames'][4]['function'] = ( "F_1152915508___________________________________" ) jd['crashing_thread']['frames'][3]['function'] = ( "mozilla::plugins::PluginInstanceChild::UpdateWindowAttributes" "(bool)" ) jd['crashing_thread']['frames'][5]['function'] = ( "mozilla::ipc::RPCChannel::Call(IPC::Message*, IPC::Message*)" ) pc = DotDict() pc.dump = DotDict() pc.dump.json_dump = jd fake_processor = create_basic_fake_processor() rc = DotDict() rd = {} rule = UpdateWindowAttributes() action_result = rule.action(rc, rd, pc, fake_processor) ok_(not action_result) ok_('classifications' not in pc)
def test_action_success(self): jd = copy.deepcopy(cannonical_json_dump) jd["crashing_thread"]["frames"][1]["function"] = "F_1152915508___________________________________" jd["crashing_thread"]["frames"][3]["function"] = ( "mozilla::plugins::PluginInstanceChild::UpdateWindowAttributes" "(bool)" ) jd["crashing_thread"]["frames"][5]["function"] = "mozilla::ipc::RPCChannel::Call(IPC::Message*, IPC::Message*)" pc = DotDict() pc.process_type = "plugin" pc.json_dump = jd fake_processor = create_basic_fake_processor() rc = DotDict() rule = UpdateWindowAttributes() action_result = rule.action(rc, pc, fake_processor) ok_(action_result) ok_("classifications" in pc) ok_("skunk_works" in pc["classifications"])
def test_action_wrong_order(self): jd = copy.deepcopy(cannonical_json_dump) jd['crashing_thread']['frames'][4]['function'] = \ "F_1152915508___________________________________" jd['crashing_thread']['frames'][3]['function'] = \ "mozilla::plugins::PluginInstanceChild::UpdateWindowAttributes" \ "(bool)" jd['crashing_thread']['frames'][5]['function'] = \ "mozilla::ipc::RPCChannel::Call(IPC::Message*, IPC::Message*)" pc = DotDict() pc.dump = DotDict() pc.dump.json_dump = jd fake_processor = create_basic_fake_processor() rc = DotDict() rd = {} rule = UpdateWindowAttributes() action_result = rule.action(rc, rd, pc, fake_processor) ok_(not action_result) ok_(not 'classifications' in pc)
def test_action_wrong_order(self): jd = copy.deepcopy(cannonical_json_dump) jd['threads'][0]['frames'][4]['function'] = \ "F_1152915508___________________________________" jd['threads'][0]['frames'][3]['function'] = \ "mozilla::plugins::PluginInstanceChild::UpdateWindowAttributes" \ "(bool)" jd['threads'][0]['frames'][5]['function'] = \ "mozilla::ipc::RPCChannel::Call(IPC::Message*, IPC::Message*)" pc = DotDict() pc.dump = DotDict() pc.dump.json_dump = jd fake_processor = create_basic_fake_processor() rc = DotDict() rule = UpdateWindowAttributes() action_result = rule.action(rc, pc, fake_processor) self.assertFalse(action_result) self.assertFalse('classifications' in pc)
def test_action_success(self): jd = copy.deepcopy(cannonical_json_dump) jd['crashing_thread']['frames'][1]['function'] = \ "F_1152915508___________________________________" jd['crashing_thread']['frames'][3]['function'] = \ "mozilla::plugins::PluginInstanceChild::UpdateWindowAttributes" \ "(bool)" jd['crashing_thread']['frames'][5]['function'] = \ "mozilla::ipc::RPCChannel::Call(IPC::Message*, IPC::Message*)" pc = DotDict() pc.process_type = 'plugin' pc.json_dump = jd fake_processor = create_basic_fake_processor() rc = DotDict() rd = {} rule = UpdateWindowAttributes() action_result = rule.action(rc, rd, pc, fake_processor) ok_(action_result) ok_('classifications' in pc) ok_('skunk_works' in pc['classifications'])