| 
									
										
										
										
											2016-08-03 15:00:07 -07:00
										 |  |  | /** | 
					
						
							|  |  |  |  * @license | 
					
						
							|  |  |  |  * Copyright Google Inc. All Rights Reserved. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Use of this source code is governed by an MIT-style license that can be | 
					
						
							|  |  |  |  * found in the LICENSE file at https://angular.io/license
 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-27 14:57:54 -07:00
										 |  |  | import {Options} from './common'; | 
					
						
							| 
									
										
										
										
											2015-03-06 11:46:33 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-02 09:23:09 -08:00
										 |  |  | export * from './common'; | 
					
						
							| 
									
										
										
										
											2015-05-27 14:57:54 -07:00
										 |  |  | export {SeleniumWebDriverAdapter} from './src/webdriver/selenium_webdriver_adapter'; | 
					
						
							| 
									
										
										
										
											2015-03-06 11:46:33 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  | var fs = require('fs'); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-06 17:34:27 -08:00
										 |  |  | // TODO(tbosch): right now we bind the `writeFile` method
 | 
					
						
							|  |  |  | // in benchpres/benchpress.es6. This does not work for Dart,
 | 
					
						
							|  |  |  | // find another way...
 | 
					
						
							|  |  |  | // Note: Can't do the `require` call in a facade as it can't be loaded into the browser
 | 
					
						
							|  |  |  | // for our unit tests via karma.
 | 
					
						
							| 
									
										
										
										
											2016-06-02 17:30:40 -07:00
										 |  |  | Options.DEFAULT_PROVIDERS.push({provide: Options.WRITE_FILE, useValue: writeFile}); | 
					
						
							| 
									
										
										
										
											2015-03-06 11:46:33 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-27 14:57:54 -07:00
										 |  |  | function writeFile(filename, content): Promise<any> { | 
					
						
							| 
									
										
										
										
											2015-03-06 11:46:33 -08:00
										 |  |  |   return new Promise(function(resolve, reject) { | 
					
						
							|  |  |  |     fs.writeFile(filename, content, (error) => { | 
					
						
							|  |  |  |       if (error) { | 
					
						
							|  |  |  |         reject(error); | 
					
						
							|  |  |  |       } else { | 
					
						
							|  |  |  |         resolve(); | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  |     }); | 
					
						
							| 
									
										
										
										
											2016-08-03 15:00:07 -07:00
										 |  |  |   }); | 
					
						
							| 
									
										
										
										
											2015-03-06 11:46:33 -08:00
										 |  |  | } |