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

Unified Diff: content/browser/frame_host/render_frame_host_manager_browsertest.cc

Issue 2080223002: Revert of Fixing renderer's access to a file from HTTP POST (after a xsite transfer). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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: content/browser/frame_host/render_frame_host_manager_browsertest.cc
diff --git a/content/browser/frame_host/render_frame_host_manager_browsertest.cc b/content/browser/frame_host/render_frame_host_manager_browsertest.cc
index 6100a740016ec2b664e56497ebca650c637a049f..10fa48b1d89ab1bf1d4abe58a18622aa1ab53adf 100644
--- a/content/browser/frame_host/render_frame_host_manager_browsertest.cc
+++ b/content/browser/frame_host/render_frame_host_manager_browsertest.cc
@@ -5,7 +5,6 @@
#include <stddef.h>
#include <stdint.h>
-#include <memory>
#include <set>
#include "base/command_line.h"
@@ -39,6 +38,8 @@
#include "content/public/common/bindings_policy.h"
#include "content/public/common/browser_side_navigation_policy.h"
#include "content/public/common/content_switches.h"
+#include "content/public/common/file_chooser_file_info.h"
+#include "content/public/common/file_chooser_params.h"
#include "content/public/common/page_state.h"
#include "content/public/common/url_constants.h"
#include "content/public/test/browser_test_utils.h"
@@ -1928,6 +1929,30 @@
EXPECT_FALSE(handler->IsJavascriptAllowed());
}
+
+class FileChooserDelegate : public WebContentsDelegate {
+ public:
+ FileChooserDelegate(const base::FilePath& file)
+ : file_(file), file_chosen_(false) {}
+
+ void RunFileChooser(RenderFrameHost* render_frame_host,
+ const FileChooserParams& params) override {
+ // Send the selected file to the renderer process.
+ FileChooserFileInfo file_info;
+ file_info.file_path = file_;
+ std::vector<FileChooserFileInfo> files;
+ files.push_back(file_info);
+ render_frame_host->FilesSelectedInChooser(files, FileChooserParams::Open);
+
+ file_chosen_ = true;
+ }
+
+ bool file_chosen() { return file_chosen_; }
+
+ private:
+ base::FilePath file_;
+ bool file_chosen_;
+};
// Test for http://crbug.com/262948.
IN_PROC_BROWSER_TEST_F(RenderFrameHostManagerTest,
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.cc ('k') | content/browser/session_history_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698