OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 define([ |
| 6 "gin/test/expect", |
| 7 "file" |
| 8 ], function(expect, file) { |
| 9 |
| 10 function isString(x) { |
| 11 return toString.call(x) === '[object String]' |
| 12 } |
| 13 |
| 14 var rootDir = file.getSourceRootDirectory(); |
| 15 expect(isString(rootDir)).toBeTruthy(); |
| 16 |
| 17 var noArgsNull = file.getFilesInDirectory(); |
| 18 expect(noArgsNull).toBeNull(); |
| 19 |
| 20 var files = file.getFilesInDirectory(rootDir); |
| 21 expect(Array.isArray(files)).toBeTruthy(); |
| 22 |
| 23 var nsdNull = file.getFilesInDirectory(rootDir + "/no_such_dir"); |
| 24 expect(nsdNull).toBeNull(); |
| 25 |
| 26 var owners = file.readFileToString(rootDir + "/OWNERS"); |
| 27 expect(isString(owners)).toBeTruthy(); |
| 28 expect(owners.length).toBeGreaterThan(0); |
| 29 |
| 30 noArgsNull = file.readFileToString(); |
| 31 expect(noArgsNull).toBeNull(); |
| 32 |
| 33 var nsfNull = file.readFileToString(rootDir + "/no_such_file"); |
| 34 expect(nsfNull).toBeNull(); |
| 35 |
| 36 this.result = "PASS"; |
| 37 }); |
OLD | NEW |