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

Unified Diff: tools/ipc_fuzzer/mutate/generate.cc

Issue 932103003: Add support for more param traits in ipc fuzzer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/ipc_fuzzer/mutate/generate.cc
diff --git a/tools/ipc_fuzzer/mutate/generate.cc b/tools/ipc_fuzzer/mutate/generate.cc
index 6d8137dd2ac24c8b15925de4036af0f0d054afd6..d10c9f1e8b54c39c3955654bc154d636c129c5f2 100644
--- a/tools/ipc_fuzzer/mutate/generate.cc
+++ b/tools/ipc_fuzzer/mutate/generate.cc
@@ -1040,18 +1040,21 @@ struct GenerateTraits<content::SyntheticGesturePacket> {
template <>
struct GenerateTraits<content::WebCursor> {
static bool Generate(content::WebCursor* p, Generator* generator) {
- blink::WebCursorInfo::Type type;
- if (!GenerateParam(&type, generator))
- return false;
- content::WebCursor::CursorInfo info(type);
+ content::WebCursor::CursorInfo info;
- // Omitting |externalHandle| since it is not serialized.
+ info.type = (blink::WebCursorInfo::Type)(RandInRange(44));
Martin Barbella 2015/02/18 20:08:02 Can we use the last type + 1 here instead of this?
Tom Sepez 2015/02/18 20:17:11 We'd like to stick out-of-range values here, too.
if (!GenerateParam(&info.hotspot, generator))
return false;
if (!GenerateParam(&info.image_scale_factor, generator))
return false;
if (!GenerateParam(&info.custom_image, generator))
return false;
+ // Omitting |externalHandle| since it is not serialized.
+
+ // Scale factor is expected to be greater than 0, otherwise we hit
+ // a check failure.
+ info.image_scale_factor = fabs(info.image_scale_factor) + 0.001;
+
*p = content::WebCursor(info);
return true;
}
@@ -1290,6 +1293,16 @@ struct GenerateTraits<GURL> {
}
};
+#if defined(OS_WIN)
+template <>
+struct GenerateTraits<HWND> {
+ static bool Generate(HWND* p, Generator* generator) {
+ // TODO(aarya): This should actually generate something.
+ return true;
+ }
+};
+#endif
+
template <>
struct GenerateTraits<IPC::Message> {
static bool Generate(IPC::Message *p, Generator* generator) {
@@ -1330,6 +1343,16 @@ struct GenerateTraits<IPC::ChannelHandle> {
}
};
+#if defined(OS_WIN)
+template <>
+struct GenerateTraits<LOGFONT> {
+ static bool Generate(LOGFONT* p, Generator* generator) {
+ // TODO(aarya): This should actually generate something.
+ return true;
+ }
+};
+#endif
+
template <>
struct GenerateTraits<media::AudioParameters> {
static bool Generate(media::AudioParameters* p, Generator* generator) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698