| OLD | NEW |
| 1 /** | 1 /** |
| 2 * Mock implementation of the budget service. | 2 * Mock implementation of the budget service. |
| 3 */ | 3 */ |
| 4 | 4 |
| 5 "use strict"; | 5 "use strict"; |
| 6 | 6 |
| 7 const TEST_BUDGET_COST = 1.2; | 7 const TEST_BUDGET_COST = 1.2; |
| 8 const TEST_BUDGET_AT = 2.3; | 8 const TEST_BUDGET_AT = 2; |
| 9 const TEST_BUDGET_TIME = new Date().getTime(); | 9 const TEST_BUDGET_TIME = new Date().getTime(); |
| 10 | 10 |
| 11 let budgetServiceMock = loadMojoModules( | 11 let budgetServiceMock = loadMojoModules( |
| 12 'budgetServiceMock', | 12 'budgetServiceMock', |
| 13 ['third_party/WebKit/public/platform/modules/budget_service/budget_service.m
ojom', | 13 ['third_party/WebKit/public/platform/modules/budget_service/budget_service.m
ojom', |
| 14 'mojo/public/js/bindings' | 14 'mojo/public/js/bindings' |
| 15 ]).then(mojo => { | 15 ]).then(mojo => { |
| 16 const [budgetService, bindings] = mojo.modules; | 16 const [budgetService, bindings] = mojo.modules; |
| 17 | 17 |
| 18 class BudgetServiceMock { | 18 class BudgetServiceMock { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 return Promise.resolve({ error_type: this.error_, budget: this.budget_ }); | 83 return Promise.resolve({ error_type: this.error_, budget: this.budget_ }); |
| 84 } | 84 } |
| 85 | 85 |
| 86 // This provides an implementation for the Mojo serivce reserve call. | 86 // This provides an implementation for the Mojo serivce reserve call. |
| 87 reserve() { | 87 reserve() { |
| 88 return Promise.resolve({ error_type: this.error_, success: this.success_ }
); | 88 return Promise.resolve({ error_type: this.error_, success: this.success_ }
); |
| 89 } | 89 } |
| 90 } | 90 } |
| 91 return new BudgetServiceMock(mojo.interfaces); | 91 return new BudgetServiceMock(mojo.interfaces); |
| 92 }); | 92 }); |
| OLD | NEW |