| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 unittest | 5 import unittest |
| 6 | 6 |
| 7 # pylint: disable=F0401 | 7 # pylint: disable=F0401 |
| 8 from mojo.bindings import promise | 8 from mojo_bindings import promise |
| 9 | 9 |
| 10 | 10 |
| 11 class PromiseTest(unittest.TestCase): | 11 class PromiseTest(unittest.TestCase): |
| 12 | 12 |
| 13 def setUp(self): | 13 def setUp(self): |
| 14 self.accumulated = [] | 14 self.accumulated = [] |
| 15 | 15 |
| 16 def _AddToAccumulated(self, res): | 16 def _AddToAccumulated(self, res): |
| 17 self.accumulated.append(res) | 17 self.accumulated.append(res) |
| 18 return res | 18 return res |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 functions = {} | 172 functions = {} |
| 173 def GeneratorFunction(resolve, reject): | 173 def GeneratorFunction(resolve, reject): |
| 174 functions['resolve'] = resolve | 174 functions['resolve'] = resolve |
| 175 functions['reject'] = reject | 175 functions['reject'] = reject |
| 176 p = promise.Promise(GeneratorFunction) | 176 p = promise.Promise(GeneratorFunction) |
| 177 return (p, functions['resolve'], functions['reject']) | 177 return (p, functions['resolve'], functions['reject']) |
| 178 | 178 |
| 179 | 179 |
| 180 def _ThrowException(x): | 180 def _ThrowException(x): |
| 181 raise RuntimeError(x) | 181 raise RuntimeError(x) |
| OLD | NEW |