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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CONTENT_PUBLIC_TEST_CONTENT_BROWSER_TEST_UTILS_H_ 5 #ifndef CONTENT_PUBLIC_TEST_CONTENT_BROWSER_TEST_UTILS_H_
6 #define CONTENT_PUBLIC_TEST_CONTENT_BROWSER_TEST_UTILS_H_ 6 #define CONTENT_PUBLIC_TEST_CONTENT_BROWSER_TEST_UTILS_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/files/file_path.h"
9 #include "base/macros.h" 10 #include "base/macros.h"
10 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
11 #include "content/public/browser/web_contents_delegate.h" 12 #include "content/public/browser/web_contents_delegate.h"
12 #include "content/public/common/page_type.h" 13 #include "content/public/common/page_type.h"
13 #include "ui/gfx/native_widget_types.h" 14 #include "ui/gfx/native_widget_types.h"
14 #include "url/gurl.h" 15 #include "url/gurl.h"
15 16
16 namespace base { 17 namespace base {
17 class FilePath; 18 class FilePath;
18 } 19 }
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 WebContents* web_contents_; 129 WebContents* web_contents_;
129 std::string filter_; 130 std::string filter_;
130 std::string message_; 131 std::string message_;
131 132
132 // The MessageLoopRunner used to spin the message loop. 133 // The MessageLoopRunner used to spin the message loop.
133 scoped_refptr<MessageLoopRunner> message_loop_runner_; 134 scoped_refptr<MessageLoopRunner> message_loop_runner_;
134 135
135 DISALLOW_COPY_AND_ASSIGN(ConsoleObserverDelegate); 136 DISALLOW_COPY_AND_ASSIGN(ConsoleObserverDelegate);
136 }; 137 };
137 138
139 // Helper for mocking choosing a file via a file dialog.
140 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.
141 public:
142 // Constructs a WebContentsDelegate that mocks a file dialog.
143 // The mocked file dialog will always reply that the user selected |file|.
144 FileChooserDelegate(const base::FilePath& file);
145
146 // Implementation of WebContentsDelegate::RunFileChooser.
147 void RunFileChooser(RenderFrameHost* render_frame_host,
148 const FileChooserParams& params) override;
149
150 // Whether the file dialog was shown.
151 bool file_chosen() { return file_chosen_; }
152
153 private:
154 base::FilePath file_;
155 bool file_chosen_;
156 };
157
138 #if defined OS_MACOSX 158 #if defined OS_MACOSX
139 void SetWindowBounds(gfx::NativeWindow window, const gfx::Rect& bounds); 159 void SetWindowBounds(gfx::NativeWindow window, const gfx::Rect& bounds);
140 #endif 160 #endif
141 161
142 } // namespace content 162 } // namespace content
143 163
144 #endif // CONTENT_PUBLIC_TEST_CONTENT_BROWSER_TEST_UTILS_H_ 164 #endif // CONTENT_PUBLIC_TEST_CONTENT_BROWSER_TEST_UTILS_H_
OLDNEW
« 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