| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2015 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import app | 6 import app |
| 7 | 7 |
| 8 from tests import cb | 8 from tests import cb |
| 9 | 9 |
| 10 | 10 |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 | 175 |
| 176 # Uncomment if deeper inspection is needed of the returned console. | 176 # Uncomment if deeper inspection is needed of the returned console. |
| 177 # import logging | 177 # import logging |
| 178 # logging.debug('foo') | 178 # logging.debug('foo') |
| 179 # self.write_file('exp_merged.html', act_merged) | 179 # self.write_file('exp_merged.html', act_merged) |
| 180 # import code | 180 # import code |
| 181 # code.interact(local=locals()) | 181 # code.interact(local=locals()) |
| 182 | 182 |
| 183 self.assertEquals(self.read_file('exp_merged.html'), act_merged, | 183 self.assertEquals(self.read_file('exp_merged.html'), act_merged, |
| 184 'Unexpected console output found') | 184 'Unexpected console output found') |
| 185 |
| 186 def test_console_utf8_devcomment(self): |
| 187 """Test that a console DevComment row with a UTF-8 character is retained.""" |
| 188 for master in ['mac']: |
| 189 page_data = {'content': self.read_file('in_%s.html' % master)} |
| 190 app.parse_master( |
| 191 localpath='chromium.%s/console' % master, |
| 192 remoteurl='http://build.chromium.org/p/chromium.%s/console' % master, |
| 193 page_data=page_data) |
| 194 |
| 195 # Get the expected and real output, compare. |
| 196 app.console_merger( |
| 197 'chromium/console', '', {}, |
| 198 masters_to_merge=[ |
| 199 'chromium.mac', |
| 200 ], |
| 201 num_rows_to_merge=20) |
| 202 act_merged = app.get_and_cache_pagedata('chromium/console')['content'] |
| 203 |
| 204 # Uncomment if deeper inspection is needed of the returned console. |
| 205 # import logging |
| 206 # logging.debug('foo') |
| 207 # self.write_file('exp_merged.html', act_merged.encode('utf-8')) |
| 208 # import code |
| 209 # code.interact(local=locals()) |
| 210 |
| 211 self.assertEquals(self.read_file('exp_merged.html').decode('utf-8'), |
| 212 act_merged, 'Unexpected console output found') |
| OLD | NEW |