| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import base64 | 5 import base64 |
| 6 import json | 6 import json |
| 7 import os | 7 import os |
| 8 import re | 8 import re |
| 9 | 9 |
| 10 import webapp2 | 10 import webapp2 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 def testAnalysisScheduled(self): | 28 def testAnalysisScheduled(self): |
| 29 requested_crashes = [] | 29 requested_crashes = [] |
| 30 self._MockScheduleNewAnalysisForCrash(requested_crashes) | 30 self._MockScheduleNewAnalysisForCrash(requested_crashes) |
| 31 self.mock_current_user(user_email='test@chromium.org', is_admin=True) | 31 self.mock_current_user(user_email='test@chromium.org', is_admin=True) |
| 32 | 32 |
| 33 channel = 'supported_channel' | 33 channel = 'supported_channel' |
| 34 platform = 'supported_platform' | 34 platform = 'supported_platform' |
| 35 signature = 'signature/here' | 35 signature = 'signature/here' |
| 36 stack_trace = 'frame1\nframe2\nframe3' | 36 stack_trace = 'frame1\nframe2\nframe3' |
| 37 chrome_version = '50.2500.0.0' | 37 chrome_version = '50.2500.0.0' |
| 38 versions_to_cpm = [['50.2500.0.0']] | 38 versions_to_historical = [{"chrome_version": '50.2500.0.0', "cpm": 0.6}] |
| 39 | 39 |
| 40 request_json_data = { | 40 request_json_data = { |
| 41 'message': { | 41 'message': { |
| 42 'data': base64.b64encode(json.dumps({ | 42 'data': base64.b64encode(json.dumps({ |
| 43 'channel': channel, | 43 "customized_data": { |
| 44 'platform': platform, | 44 "channel": "supported_channel", |
| 45 'signature': signature, | 45 "versions_to_historical": [ |
| 46 'stack_trace': stack_trace, | 46 { |
| 47 'chrome_version': chrome_version, | 47 "chrome_version": "50.2500.0.0", |
| 48 'versions_to_cpm': versions_to_cpm, | 48 "cpm": 0.6 |
| 49 }, |
| 50 ] |
| 51 }, |
| 52 "chrome_version": "50.2500.0.0", |
| 53 "signature": "signature/here", |
| 54 "client_id": "fracas", |
| 55 "platform": "supported_platform", |
| 56 "crash_identifiers": { |
| 57 "chrome_version": "50.2500.0.0", |
| 58 "signature": "signature/here", |
| 59 "channel": "supported_channel", |
| 60 "platform": "supported_platform", |
| 61 "process_type": None |
| 62 }, |
| 63 "stack_trace": "frame1\nframe2\nframe3" |
| 49 })), | 64 })), |
| 50 'message_id': 'id', | 65 'message_id': 'id', |
| 51 }, | 66 }, |
| 52 'subscription': 'subscription', | 67 'subscription': 'subscription', |
| 53 } | 68 } |
| 54 | 69 |
| 55 self.test_app.post_json('/_ah/push-handlers/crash/fracas', | 70 self.test_app.post_json('/_ah/push-handlers/crash/fracas', |
| 56 request_json_data) | 71 request_json_data) |
| 57 | 72 |
| 58 self.assertEqual(1, len(requested_crashes)) | 73 self.assertEqual(1, len(requested_crashes)) |
| 59 self.assertEqual( | 74 self.assertEqual( |
| 60 (channel, platform, signature, stack_trace, | 75 (channel, platform, signature, stack_trace, |
| 61 chrome_version, versions_to_cpm), | 76 chrome_version, versions_to_historical), |
| 62 requested_crashes[0]) | 77 requested_crashes[0]) |
| OLD | NEW |