Debian Codegraph @

closure-library/closure/goog/testing/fs/file.js

raw
1 // Copyright 2011 The Closure Library Authors. All Rights Reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS-IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 /**
16 * @fileoverview Mock file object.
17 *
18 */
19
20 goog.setTestOnly('goog.testing.fs.File');
21 goog.provide('goog.testing.fs.File');
22
23 goog.require('goog.testing.fs.Blob');
24
25
26
27 /**
28 * A mock file object.
29 *
30 * @param {string} name The name of the file.
31 * @param {Date=} opt_lastModified The last modified date for this file. May be
32 * null if file modification dates are not supported.
33 * @param {string=} opt_data The string data encapsulated by the blob.
34 * @param {string=} opt_type The mime type of the blob.
35 * @constructor
36 * @extends {goog.testing.fs.Blob}
37 * @final
38 */
39 goog.testing.fs.File = function(name, opt_lastModified, opt_data, opt_type) {
40 goog.testing.fs.File.base(this, 'constructor', opt_data, opt_type);
41
42 /**
43 * @see http://www.w3.org/TR/FileAPI/#dfn-name
44 * @type {string}
45 */
46 this.name = name;
47
48 /**
49 * @see http://www.w3.org/TR/FileAPI/#dfn-lastModifiedDate
50 * @type {Date}
51 */
52 this.lastModifiedDate = opt_lastModified || null;
53 };
54 goog.inherits(goog.testing.fs.File, goog.testing.fs.Blob);