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

Unified Diff: gpu/command_buffer/tests/gl_query_unittest.cc

Issue 732423002: Update from chromium https://crrev.com/304586 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | « gpu/command_buffer/tests/gl_manager.cc ('k') | gpu/command_buffer_service.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/tests/gl_query_unittest.cc
diff --git a/gpu/command_buffer/tests/gl_query_unittest.cc b/gpu/command_buffer/tests/gl_query_unittest.cc
index 0104430a32414d6c78336276160d5996e898ff10..5ea7e8d86a45a1462c330a622051975efeff32b9 100644
--- a/gpu/command_buffer/tests/gl_query_unittest.cc
+++ b/gpu/command_buffer/tests/gl_query_unittest.cc
@@ -63,7 +63,7 @@ TEST_F(QueryTest, MultipleQueries) {
glGetQueryObjectuivEXT(commands_issue_query, GL_QUERY_RESULT_EXT, &result);
// Sanity check - the resulting delta is shorter than the time it took to
// run this test.
- EXPECT_LT(result, base::TimeDelta(after - before).InMicroseconds());
+ EXPECT_LE(result, base::TimeDelta(after - before).InMicroseconds());
result = 0;
available = 0;
@@ -152,6 +152,8 @@ TEST_F(QueryTest, CommandsCompleted) {
return;
}
+ base::TimeTicks before = base::TimeTicks::HighResNow();
+
GLuint query;
glGenQueriesEXT(1, &query);
glBeginQueryEXT(GL_COMMANDS_COMPLETED_CHROMIUM, query);
@@ -161,7 +163,12 @@ TEST_F(QueryTest, CommandsCompleted) {
glFlush();
GLuint result = 0;
glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_EXT, &result);
- EXPECT_EQ(0u, result);
+
+ base::TimeTicks after = base::TimeTicks::HighResNow();
+ // Sanity check - the resulting delta is shorter than the time it took to
+ // run this test.
+ EXPECT_LE(result, base::TimeDelta(after - before).InMicroseconds());
+
glDeleteQueriesEXT(1, &query);
GLTestHelper::CheckGLError("no errors", __LINE__);
}
« no previous file with comments | « gpu/command_buffer/tests/gl_manager.cc ('k') | gpu/command_buffer_service.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698