OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_DIR_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_DIR_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_DIR_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_DIR_H_ |
7 | 7 |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/strings/string_piece.h" | 10 #include "base/strings/string_piece.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 // Writes |contents| to |filename| within the unpacked dir, overwriting | 32 // Writes |contents| to |filename| within the unpacked dir, overwriting |
33 // anything that was already there. | 33 // anything that was already there. |
34 void WriteFile(const base::FilePath::StringType& filename, | 34 void WriteFile(const base::FilePath::StringType& filename, |
35 base::StringPiece contents); | 35 base::StringPiece contents); |
36 | 36 |
37 // Packs the extension into a .crx, and returns the path to that | 37 // Packs the extension into a .crx, and returns the path to that |
38 // .crx. Multiple calls to Pack() will produce extensions with the same ID. | 38 // .crx. Multiple calls to Pack() will produce extensions with the same ID. |
39 base::FilePath Pack(); | 39 base::FilePath Pack(); |
40 | 40 |
41 // Returns the path to the unpacked directory. | 41 // Returns the path to the unpacked directory. |
42 base::FilePath unpacked_path() { | 42 base::FilePath UnpackedPath(); |
43 return dir_.path(); | |
44 } | |
45 | 43 |
46 private: | 44 private: |
47 // Stores files that make up the extension. | 45 // Stores files that make up the extension. |
48 base::ScopedTempDir dir_; | 46 base::ScopedTempDir dir_; |
49 | 47 |
50 // Stores the generated .crx and .pem. | 48 // Stores the generated .crx and .pem. |
51 base::ScopedTempDir crx_dir_; | 49 base::ScopedTempDir crx_dir_; |
52 }; | 50 }; |
53 | 51 |
54 } // namespace extensions | 52 } // namespace extensions |
55 | 53 |
56 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_DIR_H_ | 54 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_DIR_H_ |
OLD | NEW |