summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources/file_manager/README.harness
blob: 4f920c3e826f15f9bf73018e28b98d0dd03974cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
File Manager Development Harness
================================

The File Manager harness hosts file manager dialogs as a regular web page.  It's
useful for development and manual unit testing.

In order to use the harness, you must start chrome with the following
arguments:
  chrome --allow-file-access-from-files --user-data-dir=UDD_PATH

It is recommended to use the harness with a dedicated user data directory.

To view the harness, visit:
  file://PATH/TO/src/chrome/browser/resources/file_manager/harness.html

On the first page load Chrome will ask for the permission to store local files.
Click OK, then reload the page.

"Full page" view is displayed by default.  You can switch to another
kind of dialog using the links at the top of the page.

Populating the development filesystem
=====================================

The "Save File" dialog type includes "New Folder" button.  This can be used to
populate a few subdirectories for basic testing.

The buttons at the bottom of the page allow you to add files to, or clear out
the mock filesystem.  (This is the filesystem associated with all file: urls.)

The Choose File button (from the bottom of the page) does not support importing
a hierarchy of directories.  If you would like to bulk import a hierarchy, use
the squashdir.py script located in file_manager/bin/squashdir.py.  This will
copy a tree of files into a single directory, renaming them all to include
their original path.  The Choose File button will reconstitute these munged
filenames back into their original structure.

Poking at the File Manager
==========================

From the JS Console, you can refer to the fileManager object as
`harness.fileManager`.