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

Unified Diff: chrome/test/webdriver/webdriver_util.h

Issue 9515005: [chromedriver] Add command for uploading a file to a remote ChromeDriver server, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/webdriver/webdriver_session.cc ('k') | chrome/test/webdriver/webdriver_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/webdriver/webdriver_util.h
diff --git a/chrome/test/webdriver/webdriver_util.h b/chrome/test/webdriver/webdriver_util.h
index 2628e0e8384646eb5c2c0e3463a2adcd5026b07f..9450c5ed05782703ac9850067bd5e030ef0f9aff 100644
--- a/chrome/test/webdriver/webdriver_util.h
+++ b/chrome/test/webdriver/webdriver_util.h
@@ -24,6 +24,28 @@ namespace webdriver {
// Generates a random, 32-character hexidecimal ID.
std::string GenerateRandomID();
+// Decodes the given base64-encoded string, after removing any newlines,
+// which are required in some base64 standards.
+// Returns true on success.
+bool Base64Decode(const std::string& base64, std::string* bytes);
+
+// Unzip the given zip archive, after base64 decoding, into the given directory.
+// Returns true on success.
+bool Base64DecodeAndUnzip(const FilePath& unzip_dir,
+ const std::string& base64,
+ std::string* error_msg);
+
+// Unzips the sole file contained in the given zip data |bytes| into
+// |unzip_dir|. The zip data may be a normal zip archive or a single zip file
+// entry. If the unzip successfully produced one file, returns true and sets
+// |file| to the unzipped file.
+// TODO(kkania): Remove the ability to parse single zip file entries when
+// the current versions of all WebDriver clients send actual zip files.
+bool UnzipSoleFile(const FilePath& unzip_dir,
+ const std::string& bytes,
+ FilePath* file,
+ std::string* error_msg);
+
// Returns the equivalent JSON string for the given value.
std::string JsonStringify(const base::Value* value);
« no previous file with comments | « chrome/test/webdriver/webdriver_session.cc ('k') | chrome/test/webdriver/webdriver_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698