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.
8 ], function(expect
, file
) {
10 function isString(x
) {
11 return toString
.call(x
) === '[object String]'
14 var rootDir
= file
.getSourceRootDirectory();
15 expect(isString(rootDir
)).toBeTruthy();
17 var noArgsNull
= file
.getFilesInDirectory();
18 expect(noArgsNull
).toBeNull();
20 var files
= file
.getFilesInDirectory(rootDir
);
21 expect(Array
.isArray(files
)).toBeTruthy();
23 var nsdNull
= file
.getFilesInDirectory(rootDir
+ "/no_such_dir");
24 expect(nsdNull
).toBeNull();
26 var owners
= file
.readFileToString(rootDir
+ "/OWNERS");
27 expect(isString(owners
)).toBeTruthy();
28 expect(owners
.length
).toBeGreaterThan(0);
30 noArgsNull
= file
.readFileToString();
31 expect(noArgsNull
).toBeNull();
33 var nsfNull
= file
.readFileToString(rootDir
+ "/no_such_file");
34 expect(nsfNull
).toBeNull();