GPU workaround to simulate Out of Memory errors with large textures
[chromium-blink-merge.git] / gin / test / file_unittests.js
blob8c25806e13994e2b48e53a2c3b0897d1030b1ae9
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.
5 define([
6 "gin/test/expect",
7 "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();
36 this.result = "PASS";
37 });