Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1144)

Side by Side Diff: gin/test/file_unittests.js

Issue 419673004: gin test - add simple file access for JS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add null return tests for no-args and non-existant paths Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 });
OLDNEW
« gin/test/file.cc ('K') | « gin/test/file_runner.cc ('k') | gin/test/run_js_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698