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

Unified Diff: chrome/test/webdriver/commands/file_upload_command.cc

Issue 23526047: Delete old chromedriver code, and remove mongoose webserver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 3 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
Index: chrome/test/webdriver/commands/file_upload_command.cc
diff --git a/chrome/test/webdriver/commands/file_upload_command.cc b/chrome/test/webdriver/commands/file_upload_command.cc
deleted file mode 100644
index 2a2202a78aaff147f1854dfcf348cb199789fa87..0000000000000000000000000000000000000000
--- a/chrome/test/webdriver/commands/file_upload_command.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/test/webdriver/commands/file_upload_command.h"
-
-#include "base/file_util.h"
-#include "base/strings/utf_string_conversions.h"
-#include "base/values.h"
-#include "build/build_config.h"
-#include "chrome/test/webdriver/commands/response.h"
-#include "chrome/test/webdriver/webdriver_error.h"
-#include "chrome/test/webdriver/webdriver_session.h"
-#include "chrome/test/webdriver/webdriver_util.h"
-
-namespace webdriver {
-
-FileUploadCommand::FileUploadCommand(
- const std::vector<std::string>& path_segments,
- DictionaryValue* parameters)
- : WebDriverCommand(path_segments, parameters) {
-}
-
-FileUploadCommand::~FileUploadCommand() {
-}
-
-bool FileUploadCommand::DoesPost() {
- return true;
-}
-
-void FileUploadCommand::ExecutePost(Response* const response) {
- std::string base64_zip_data;
- if (!GetStringParameter("file", &base64_zip_data)) {
- response->SetError(new Error(kUnknownError, "Missing or invalid 'file'"));
- return;
- }
- std::string zip_data;
- if (!Base64Decode(base64_zip_data, &zip_data)) {
- response->SetError(new Error(kUnknownError, "Unable to decode 'file'"));
- return;
- }
-
- base::FilePath upload_dir;
- if (!file_util::CreateTemporaryDirInDir(
- session_->temp_dir(), FILE_PATH_LITERAL("upload"), &upload_dir)) {
- response->SetError(new Error(kUnknownError, "Failed to create temp dir"));
- return;
- }
- std::string error_msg;
- base::FilePath upload;
- if (!UnzipSoleFile(upload_dir, zip_data, &upload, &error_msg)) {
- response->SetError(new Error(kUnknownError, error_msg));
- return;
- }
-
-#if defined(OS_WIN)
- response->SetValue(new base::StringValue(WideToUTF8(upload.value())));
-#else
- response->SetValue(new base::StringValue(upload.value()));
-#endif
-}
-
-} // namespace webdriver
« no previous file with comments | « chrome/test/webdriver/commands/file_upload_command.h ('k') | chrome/test/webdriver/commands/find_element_commands.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698