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

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

Issue 2398463004: browser_test that creates filesystem resources in extension origin (Closed)
Patch Set: Rebase & apply alex's fixes. Created 4 years 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/browser/fileapi/mock_file_update_observer.h ('k') | content/public/test/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/browser_test_utils.h
diff --git a/content/public/test/browser_test_utils.h b/content/public/test/browser_test_utils.h
index 9f04c0660c33aa58c14c9cf06eff1b445f84c1f6..1deed61f1a9da8609bcd14c7adafa8302b917112 100644
--- a/content/public/test/browser_test_utils.h
+++ b/content/public/test/browser_test_utils.h
@@ -26,6 +26,7 @@
#include "content/public/browser/web_contents_observer.h"
#include "content/public/common/page_type.h"
#include "ipc/message_filter.h"
+#include "storage/common/fileapi/file_system_types.h"
#include "third_party/WebKit/public/platform/WebInputEvent.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/accessibility/ax_tree_update.h"
@@ -717,6 +718,43 @@ class ConsoleObserverDelegate : public WebContentsDelegate {
DISALLOW_COPY_AND_ASSIGN(ConsoleObserverDelegate);
};
+// Static methods that inject particular IPCs into the message pipe as if they
+// came from |process|. Used to simulate a compromised renderer.
+class PwnMessageHelper {
+ public:
+ // Sends BlobStorageMsg_RegisterBlob
+ static void CreateBlobWithPayload(RenderProcessHost* process,
+ std::string uuid,
+ std::string content_type,
+ std::string content_disposition,
+ std::string payload);
+
+ // Sends BlobHostMsg_RegisterPublicURL
+ static void RegisterBlobURL(RenderProcessHost* process,
+ GURL url,
+ std::string uuid);
+
+ // Sends FileSystemHostMsg_Create
+ static void FileSystemCreate(RenderProcessHost* process,
+ int request_id,
+ GURL path,
+ bool exclusive,
+ bool is_directory,
+ bool recursive);
+
+ // Sends FileSystemHostMsg_Write
+ static void FileSystemWrite(RenderProcessHost* process,
+ int request_id,
+ GURL file_path,
+ std::string blob_uuid,
+ int64_t position);
+
+ private:
+ PwnMessageHelper(); // Not instantiable.
+
+ DISALLOW_COPY_AND_ASSIGN(PwnMessageHelper);
+};
+
} // namespace content
#endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_
« no previous file with comments | « content/browser/fileapi/mock_file_update_observer.h ('k') | content/public/test/browser_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698