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

Unified Diff: mojo/public/tests/system_core_perftest.cc

Issue 25323003: Mojo: Optimize VerifyUserPointer(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | mojo/system/core_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/tests/system_core_perftest.cc
diff --git a/mojo/public/tests/system_core_perftest.cc b/mojo/public/tests/system_core_perftest.cc
index 2e9fef22a078b5c58e3536f8d3dfa7d6b8225dc1..8ee7ceb2cc7be1e8015c180a0bae534f84fe9e5b 100644
--- a/mojo/public/tests/system_core_perftest.cc
+++ b/mojo/public/tests/system_core_perftest.cc
@@ -45,6 +45,15 @@ class SystemPerftest : public test::TestBase {
DCHECK_EQ(result, MOJO_RESULT_OK);
}
+ void MessagePipe_EmptyRead() {
+ MojoResult result;
+ result = ReadMessage(h_0_,
+ NULL, NULL,
+ NULL, NULL,
+ MOJO_READ_MESSAGE_FLAG_MAY_DISCARD);
+ DCHECK_EQ(result, MOJO_RESULT_NOT_FOUND);
+ }
+
protected:
Handle h_0_;
Handle h_1_;
@@ -95,5 +104,15 @@ TEST_F(SystemPerftest, MessagePipe_WriteAndRead) {
CHECK_EQ(Close(h_1_), MOJO_RESULT_OK);
}
+TEST_F(SystemPerftest, MessagePipe_EmptyRead) {
+ CHECK_EQ(CreateMessagePipe(&h_0_, &h_1_), MOJO_RESULT_OK);
+ test::IterateAndReportPerf(
+ "MessagePipe_EmptyRead",
+ base::Bind(&SystemPerftest::MessagePipe_EmptyRead,
+ base::Unretained(this)));
+ CHECK_EQ(Close(h_0_), MOJO_RESULT_OK);
+ CHECK_EQ(Close(h_1_), MOJO_RESULT_OK);
+}
+
} // namespace
} // namespace mojo
« no previous file with comments | « no previous file | mojo/system/core_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698