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

Unified Diff: content/public/test/content_browser_test_utils.h

Issue 2062523002: 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: Removed the new (redundant) access check from RDHI. 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
« no previous file with comments | « content/common/resource_request_body_impl.cc ('k') | content/public/test/content_browser_test_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/content_browser_test_utils.h
diff --git a/content/public/test/content_browser_test_utils.h b/content/public/test/content_browser_test_utils.h
index e198b1ed4f74b64c7951f099942f55304a68dcbf..25d5a88106105be4e94130d0c0d4039857d4cc3d 100644
--- a/content/public/test/content_browser_test_utils.h
+++ b/content/public/test/content_browser_test_utils.h
@@ -6,6 +6,7 @@
#define CONTENT_PUBLIC_TEST_CONTENT_BROWSER_TEST_UTILS_H_
#include "base/callback.h"
+#include "base/files/file_path.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "content/public/browser/web_contents_delegate.h"
@@ -135,6 +136,25 @@ class ConsoleObserverDelegate : public WebContentsDelegate {
DISALLOW_COPY_AND_ASSIGN(ConsoleObserverDelegate);
};
+// Helper for mocking choosing a file via a file dialog.
+class FileChooserDelegate : public WebContentsDelegate {
Charlie Reis 2016/06/17 07:13:36 This should probably go in content_browser_test_ut
Łukasz Anforowicz 2016/06/17 16:44:47 Done.
+ public:
+ // Constructs a WebContentsDelegate that mocks a file dialog.
+ // The mocked file dialog will always reply that the user selected |file|.
+ FileChooserDelegate(const base::FilePath& file);
+
+ // Implementation of WebContentsDelegate::RunFileChooser.
+ void RunFileChooser(RenderFrameHost* render_frame_host,
+ const FileChooserParams& params) override;
+
+ // Whether the file dialog was shown.
+ bool file_chosen() { return file_chosen_; }
+
+ private:
+ base::FilePath file_;
+ bool file_chosen_;
+};
+
#if defined OS_MACOSX
void SetWindowBounds(gfx::NativeWindow window, const gfx::Rect& bounds);
#endif
« no previous file with comments | « content/common/resource_request_body_impl.cc ('k') | content/public/test/content_browser_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698