示例#1
0
 def test_in(self):
     """Test getting frame in file."""
     lines = [
         'char_upper_api in file_path.cc',
         ('base::IsValueInRangeForNumericType<int>( std::floor(rect.x()'
          ' * x_scale)) in rect')
     ]
     self.assertEqual(show.get_stack_frames(lines), [
         'char_upper_api',
         ('base::IsValueInRangeForNumericType<int>( std::floor(rect.x()'
          ' * x_scale))')
     ])
示例#2
0
 def test_bad_cast(self):
     """Test getting bad-cast."""
     lines = [
         'Bad-cast to content::RenderWidgetHostViewChildFrame1',
         'Bad-cast to content::RenderWidgetHostViewChildFrame1 from',
         ('Bad-cast to content::RenderWidgetHostViewChildFrame1 from'
          ' content::RenderWidgetHostViewAura'),
         ('Bad-cast to base::IsValueInRangeForNumericType<int>('
          ' std::floor(rect.x() * x_scale)) from invalid ptr')
     ]
     self.assertEqual(show.get_stack_frames(lines), [
         'content::RenderWidgetHostViewChildFrame1',
         'content::RenderWidgetHostViewChildFrame1',
         'content::RenderWidgetHostViewChildFrame1',
         ('base::IsValueInRangeForNumericType<int>( std::floor(rect.x()'
          ' * x_scale))'),
     ])
示例#3
0
 def test_normal(self):
     """Test getting normal crash state."""
     self.assertEqual(show.get_stack_frames(['testtest']), ['testtest'])